In an Indralogic project we have a union of DWORD and a 32 element structure of type BIT. For example:
TYPE UN_CONTROL :
UNION
Word : WORD;
Bits : ST_CTRL_BITS;
END_UNION
END_TYPE
TYPE ST_CTRL_BITS:
STRUCT
b0 : BIT;
b1 : BIT;
...
...
b31 : BIT;
END_STRUCT
END_TYPE;
We have this because some legacy HMI used words to communicate, but within the PLC itself it is nice to be able to address variables as control.bits.b<whatever name>.
This works within indralogic, no problem. The trouble is, when trying to access this word via OPC-UA (UA-client, Web-IQ, etc) it neither appears as the bits or the word, it is like it has completely dissappeared.
I know I could re-write the code to switch between WORDs and, say, a BOOL structure, but I was hoping to find a neater solution utilising the UNION. Any suggestions?
p.s. in an integration with a 3rd-party (UniOP device), I shared the XML schema and XML file with the project variables, and the developer could read and manipulate the BIT!