MODBUS / ML1400 help?

Nhrafan26

Member
Join Date
Nov 2008
Location
Slatington, PA
Posts
53
I have a device that I am communicating with here that is using Modbus to store values from a gas analyzer and I want to transfer these to a PLC. I have got the 16 bit WORD values to display and transfer successfully.
The one I am having trouble with is I am trying to read a 32 bit FLOAT value for the gas concentration value. I have tried various messages, all with the same result: Bad parameter in MSG reply packet, could not be processed by local processor. Error code hex 45.

Any ideas? Or what more information do you need?

Thanks
 
I think that making the data table address a Long Integer (4 bytes) and a Length of 2 will make the length request be 8 bytes.

If Holding Register 3658 is the last 4 byte register in the Modbus table, then requesting 8 bytes starting there will probably make the slave device give you an error code.

I would make the target an ordinary N integer element, with the Length of 2, then use COP and SWPB instructions to experiment with byte order to convert it to a REAL.

Or, see if you get lucky with byte order and make the target a Floating Point F element, with a length of 1.
 
So the number of elements is determined by the destination device. Since you are issuing a read command, you probably want to switch that to 1 if you are using F or L(since those are 32bit by default).
 
It helps to look at it as hexadecimal.

24920 decimal = 0x6158 hex
16416 decimal = 0x4020 hex

0x40206158 = 2.5059414 as an IEEE 754 Floating Point value.

So I think the byte order and word order make this simple. Use a COP instruction to Copy your Integer words (starting at the first one) into a Floating Point (F) register, with the Length of 1.
 
Here is a technote outlining specifically what you are looking for and what the members here are describing...

559679 - Instructions for Modbus device to pass float data to controller in two integers
Access Level: TechConnect

It includes information on an SLC500, a MicroLogix 1400 and a CompactLogix.

Regards,
George
 
It helps to look at it as hexadecimal.

24920 decimal = 0x6158 hex
16416 decimal = 0x4020 hex

0x40206158 = 2.5059414 as an IEEE 754 Floating Point value.

So I think the byte order and word order make this simple. Use a COP instruction to Copy your Integer words (starting at the first one) into a Floating Point (F) register, with the Length of 1.

Problem is have you ever tried the COP command from integer to float with a ML1400? It doesn't work. "Operand sizes do not match."

So I used the CPW command instead and got no errors but now I need to figure how to take the number being displayed in the float table and send that number to an integer file without it being broken up.
Right now I have a test message running and am seeing the setting of 20 appear in the float table but when I copy that to integer I see zeros.

test msg.jpg N16 values.JPG N9 values.JPG F8 values.JPG
 
Is there any way for me to take my value and get it to read in this format on a server (00.00) ? I am not sure how taking it from the modbus message, into a N table then to a float table and then into a final N table to transfer to a server will affect my reading.
Anyone?
I have posted the tables in my previous post.
 

Similar Topics

Hi! I have a ML1400 that our customer wants to communicate with. I'm very unfamiliar with RSLogix and Allen Bradley programming overall but I...
Replies
10
Views
2,264
If I set up a ML1400 as a Modbus RTU slave, and click the extended files tickbox, then set up my files with 200 elements, will the Modbus...
Replies
1
Views
1,068
I need to do 5 reads and 1 write on 2 devices. So that is 10 and 2 total. It seems I can't use indirect addressing with MG registers, which is...
Replies
11
Views
3,117
I am currently working on a project with an Epson Scara robot using an RC-90 controller communicating with a ML1400 Ser. B PLC. The robot...
Replies
4
Views
3,984
I have an Allen-Bradley MicroLogix 1400, and have been working with it for a few months now and understand its basics pretty well. Up to now I've...
Replies
4
Views
3,940
Back
Top Bottom