LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus RTU protocol datatypes

Solved!
Go to solution

The modbus value is a single register that is a 16 bit word.  It will have values from 0 to 65535.  Each of your fields has a range defined.  For type K it is 0 to 1370degC.  For the voltages, it is -10 to +10 V.  All you have to do is rescale the value in the 0 to 65535 range to a value in the 0 to 1370 deg C range.  Divide the value of 1091 by 65535 and multiply by 1370, you get  22.8.

 

For a voltage, divide by 65535, mulitply by 20 and subtract 10.

Instead of posting your images a bitmaps wrapped up in a zip, please post them directly as a .png file.  There smaller, they will post directly, you won't need to zip them, all of which makes it easier for readers to access them.Smiley Wink
Message Edited by Ravens Fan on 09-06-2008 11:00 AM
Message 21 of 58
(3,105 Views)

Thanks sir,

                   I understand all description.what is calculations for mA?how do we decide it for different instrument?how do u know all ranges?

0 Kudos
Message 22 of 58
(3,088 Views)

You're welcome.

 

It's just simple math to rescale a value.  For 4-20 mA, you would multiply by 16 (range) and add 4 (the offset).  The ranges are showing up for each channel in the bitmap images you posted.

 

I am attaching a VI (LV8.5) I have used frequently as a subVI in a program.  This will let you rescale any value based on one range to its corresponding value in another range.

Message 23 of 58
(3,079 Views)
Thanks for reply.to write digital data to device m using read coils and connect discrete constant to modbus master file?but didnt able to write data to device 4055.can u please tell me where m going wrong?
0 Kudos
Message 24 of 58
(3,040 Views)
We'll need to see you vi settings when you tried to send the data to the 4055. This would be a write coils command or a write holding registers command. What do you mean by connect discrete constant to modbus master file?? Please attach your vi file.
Message 25 of 58
(3,030 Views)

hello Sir,

               I am sending u attachment vi for digital output communication.

0 Kudos
Message 26 of 58
(3,011 Views)

When I opened your vi, the modbus command was set to write single coil. The address was set to 0. The quantity field was set to 8 and you have four databits wired to the command discrete input.

 

With four databits wired, you should probably be using the write multiple coils modbus command. The quantity should be set to 4. The address field should be set to 17 to turn on the outputs. Look at the advantech manual for the 4055 module. The address data is listed below. You really should not be able to write coils to address 00001-00008 as these are the digital inputs. I would still use portmon to reverse engineer the data stream sent by the advantech software when used with the 4055. Then see what the labview software is sending. Reverse engineering the hex datastream will really help you figure out the modbus protocol.

 

7. ADAM-4055 16-channel Isolated Digital I/O with LED

Module

ADDR 0X Channel Item Attribute Memo

00001 0 DI Input Signal R

00002 1 DI Input Signal R

00003 2 DI Input Signal R

00004 3 DI Input Signal R

00005 4 DI Input Signal R

00006 5 DI Input Signal R

00007 6 DI Input Signal R

00008 7 DI Input Signal R

00017 0 DO Output Value R/W

00018 1 DO Output Value R/W

00019 2 DO Output Value R/W

00020 3 DO Output Value R/W

00021 4 DO Output Value R/W

00022 5 DO Output Value R/W

00023 6 DO Output Value R/W

00024 7 DO Output Value R/W

 

Message 27 of 58
(2,998 Views)

Hello Sir,

               I am using energy meter device (EM 6400)under which using active power having address 43903.how could i acces input of energy meter in Labview?i am sending u vi.

0 Kudos
Message 28 of 58
(2,941 Views)
Solution
Accepted by topic author shubhlaxmi22

Dear Sir,

               In my application, using analog,input,output and digital input,output.How do i give analog output to adam card 4024?

       when i access analog input value divide it  by 65535 and do some calculation as per range.does it do for analog output ?

                          Reply me as early as possible

Message Edited by shubhlaxmi22 on 01-16-2009 05:02 AM
0 Kudos
Message 29 of 58
(2,704 Views)

Don't mark your last question as the solution to your problem.  You can unmark it the same way you marked it, from the menu on the upper right side of the message.

 

Have you tried doing the exact opposite as you did for analog input?  Take your value, multiply by 65535 and write that to the card.

0 Kudos
Message 30 of 58
(2,688 Views)