FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
12-02-2022 02:00 PM
I'm only a couple of weeks into WebIQ, and no previous json experience, etc. It had been mentioned in another post, Bit Access read/write from button, that the syntax bit[n]:Word does not appear to work for the button widget. I can concur I cannot get the read/write access working to an OPC-UA variable via this method. I am workingaround this by using a composite widget, with UI action and a placeholder for Word and bitmask:
It works, but I'd much rather have placeholders for Word and Bit, so as to fully replicated the bit[n]:Word syntax. Is there a way to apply an operator, like 2**bit, using snippets? Or perhaps someone knows a better way?
Solved! Go to Solution.
12-05-2022 12:14 PM
I think there is a missunderstanding. The Bitaccess is working for buttons. Only virtual items not supports the bit access.
12-05-2022 03:49 PM
I will put a bit more on that other post concerning how the bit-access isn't working for us. However, question still stands as to whether there is a method and syntax for doing such a placeholder value conversion?
12-05-2022 04:33 PM
I do not understand what you want to do. Can you describe it in a different way?
12-05-2022 04:58 PM
Sure,
On UI action set-item-bitmask, it requires a value in decimal format, e.g. '32768'
If I place the object with this UI action within a composite widget, then create a placeholder 'bitMask', and use a snippet to drive this, also is fine (like in my images in OP).
What I am asking is if I can instead create a placeholder 'bit', and within the snippet convert 'bit' into a bitmask value, So if 'bit' = 15 for this istance of composite, internally I can apply 2^15 to utilise 32768 . In WinStudio, I'd be writing something like:
#Word: = #Word: OR Pow(2, #Bit:)
where (2,#Bit:) was essentially bitMask derived from my bit input.
12-06-2022 09:58 AM
It's a bug of "Write on/off values when pressed/released", which will be fixed in next WebIQ version.
As workaround you can use the ui-Action "Write item"