Hello, after understanding that it is not possible to use a variable in bit addressing, I am wondering if there are any possible workarounds to still dynamically access elements of an UDINT.
And are there any plans to implement this feature natively into AS?
Not sure if that is what you want to do but you could let the PLC processor take care of the conversion directly.
For that, you will need a DWord variable to be able to use your variable in bit addressing. For your specific case, the UDINT variable needs to be created as a pointer.
With this variable declared as a pointer you would normally access another variable of UDINT datatype. In that case we are going to “cheat” and access our DWORD variable from which we can perform bit addressing.
Hey, Thanks for your Answer. But I don’t think that completely fits my use case here.
My initial goal was to iterate over the single Bits of an UDINT and check if it changed.
Just so anyone who finds this post in the future has it, here is a link to the online Help for the GUID that Oliver references above: B&R Online Help (br-automation.com)