12/10/2024 2:27 PM | |
Joined: 1/21/2013 Last visit: 2/12/2025 Posts: 3537 Rating:
|
Hi spencerJ56, As mentioned in the manual, the data types Bool, Byte, Word, DWord, LWord or Array with Byte, Word, DWord, LWord are supported. Kind regards |
12/13/2024 12:39 PM | |
Joined: 10/24/2024 Last visit: 2/11/2025 Posts: 8 Rating:
|
Found a work around after more digging I will leave here in case anyone else finds this thread and has the same problem. "A customer of mine selected a Siemens WinCC Unified RT (PC) with a Rockwell 5380 processor. I can understand your issue. Siemens discrete alarm only works with BOOL or WORD/DWORD (ANY_BIT data type). My Rockwell PLC programs publishes faults as DINT (32 faults). Since WORD/DWORD does not exists (as a native type) either faults are publish as BOOL or the WinCC unified converts them. As indicated by mk42, a scheduled task is a good start. Each DINT needs a scheduled task (tag changed). I don't see that as an issue; it's fast to setup and there are no WinCC Unified performance issues. Alarm/Fault have a very slow hit rate and depending on the machine size, 10 DINT would give 320 faults. As you mentionned, the problem is how to convert DINT to DWORD on WinCC Unified? There are no WinCC helper function and, as far as I know, JS will not be of any help. Solution: On PLC tag change (DINT), bit shift the DINT and Set/Reset a mirror target DWORD. Here are the steps: 1- Add the same number of DWORD internal tags (a DWORD for each DINT, 1:1). 2- Create a Global script (DINT_TO_DWORD) with the following code: export function DINT_TO_DWORD(dintValue, tagNameToWrite) { /* Set DWORD tag bit that mirrors the DINT bit field values Useful to set alarms according to a DINT tag (typ. for Rockwell processor) param: dintValue : tag value to parse tagNameToWrite : string name of the tag to be written to (typ. DWORD tag) */ let tag = Tags(tagNameToWrite); for (let i = 0; i < 32; i++) { let value = dintValue >> i & 0x0001; if (value != 0) tag.SetBit(i); else tag.ResetBit(i); } } 3- Setup a Task Schedule for each DINT (PLC tags). For each task, set in the "Events/Update" a call to the DINT_TO_DWORD global script. Ex. GlobalModule.DINT_TO_DWORD dintValue: CONTROLLERTAGS\Cell\fault // DINT, PLC Tag tagNameToWrite: cellFault // DWORD, alarm tag name 4- Setup discrete alarms in WinCC Unified using the mirror DWORDs." -RickIndControl |
This contribution was helpful to
1 thankful Users |
Follow us on