NetNathan
Lifetime Supporting Member
I have a pressure calculation to calculate in Controllogix.
The gauge is sending the high_byte and low_byte to Controllogix. I need to convert to the correct decimal format for vacuum level in millibar
Calculation required for conversion from gauge manual:
Pmbar = 10((high byte × 256 + low byte) / 4000 - 12.5)
Pmbar, high_byte, and low_byte are the tags and are INT
XPY block description:
The XPY instruction takes Source A (X) to the power of Source B (Y) and stores the result in the Destination.
In the XPY instruction, I am trying to use:
Source A=10
Source B = ((high_byte × 256 + low_byte) / 4000 - 12.5)
Dest = PmBar
On verify I am getting:
Error: Rung 2, XPY, Operand 2: Invalid expression or tag.
I a have tried removing outer parentheses using (high_byte × 256 + low_byte) / 4000 - 12.5 but same error
Do I need to calculate ((high_byte × 256 + low_byte) / 4000 - 12.5) in a different instruction and move that result to Source B?
..
The gauge is sending the high_byte and low_byte to Controllogix. I need to convert to the correct decimal format for vacuum level in millibar
Calculation required for conversion from gauge manual:
Pmbar = 10((high byte × 256 + low byte) / 4000 - 12.5)
Pmbar, high_byte, and low_byte are the tags and are INT
XPY block description:
The XPY instruction takes Source A (X) to the power of Source B (Y) and stores the result in the Destination.
In the XPY instruction, I am trying to use:
Source A=10
Source B = ((high_byte × 256 + low_byte) / 4000 - 12.5)
Dest = PmBar
On verify I am getting:
Error: Rung 2, XPY, Operand 2: Invalid expression or tag.
I a have tried removing outer parentheses using (high_byte × 256 + low_byte) / 4000 - 12.5 but same error
Do I need to calculate ((high_byte × 256 + low_byte) / 4000 - 12.5) in a different instruction and move that result to Source B?
..
Last edited: