Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus Data Unit vs Command

Howdy all,

I'm attempting to setup communications between a pc and a Yokogawa UT150 furnace controller via modbus over RS-485.  I've found the "NI modbus.llb" and have read up a bit on the forum.  So far I have 2 questions.

1. I'm confused about the difference between the "Modbus Data Unit" and "Modbus Command" that are found in the vi's.  I would like to write a value into a particular D register so which one should I use?  and for that matter, what are the meanings of the items in the "Modbus Command" bundle (i.e. "quantity", "data", and "discrete")?

2.  Also, I'm a little overwhelmed by the dozen or so vi's inlcluded in "NI modbus.llb".  Which one would provide the simplest starting point for sending simple commands to a single instrument?

Any help appreciated.
Blake
0 Kudos
Message 1 of 3
(5,228 Views)
Hi Blake,

1.  You can choose to use either "Modbus Data Unit" or "Modbus Command" by selecting the "Use MODBUS Data Unit?" boolean.  They perform the same function, the only difference being that "Modbus Command" does some of the data manipulation for you.  Depending on what command you are sending, your device is expecting the "data" in a certain format.  Some of the components of the data are "quantity", "data", and "discrete".  I believe the quantity is how much data you are sending and data and discrete are byte or boolean data depending on what registers you are writing to.  What these actually correspond to is specific to your instrument.  You can see how these data is formatted by looking on the block diagram of "MB Modbus Command to Data Unit.vi".

2.  To simply write to or read from registers on your instrument I would recommend "MB Serial Example Master.vi".  If you want to send actual commands, I would recommend "MB Serial Master Query.vi". 

Hope this helps,
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 3
(5,216 Views)
Thanks for the info.  I understand your explaination.  So  guess the most of the Modbus vi's contained in NI Modbus.llb just take care of formatting.  I'v had sucess using a vi that another user posted to the forum (attached).  The vi contains all the functionality I need and even contains good documentation!  I think I'll send Maarten van Bree a thank you.

Blakelock
0 Kudos
Message 3 of 3
(5,212 Views)