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.
Solved! Go to Solution.
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.
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
Hi Younus. I couldn't understand your way. Someones told me for 4 slave like in this VI;
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?
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.