I have the condition of a pump represented using different tags. Some are boolean alarms, others are registers where the number indicates what the alarm is (G001_State). I want all these tags to be represented in one tag (G001_Total_Status) by a number like it is with (G001_State) . How do I do this?
Have a look at using an expression tag using binEnc()
Thanks I will take a look
I have used the binEnc() expression on my boolean tags which has worked to get them as numbers. But I still have two different tags that have numbers representing alarms that i would like to group together. How would i do this?
E.g
Tag1:
0 - Motor running
1 - Abnormal
2 - Fault
Tag2:
0- Motor overheat
1- Pressure alarm
2- Vac Alarm
How do I get them combined in Tag 3 as the following:
0 - Motor running
1 - Abnormal
2 - Fault
3- Motor overheat
4- Pressure alarm
5- Vac Alarm
If they are all separate states:
Tag1 + (Tag2 + 3)
Why are you trying to combine these two things? You're positive that these states are mutually exclusive?
I want to have a label that says the condition of the motor, and the only way I know of doing it is to have all the states under one tag. Unless its possible to have multiple bindings on one label?
I think a way around this may be to convert the other tag into separate Boolean tags for each alarm, and then use binEnc to add them together?
Consider nesting your logic on the label binding, possibly through case/if statements. Since you're in perspective, binding transforms might help you as well. I think you'll find it to be much easier to work with (and troubleshoot/change later).
It'll be much easier to keep individual tags as booleans with their own alarms and reference them as needed in your view.
Use an Expression Structure. Then bind the label to the whole structure, you can use a transform to format it as needed.
For what it's worth, I suggest NOT using 0 as a running state or as a fault status. eg:
0 - Off
1 - Running
2 - Abnormal
3 - Fault
or
0 - No fault
1 - Motor Overheat
2 - Pressure Alarm
3 - Vac Alarm
Thanks, I will do this if its not good practice