Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus TCP - Access Multiple slave devices on same gateway

Solved!
Go to solution

Hi,

 

I have am trying to read from multiple Modbus Serial slave devices (2 to start with) via a 4 port Modbus serial to ModbusTCP Gateway.The gateway has a web configuration page that allows me to configure each port individually (baud rate, parity etc.) along with modbus mapping/offset.

 

In labview modbus TCP master VI's i dont see an option to select "Unit ID". Similar to modbus serial VIs. Is there an alternate way to do this?

 

I can read from slave device on Com1 just fine from my labview master application, but nothing from device on port2. Diagnostics from the webpage tell that my request is also not getting to Com2.

0 Kudos
Message 1 of 9
(10,106 Views)

Hi,

 

The slave address is a part of the TCP data (the CRC is not) Using different slave addresses to select a port at your gateway should work. At least with my Moxa gateway it does.

 

Kees

0 Kudos
Message 2 of 9
(10,060 Views)
Solution
Accepted by Younus.M

Setting the Unit ID via Property Node worked! I can now read for the 4 com ports using their corresponding slave addresses/unit IDs. 

 

The LabVIEW context help for unit ID was throwing me off as it says "...specifies identification of a serial modbus slave.....ignores requests from TCP Mobdus Master instances....". Now I know that i not true 🙂 it works just the same both serial & TCP

0 Kudos
Message 3 of 9
(10,046 Views)

Hi Younus. I couldn't understand your way. Someones told me for 4 slave like in this VI;


serial tcp.png

 but it is not working. Can you give me an example ?  In the snippet, it is created for loop for 4 slave devices ID and inside the while loop, take the element ID number and write in sequentially to those Modbus Read holding Register vı. I think there is an error here. We need not for loop, instead of that, we have to define slave IDs separately?

0 Kudos
Message 4 of 9
(9,454 Views)

I made some modifications on the basis of NI Modbus Library, and realized the communication between Modbus Slave and Master through multiple unit ID.So I publish the code using LabVIEW 2013.

Hope it works for you.

0 Kudos
Message 5 of 9
(9,371 Views)

Do you have a copy of this VI in a newer version of the packed project library? Preferably 2017 or newer. We are using LV 2019.

Director of Engineering
G Systems, www.gsystems.com
Certified LabVIEW Architect
Certified LabVIEW Embedded Systems Developer
Certified Professional Instructor
GCentral
0 Kudos
Message 6 of 9
(6,463 Views)

Well, same problem here. However, the web interface of my device doesn't have any option for setting up slave ids. Has anyone thought of using a serial port emulator? Does anybody think it's reasonable?

0 Kudos
Message 8 of 9
(6,255 Views)

Hi,

 

With a Moxa MB3480 you can connect multiple slaves (at address x) through a TCP connection.

Within the Moxa you can set-up the slave addresses conversion.

 

Kees

0 Kudos
Message 9 of 9
(6,242 Views)