Support Forums
Creating reusable tag structure for bitwise reads in a packed PLC integer

Yesterday, a customer asked the best way to create a reusable set of bitwise reads for a packed PLC integer register. This is best done by creating a tag structure with a Context Tag as the parent. Create a parameter for the Context Tag called something like "BaseRegister" but leave it's value blank. Create the preferred Digital Status tags for each bitwise read as its children and set the Address field of each to a Parameter Expression of Concat(..\BaseRegister,"/x) where x is the bit number to be read.

This structure can now be copied as many times as required. Just change the parameter for the Context Tag to the integer number and you're done. This structure can also be saved as a new Tag Type if you want to ensure standardization across the application.

Yesterday, a customer asked the best way to create a reusable set of bitwise reads for a packed PLC integer register. This is best done by creating a tag structure with a Context Tag as the parent. Create a parameter for the Context Tag called something like "BaseRegister" but leave it's value blank. Create the preferred Digital Status tags for each bitwise read as its children and set the Address field of each to a Parameter Expression of Concat(..\BaseRegister,"/x) where x is the bit number to be read. This structure can now be copied as many times as required. Just change the parameter for the Context Tag to the integer number and you're done. This structure can also be saved as a new Tag Type if you want to ensure standardization across the application.
116
0
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft