Prosoft Modbus MVI-56MCM for Contrllogix

elmatador

Member
Join Date
May 2008
Location
Canada
Posts
108
The Read.Data array in the MCM tag in the Controllogix is defined as an INT (-32767to32767). However, some of my data is coming in as Unsigned INT over Modbus (0-65535). What would happen when a value of 65535 come into an INT?

Can i just do a copy instruction and move it to a DINT?
 
If you use a COP instruction you need to have control over two integers worth of data before the COP. The COP will take 4 bytes even though you are only worried about the lower two bytes. So make sure you are in control of the upper two bytes that follow the value you want to move.

Another option may be a bitwise AND with a mask of 16#0000FFFF.

Keith
 
The bitwise AND method recommended above is the best way to go especially since the MCM.ReadData array will most likely be filled with data all throughout. If you use COP then the high 16 bits of the destination DINT will contain the bit pattern of the ReadData[x+1] element. (when you try to copy ReadData[x])

One think to watch out for when you are online and monitoring your code... Since the MCM.ReadData array datatype is INT, numbers greater than 32767 will "appear" as weird negative numbers (since bit 15 is set). Your DINT will still contain the correct value though.
 
Hi Keith & Purav,

Thank you for your responses. I took your suggestions and did it the following way and it is working well:

AND
SrcA: MCM.Data.ReadData[0]
SrcB: 16#0000FFFF
Dest: DINT_Data

Then if MCM.Data.ReadData[0].15 is equal to 1
Add 32767 to DINT_Data

All of this is in one rung

So a Value of -32767 is 65536
 
I did not think you would need to do the ADD operation. Try your logic without it. It should still work. A value of -32767 means all 16 bits are 1 in the INT. This same bit pattern moved into the lower 16 bits of the DINT should give 65535.May be I need to re-visit my basics... let me know how that works out though...
 

Similar Topics

Has anyone successflly implemented ANY prosoft I/F to PLC3? My hardware: PLC-3 (not 3-10) S5 Scanner 1771-ASB series D Remote IO...
Replies
0
Views
4,088
Hi all. This is a very specific issue. My first time with a Modbus ProSoft. Customer setup doesn't make any sense but we're stuck with it...
Replies
8
Views
349
Hi all. I just received my brand new Prosoft Modbus modules and I'm playing with one in a L82 rack. I managed to set it up well enough so I...
Replies
4
Views
369
Hi. My Lumen guy isn't answering me and we're almost ready to complete the conceptual part of the design and we'd like to order soon. The...
Replies
2
Views
655
Hey everyone, looking for some insight on the prosoft MVI56E-MCMR module. I wasn’t the one who installed this system, but I need help to...
Replies
10
Views
2,910
Back
Top Bottom