Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

MODBUS IO server serial: No Known Values of Shared Variables, but upadaing ON

Solved!
Go to solution

Two IO servers should communicate over TCP/ethernet network by using RS485 and  Modbus Serial protocol. Servers are accessing the same COM port (10) but with different addresses (1 and 2). Communication is at first successfully tested without LabView, with standalone applications (Modbus Poll) as shown below. There is some warning about illegal data value, but there is correct value on screen.

 

DSC_0095.JPG

 

When  LabView and VSPE software is used, there is no value. It is worth mentioning how the connection is established but shared variables show "No Known Value" in DSM.

DSC_0101.JPG

 

In LabView application (attached as .lvlib and .vi files) there are zeros and no errors at all.

DSC_0097.JPG

0 Kudos
Message 1 of 15
(7,492 Views)

Also, it is possible to generate similar behavior with "Modbus Slave" application by setting options "Modbus RTU Over TCP/IP". Of course, virtual port and TCP com over this port is required to be set (i.e. with VSPE).

0 Kudos
Message 2 of 15
(7,448 Views)

Attached file is a log file. At first there are logs of successful communication between Modbus Poll and Modbus Slave, and then Tx becomes drastically smaller when Modbus Slave is replaced with LV-SVE and VSPE.

0 Kudos
Message 3 of 15
(7,443 Views)

Hi Eshk,

 

It's concerning that the values don't show up in Distributed System Manager (DSM). What is writing to the I/O server? I notice there are a few missing VI's in the libraries you posted. Are these the VI's that should be writing data to the IO server? If these VIs were working, I would expect we'd see the values in DSM updating. If we saw values in DSM updating and our bound indicators still weren't displaying the right value, we'd want to look at the bound indicators to see if something's set up wrong. As things are, I think we should make sure the values are being written correctly in the first place. There is an article I'd like to link you to which provides a good walkthrough of setting up the MODBUS I/O server in LabVIEW. Let me know if it's helpful.

 

Connect LabVIEW to Any PLC With Modbus

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

 

It would also be useful if you could post your project with your server set up code for us to look over.

 

Warm Regards,

Austin E.

Applications Engineer

National Instruments

Austin
Staff Software Engineer
NI
0 Kudos
Message 4 of 15
(7,429 Views)

VI's are just for reading values from SVE.

IO server should be master in serial communication and should ask for values from remote device in proper way. As it is shown in attached image, there is some configuration but DSM values are not being updated at all. I suspect IO server is not sending correct message.

I will upload a simplified project with all element required for test as soon as possible.

0 Kudos
Message 5 of 15
(7,418 Views)

Hi Eshk,

 

Could you please walk through your process for creating your Modbus Slave I/O server? We would like to see a screenshot of the Configure Modbus dialog box that LabVIEW creates when you make a new I/O server so we can see your configuration settings. Also, was the article I linked helpful? Was this the guide you followed or did you set up the I/O server a different way?

 

Warm Regards,

Austin E.

Applications Engineer

National Instruments

Austin
Staff Software Engineer
NI
0 Kudos
Message 6 of 15
(7,409 Views)

I have attached the screenshot of the Configure Modbus dialog box.

Also, I have attached the simplified project with the same issue. 

To initiate the same test you would require also:

- Labview 2016 Version 16.0f2 (32 bit)

- Modbus Slave - 64 Bit Verison 6.2.0. Build 1070 (used for simulating MODBUS RTU over TCP - localhost is used as IP)

- Virtual Serial Ports Emulatior , 64 bit, version 0.938.4.846, Kernel Driver version 2.037 ( used for creating virtual port and TCP client on this port)

 

DSM needs some time and maybe few restarts of himself or virtual port emulator to start Updating (flag on IO server should blink). 

 

In order to check the communication between VSPE and Modbus Slave, I have successfully use:

- Modbus Poll - 64 Bit Verison 7.1.0, Build 1083 with different config (connection over serial and connection over TCP)

 

 

Download All
0 Kudos
Message 7 of 15
(7,398 Views)

I forgot to mention that I've set up the I/O server by following the tutorial: http://www.ni.com/tutorial/13911/en/.

 

0 Kudos
Message 8 of 15
(7,391 Views)

So, MODBUS serial communication is still not working.

When I use raw serial communication (as in attached VI), with same configuration as explained before (VSPE and Modbus Slave) my results are fine. Used command message in hex is: 01 03 00 00 00 0A C5 CD

 

Example of received messages

Values on all addresses of Holding Registers are zero
Rx: 01 03 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A3 67

Value on address 40001: 100
Value on address 40002: 1000
Rx: 01 03 14 00 64 03 E8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F2 2F

 

0 Kudos
Message 9 of 15
(7,387 Views)

Hi Eshk,

 

I'm not sure what we can determine from the serial messages being sent but I think the best course of action for troubleshooting will be to try and get the values we expect to show up in the DSM. Can we confirm that the Modbus I/O server is configured with the correct serial parameters (parity, baud rate, etc.)? Once we can get the correct values to show up in DSM, our LabVIEW code should fall into place as well.

Austin
Staff Software Engineer
NI
0 Kudos
Message 10 of 15
(7,376 Views)