ML1200 RSLogix500, help with data representation to Master

g.mccormick

Lifetime Supporting Member
Join Date
Jul 2012
Location
IN
Posts
960
I am using Modbus to read 36 registers from a ML1200. 2 of those registers are suppose to be L11 data and 2 of the registers are F8 data.

Long story short, my master will issue 3 seperate queries to get the data since I've told it s, L, and F for the different register values. (I understand it is all 16data just interpreted differently).

So in order to get to 1 query command to read all data, I have so far broken the floating point up to integer and decimal*10000 portions before storeing in two consecutive N registers. I then recombine in the Master software.

Example:
F8:1, value 1234.67890
N7:23 = 1234
N7:24 =6789

Once read via modbus, on my master system side:
Value = N7_23 + ( N7_24 / 10000)



Now I need to do something similar to a L11 long int value.

I'm coming up short on what to do here though? The long int is values from a counter, so up to 2147483647 (Actually in PLC I reset value if above 2147480000).

How should I best manipulate this?
 
I'm not quite understanding why you can't just send the float and long over in their original form in 2 consecutive integer? Does the master not be able to understand those data type? What is the master in your case?
 
I'm not quite understanding why you can't just send the float and long over in their original form in 2 consecutive integer? Does the master not be able to understand those data type? What is the master in your case?



The master does, but it will only do consecutive reads for like data types.

So, it sends 3 requests:
Request 1 is for registers 0-32 (which are shorts/16 bit values)
Requsst 2 is for registers 33,34 (which it combines into 1 long int)
Request 3 is for register 35,36 (which it combines into 1 32bit float).

I'm trying to read data at 10hz, so I really need 1 read not 3.
 
If you have control over the programming in both devices, just use a CPW instruction in the Micrologix to place the bit patterns of the 32 bit elements into the integer locations you need, and then on the other CPU do what is necessary (if anything) to identify those bit patterns as the intended type of data.

I do this a lot with radio telemetry systems where I need to pack lots of different types of data into a single block of integers to keep my messages compact and efficient. Note that the CPW instruction length parameter is the number of words from the source, not the destination element size as it is with a regular COP instruction. So, for example:
CPW #F8:21 #N26:8 2
will take the 32 bits from F8:21 and copy that pattern into two integers (N26:8 and N26:9)

On the other end of the message, I:
CPW #N26:8 #F29:7 2
to take the bit pattern from N26:8 copy it back into its original form as F29:7
 
Last edited:

Similar Topics

I am very new to AB PLC's we have a ML1200(14 inputs/10 outputs B series) we are trying to connect it with RSLogix500 (4.50) software thro RSLinx...
Replies
2
Views
2,692
Hey all! Long time reader, first time poster! I have an EA9-T7CL and an MicroLogix 1200 connected via DF1. I'm all good and got everything mostly...
Replies
3
Views
632
Hi every master,Recently i met a fault about 1762-L40BWA 1,When i get the PLC, The Fault light is lighting, I am not remember the fault message,I...
Replies
0
Views
710
Hello everybody and master,I met a problem about ML1200.It is described as below: 1,When i got this PLC,The FAULT light is lighting, My computer...
Replies
4
Views
1,083
I had planned to use PTO instructions to control a servo motor, single axis only. We have a ML1200 BWA model. According to the ML1200 manual...
Replies
7
Views
3,441
Back
Top Bottom