g.mccormick
Lifetime Supporting Member
I have an INT variable containing the value of a status word. I have also created a structure of 16 BOOL. Instead of having to manually set each structure element to my INT.bit, I am attempting to use the trick of addressing two variables at the same address.
Example:
ABB_StatWord_Intermediate AT %MB1000: INT;
ABB_Status AT %MB1000: ST_ABB_STATUS_WORD;
My Structure looks like:
TYPE ST_ABB_STATUS_WORD :
STRUCT
Ready: BOOL;
SwitchedOn: BOOL;
OpEnabled: BOOL;
Fault: BOOL;
VoltEnabled: BOOL;
QuickStopActive: BOOL;
Bit6: BOOL;
Warning: BOOL;
Bit8: BOOL;
Bit9: BOOL;
Bit10: BOOL;
Bit11: BOOL;
Bit12: BOOL;
Bit13: BOOL;
Bit14: BOOL;
Bit15: BOOL;
END_STRUCT
END_TYPE
This is not working, as the first two structure elements bascially becom INVALID.
What am I missing?
Example:
ABB_StatWord_Intermediate AT %MB1000: INT;
ABB_Status AT %MB1000: ST_ABB_STATUS_WORD;
My Structure looks like:
TYPE ST_ABB_STATUS_WORD :
STRUCT
Ready: BOOL;
SwitchedOn: BOOL;
OpEnabled: BOOL;
Fault: BOOL;
VoltEnabled: BOOL;
QuickStopActive: BOOL;
Bit6: BOOL;
Warning: BOOL;
Bit8: BOOL;
Bit9: BOOL;
Bit10: BOOL;
Bit11: BOOL;
Bit12: BOOL;
Bit13: BOOL;
Bit14: BOOL;
Bit15: BOOL;
END_STRUCT
END_TYPE
This is not working, as the first two structure elements bascially becom INVALID.
What am I missing?