Skip to content

feat(2202): add ADS .tpy symbol file import for Beckhoff TwinCAT tags#2227

Open
orjinameh wants to merge 4 commits intofrangoteam:masterfrom
orjinameh:feat/ads-tpy-import-2202
Open

feat(2202): add ADS .tpy symbol file import for Beckhoff TwinCAT tags#2227
orjinameh wants to merge 4 commits intofrangoteam:masterfrom
orjinameh:feat/ads-tpy-import-2202

Conversation

@orjinameh
Copy link

📌 Description

Adds support for importing PLC variable/tag definitions directly from a Beckhoff TwinCAT .tpy symbol file into the FUXA ADS device configuration.

  • Closes [FEATURE] ADS/Beckhoff: Import Tags from .tpy Symbol File #2202
  • Solves the problem of manually adding tags one by one for Beckhoff TwinCAT projects
  • Added a .tpy XML parser that extracts symbols and maps TwinCAT types to FUXA types
  • Added POST /api/ads/import-tpy endpoint that accepts a .tpy file and returns parsed tags
  • Supports both TwinCAT 2 and TwinCAT 3 .tpy formats

🧪 Type of Change

  • New feature

🚫 Build Artifacts Check

  • I did NOT commit /client/dist
  • I did NOT commit generated Angular build output
  • Only source files are included

🔍 Checklist

  • Code follows project coding standards
  • I tested my changes locally
  • Issue opened (for major changes)

📝 Additional Notes

Files changed:

  • server/runtime/devices/adsclient/tpy-parser.js — XML parser for .tpy files
  • server/api/projects/index.js — added POST /api/ads/import-tpy endpoint
  • server/test/tpy-parser.test.js — 15/15 unit tests passing

Supported TwinCAT types: BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, REAL, LREAL, STRING, TIME, DATE
ARRAY and STRUCT types are skipped in v1 as specified in the issue.

@unocelli
Copy link
Member

unocelli commented Mar 8, 2026

@orjinameh I applied a few technical fixes directly on this PR branch to unblock the review:

fixed the TPY parser require path in server/api/projects/index.js
kept a multer file-size limit for minimal hardening
updated server/test/tpy-parser.test.js to standard Mocha style with clearer assertions
I intentionally avoided broader refactoring to keep this PR scope focused.
If this looks good to you, I can move/reorganize the import API in a follow-up step after merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] ADS/Beckhoff: Import Tags from .tpy Symbol File

2 participants