Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
5 ratings:
 2.39 out of 5   

How Do I Communicate with the Modbus Demo Box?

Hardware: Industrial Communications>>Fieldbus

I cannot find the appropriate settings for communicating with the MODBUS demo box.  What are the serial port settings and RTU address for the box?  Which type of serial cable do I use?  How can I verify the connection?

The Modbus demo box responds to the following serial port settings:
  • Baud Rate: 9600
  • Parity: None
  • Data Bits: 8
  • Stop Bits: 1

The available addresses are listed on the demo box. The LED that is labeled 1 is register 1, the POT labeled 40001 is register 40001, etc.  The demo box works with a straight through serial cable.

The easiest way to communicate with the Modbus demo box is using the DSC Module.  If you do not have access to the DSC Module, you can use the LabVIEW Modbus library.  If you choose to implement your own Modbus Application Programming Interface, you may find the Modbus technical specification useful.

The following instructions will allow you to communicate with the MODBUS demo box using LabVIEW with DSC.  From the LabVIEW Project Navigator, right-click My Computer » New » I/O Server.

Select Modbus from the list of I/O Servers.  Select Modbus Serial from the Model drop-down, and ensure the Communication Settings match the settings for the MODBUS demo box as provided above.


After saving the library, right-click it and select Create Bound Variables...  Expand the project until you see the Modbus library items.  Highlight the single-bit coil register range 000001-065535 and click Add range

Change the value of the Data item to match the first register you'd like to communicate with.  Edit the Number of items to match the number of registers you'd like to configure at this time.  You may add more registers later.  The MODBUS demo box has six digital inputs associated with registers 7 - 12.  To configure variables for these registers, set Data item = 000007, set Number of items = 6 and click OK.

You may now change the variable properties of the register(s).  Click Done without making changes.  The DSC Module adds one network published shared variable per item created.  You may now use these variables to program as you normally would in LabVIEW.  In this example, we write the value of a switch on the demo box to an indicator.


Related Links:
KnowledgeBase 3GLDMSIT: What is the Difference Between Null Modem and Straight Through Serial Cables?

MODBUS over Serial Line: Specification & Implementation guide V1.0


Report Date: 03/23/2001
Last Updated: 01/31/2012
Document ID: 27METCF6

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit