800xA Program Alarm from Word to Bits
I am creating a new object for the control and status of Motors. Now I have created:
- 1 Command word (16bits) for operational commands.
- 1 Status word (16bit) for current status.
Binary wise I am able to efficiently program the entire object. But now I am stuck at programming the Alarms. I have several alarm bits that I have stored in 1 word (16bits), how do I convert/program 1 word to several bits that each represent a different alarm for the motor object.
As an example:
0000 0000 0000 0000 = no alarm active
0000 0000 0000 0001 = alarm 1 active
0000 0000 0000 0010 = alarm 2 active
I have been able to the above quite neatly in the graphic builder but I have no qlue how to approach this with the alarms.
Hope you can help!
Jesperkl solution can be seen in the AC800M system alarms they are converted like that. If you are using AC800M I would add the AlarmcondbasicM modules and connect those with an AND function to each bit (but then I would use a structured data type for your alarms which is easier to see when you are troubleshooting a problem).