Analog Data from Remote I/O Module.. Cant figure it out!

Snap25

Lifetime Supporting Member
Join Date
Dec 2014
Location
Michigan
Posts
237
I'm going to try to ask this question again, I think brought this up a few months ago maybe? Anyways,

I have a (3) analog inputs going into a FESTO CPX Analog input module. I have it the instruments wired up and the when I connect my laptop to communicate to the Festo unit via their tool.. everything looks great. I can read the values and it scales the 4-20mA to 0 - 4095 (I provided pictures) When I connect it to my CompactLogix I have no issue setting up bits to control the solenoid values on the Remote I/O but I cant figure out the damn analog inputs!!


They are sending the data in 2 different SINT's and the program shows 8 bits each... I tried combining those together with COP, MOV, and what ever else I could try. Nothing is working for me. I guess I just don't understand how the data is being transferred and how to convert it back to the value that is showing on the FESTO Maintenace Tool software..

What do I do with those bits to get it work right?

If I could stop wasting so much time on one task I would fly through these project! I've been learning everything on the fly in the last year.. my brain hurts.





 
Last edited:
The data looks like it's encoded in a 16-bit integer, which is split up into two bytes to be transferred between the Festo device and the CompactLogix.

Sometimes it's easier to look at it all in hexadecimal.

The value shown in the Festo software utility for Channel 0 is 1368 decimal.

1368 (decimal) = 0x0558 hex

Festo_CPX_I.Data[0] = 0x58
Festo_CPX_I.Data[1] = 0x05

The best way to re-combine those two SINTs in order is the COP instruction.

The Length of the COP instruction is the number of *destination* elements. Your destination will be an INT datatype, so the Length = 1.

Code:
COP
Source         Festo_CPX_I.Data[0]
Destination    Festo_Channel0_Data
Length         1
 
The data looks like it's encoded in a 16-bit integer, which is split up into two bytes to be transferred between the Festo device and the CompactLogix.

Sometimes it's easier to look at it all in hexadecimal.

The value shown in the Festo software utility for Channel 0 is 1368 decimal.

1368 (decimal) = 0x0558 hex

Festo_CPX_I.Data[0] = 0x58
Festo_CPX_I.Data[1] = 0x05

The best way to re-combine those two SINTs in order is the COP instruction.

The Length of the COP instruction is the number of *destination* elements. Your destination will be an INT datatype, so the Length = 1.

Code:
COP
Source         Festo_CPX_I.Data[0]
Destination    Festo_Channel0_Data
Length         1

Life Saver! I'm seeing the numbers that I need to see now. Thank you sir.
 
I was using the COP instruction earlier this morning try to figure things out but my destination was a DINT datatype.. blows my mind how using an INT works perfect and my values match they say they in the Festo maintenance tool! Shows you how much I still have to learn! Thanks again.
 
The reason the COP didn't work correctly with the DINT destination is that it copies the number of bytes from the source based on the number of bytes in the Destination Datatype and the Length value.

If Destination is a DINT and Length = 1, the COP grabs 4 bytes.
If Destination is an INT and Length = 1, the COP grabs 2 bytes.

So when you were using a DINT, it was copying Festo_CPX_I.Data[0] through .Data[3] all into the DINT.

You could combine a COP with a Masked Move or other mechanism to clear out the upper two bytes if you desire an ordinary 32-bit DINT.
 
The reason the COP didn't work correctly with the DINT destination is that it copies the number of bytes from the source based on the number of bytes in the Destination Datatype and the Length value.

If Destination is a DINT and Length = 1, the COP grabs 4 bytes.
If Destination is an INT and Length = 1, the COP grabs 2 bytes.

So when you were using a DINT, it was copying Festo_CPX_I.Data[0] through .Data[3] all into the DINT.

You could combine a COP with a Masked Move or other mechanism to clear out the upper two bytes if you desire an ordinary 32-bit DINT.

Thanks for the info.. I'm a little bummed about using the COP in a separate routine; I like keeping everything together and I used a function block for all my analogs. Any way to get the job done in a function block instruction?
 
You could roll it up into an Add-On Instruction, but I think it would be simpler and cleaner to simply run a LAD or ST routine to do the data juggling from your input devices.
 

Similar Topics

I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
257
I have a strain gauge attached to a load cell. The strain gauge is wired into an analog channel on a ControlLogix 1769 controller at +/-10V. How...
Replies
6
Views
2,427
Wondering if anyone has any suggestions that could help me out. I am looking for recommendations for hardware for an upcoming project. I am...
Replies
3
Views
2,030
I am noticing odd behavior with a CompactLogix PLC I have here as a test unit. I have absolutely no I/O wiring on this unit, I just use it to...
Replies
2
Views
2,083
Hi all, I need to collect the analog data like 4-20, mV signal or any digital count from FF based communication instruments for calibration...
Replies
1
Views
1,893
Back
Top Bottom