Modbus I/O Server and Modbus API Do Not Work Simultaneously in LabVIEW

Updated Jul 24, 2024

Issue Details

I am trying to enable communication via Modbus between my compactRIO (cRIO) controller and a third-party device. To do so, I am utilizing the Modbus API. However, even though I am setting the VIs correctly and not getting any error messages coming out from them, communication does not work between my two devices. I have also implemented a Modbus I/O Server under my cRIO in my project and it worked as expected, which suggests communication is working but not with the API.

Solution

The behavior can be related to a previously deployed Modbus I/O server on the remote controller since it is not possible to implement two instances of a Modbus Master or Slave on the same device. This means that you must select just one Modbus implementation method. In this case, if the Modbus I/O Server works as expected and you would like to use the Modbus API instead, you need to undeploy the I/O server from the controller first, by following one of the approaches listed below:
  • If you remember which LabVIEW project you used for deploying the Modbus I/O Server, you can open it and right-click on the library. Then you can select the Undeploy option. 

undeploy option.png
  • Use the NI Distributed System Manager to identify the library that contains the I/O Server and undeploy it from there:
    1. Launch the NI Distributed System Manager. 
    2. Right-click on My Systems >> Add System... to add your remote controller. 
add system_3.png
  1. Type the IP address of your device in the blank space and click on OK
IP address.png
 
  1. Open the tree of your target to display the libraries and processes that have been deployed on it. Right-click on the library that contains the Modbus I/O Server and select Remove Process to undeploy the library. 
remove process_1.png