Controllogix XPY instruction use

NetNathan

Lifetime Supporting Member
Join Date
Nov 2011
Location
Corona, CA
Posts
2,199
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?

..
 
Last edited:
Sorry, don't remember ascii command to how to show superscript..
Pmbar = 10 to the power of ((high byte × 256 + low byte) / 4000 - 12.5)
 
Example from gauge manual:

IF
High Byte = 242
Low Byte = 48

Then
p = 10((242 × 256 + 48) / 4000 - 12.5) = 10 to the power of 3 or p=1000 mbar
 
Last edited:
It appears I need to use ((high_byte × 256 + low_byte) / 4000 - 12.5) in a CPT block and use that result in as Source B in an XPY block.
I just can't the equation to verify in the CPT instruction.
 
I will try the many choices and see.
Remember the 242 and the 48 are the high_byte and low_byte tags, because they change with the pressure.
I have found that it appears that using tags requires spacing on both sides of the tags..

Also the math procedure must be:
(high_byte × 256 + low_byte) = "result 1"
then divide "result 1" by 4000 = "result 2"
then subtract 12.5 from "result 2" = "final result"

I guess I could use 3 math instructions (or 5 if issue with "result 1") for the 3 (or 5) answers then use XPY for power of 10 on "final result".
I just thought the CPT instruction would handle the complete math instruction.

Oh yea... I know the *10 part of the posts will not work. I need the "final result" to the power of 10 not just multiply the "final result" by 10....big difference in answer.

..
 
Last edited:
Will this work for you ??

You sure you are reading the formula correctly thou ?? If it is correct, the guy who generated the maths for the transducer was smoking crack....

Capture.PNG
 
I will test it and let you know. Thanks a lot for your work on this calc....

I think my biggest mistake was in trying to use "x" instead of "*" for multiply....duh
(That is what happens when you try to copy instructions from a manual...)

Actually, this is acceptable also:
10** ((( High_Byte * 256 + Low_Byte )/ 4000)- 12.5)

I assume the 10** means to the power of?

And absolutely... yes... I think the people that generate the unbelievable math calculations for correcting the output for their pressure devices are on crack.
I have seen a lot of straight linear voltage/current signals for pressure devices and wonder over and over why other companies do not use the same.

..
 
Can understand using funky math if you are working out a calc from root components... If you have a device, like a power monitor, pressure transmitter etc with comms, the most you should have to do is join words / bytes together to get a number...

Don't think you can even do X**Y in a micro...
 
Really true.
This gauge is very fancy.
Combines 3 sensors to cover pressure range of 1500 to 10-5 mbar.
Gauge can be purchased with display.
Analog out and RS232 standard, but has option of DeviceNet, Profibus DP, or RS485 out.

Yet EVERY analog out signal (from the gauge or communications) requires math to read pressure correctly??????
You would think a gauge this fancy could have a linear analog out....ESPECIALLY since they are already combining the 3 pressure sensors into 1 pressure reading.
You get a frigging "High Byte" and "Low Byte" out in INT to read pressure with the communications and the analog out is 0-10.13 V against the log of pressure, even more math.
Unbelievable...
 
Last edited:

Similar Topics

Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
55
Hello, I have two 16 point input cards and 1 16 point output card showing module faulted on my IO tree in Logix Designer. The fault code is...
Replies
7
Views
207
Hello, My associate and I are trying to sync up two ControlLogix racks (7-slot chassis) with identical modules. We are able to see the secondary...
Replies
4
Views
184
Trying to setup a message read via Ethernet. I have the path setup as 1, 1, 2, 192.168.66.10 I get an error code 1, ext err 315. I am beating...
Replies
9
Views
225
I have a redundant ControlLogix being set up. This program reads a value from a remote site which happens to be SLC PLC. Rockwell mentions SLC...
Replies
2
Views
91
Back
Top Bottom