Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus I/O Server with NI 9871

Solved!
Go to solution

Good morning,

I need to communicate with a device through Modbus using a port on the cRIO NI 9871 module.  I would like to use a Modbus I/O Server to simplify the programming.  I'm currently trying to test communications but I'm having trouble with passing data from master-->slave or slave-->master.  Here is a summary of the setup:

 

cRIO 9030 with NI 9871 in slot 4

cRIO 9035 with NI 9871 in slot 2

 

I can write data using VISA test panels in NI Max so I know the serial ports see each other.

 

I've created a Modbus I/O Server on each cRIO.  cRIO 9030 is a slave server and cRIO 9035 is a master server.  My test VIs are extremely simple, I just write to a coil on one server and read the same coil on the other, just to test if data is getting through.  I can't get any communication.  When I try to configure each I/O server for Modbus serial, it provides a serial port menu that lists COM1 through COM32.  I don't know how to find what these COM ports map to.  I think my problem may be related to which COM port is setup in the server settings.

 

I found the following article to create the server programmatically, but I can't find this option in my version of Labview (2015).  

 

http://zone.ni.com/reference/en-XX/help/371618K-01/lvdsc/dsc_create_config_io_server/

 

Any ideas?  Thanks

0 Kudos
Message 1 of 3
(2,227 Views)

Just an update, I am able to pass data when using the Modbus API, but I would prefer to use the I/O Server if possible.  I think the issue is somehow tied to setting up the COM port in the I/O server.  In NI Max, it lists the serial ports on the NI 9871 as ASRL3::INSTR and not as a "COMxx" port number.  How do you match the COMxx to the ASRL3::INSTR of the module?

Download All
0 Kudos
Message 2 of 3
(2,218 Views)
Solution
Accepted by topic author jdenn

I was able to fix the problem.  I had to remap the port names in the ni987x.rules file per below:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000fy9FSAQ&l=en-US

 

After mapping, I still couldn't get communications when using the default 9600 baud speed.  When I changed it to 115200 baud it was able to communicate.  I think maybe the default timeouts were too long or short with 9600 baud.

 

Hope this helps someone else in the future.

0 Kudos
Message 3 of 3
(2,195 Views)