Iconics Suite - control separate bits from 16bit register using AssetWorX [Iconics syntax]

Iconics Suite - Control separate bits from 16bit register using AssetWorX [Iconics syntax]

This article show how to control separate bits from 16bit register from separate tags

Create tag with data source connected to 16 bit register

Using Workbench create first tag in your asset connected to e.g. D register



Create tag for bit0 that will be Multiply




Add data source pointing on tag connected to 16bit register


Open editor for READ expression


As expression choose bittest function


As arguments for bit test function choose as "number" -> {{realtimepoint}} (this points on you 16bit register) and for "bitIndex" -> 0


select parameter {{realtimepoint}}


Put as bitIndex 0
Complete expression should look like this:


Now enable end edit WRITE expression


For write expression choose setbit() function


This time as argument use both parametrs {{realtimepoint}} and {{input}}




Complete expression should look like this


Complete settings for bit0


Multiply bit0 tag for rest bits in register

Select tag for bit0 and choose Multiply function


Change settings to generate missing 15bits. Notice that we are using {0} placeholder to iterate from 1-15


Now you have all bits ready to control from separate tags



Notice that (for Advance tag counting) even if you use couple of those tags on the same Display it will be counted by license server as one tag cause all of them are pointing on the same D register