RSLogix500 reading integer values as signed

keristos

Member
Join Date
Aug 2011
Location
Malta
Posts
65
I am using RSLogix 500 to connect to a ML1400 PLC which is in turn connected to a Femto D4 Energy Meter.

The energy meter is returning two Integers words for one reading (32 bit reading in total) but when these are input into RSLogix the MSB is being considered as a signed bit, sometimes resulting in a negative reading.

I did write a routine to take care of this, but seeing as I have multiple readings on multiple meters I am not too much in favor of doing it this way, is there possibly no other more "official" way?

Thank you,
 
The ML1400 has a long interger data type (L). It is a 32 bit register. Could you use that type to store your data? That way you wouldn't need to manipulate the 16 bit words.
 
Let's assume the integers are arriving in N7:10 and higher (most MSG commands must read the data into N files regardless of the actual data type). And let us also assume you have created a Long data table in L10:0 and up.

Use CPW N7:10 L10:0 1 (some documentation says the 'length' must be in terms of the destination data type. In that case use '1' to represent 1 Long) to copy 2 N7 integers into the single Long at L10:0. It does not attempt to interpret the value, it merely moves the bit patterns.

If you have a series of contiguous integers to move into contiguous Longs just increase the 'length' argument.
 
Last edited:
My original post might have been misleading. I don't only have ML1400 to work with, in fact it's the minority of PLCs that I have. Most PLCs are the ML1100.

A solution I seem to have found is using the ABS function to ignore any negations. Is there any way this would fail that I am overseeing?

Thank you
 
You see a negative value when the actual value is greater than 32767. If you use the ABS command on a steadily rising value the values may rise toward 32767 but then start to drop (while the true value is rising above 32767).

The better option is to use the COP command as I mentioned into a Long data type. The values will be correct then.

You cannot force the Micrologix to interpret the value in an N register as unsigned.
 
You see a negative value when the actual value is greater than 32767. If you use the ABS command on a steadily rising value the values may rise toward 32767 but then start to drop (while the true value is rising above 32767).

The better option is to use the COP command as I mentioned into a Long data type. The values will be correct then.

You cannot force the Micrologix to interpret the value in an N register as unsigned.

But am I wrong in believing that the ML1100 doesn't have a long integer option?
 

Similar Topics

Hello all, I have an SLC 5/05 series C (pic attached) but when I try to download a program it say it is a different series with a different FRN...
Replies
8
Views
3,891
Hello I am fresh graduate and new to this forum as well. I am really new to rslogix and just want to interpret the logic .I am just interested...
Replies
2
Views
1,753
I am tuning a PID loop on an SLC5/05 processor. The problem is- when viewing the PID setup window (while running), the scaled error doesn't...
Replies
3
Views
4,510
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
14
Views
165
So here's my situation, I have been tasked with modifying the logic to mimic a button press in the PLC. I have two identical machines however one...
Replies
6
Views
543
Back
Top Bottom