12-09-2013 09:31 AM - edited 12-09-2013 09:35 AM
Hello
I want to create an application such that i can create two Modbus I/O slave server (TCP/IP) with different unit ID and can communicate with the slave through Clients. I created this application but only unit ID 1 is working. Is it like this that at a time two modbus slaves cannot work together ? Also I tried with one server and giving different Unit ID but then also it's not working. I found one thread, here is the link.
http://208.74.204.114/t5/LabVIEW/how-do-i-get-multiple-tcp-ip-modbus-to-work-together/td-p/2239130
Are there any updates on this issue.
Labview 2012 sp1
cRIO 9074
12-09-2013 09:44 AM
I don't fully understand your issue (but I'm trying).
Traditionally Modbus TCP/IP slaves cannot talk to each other, also the UnitID is mostly moot for MODbus/TCP since ports and IP addresses exist (unless you are building custom applications that will handle UnitID internally, because you have can't have 2 servers running on the same port).
If you can clarify your first sentence that would help a lot.
@Varun_ECK wrote:
Hello
I want to create an application such that i can create two Modbus I/O slave server (TCP/IP) with different unit ID and can communicate with the slave through Clients.
You want to create 2 MODbus/TCP slave servers, that can talk to other slaves? Or do you want the Master to automatically do things based on the slaves response? Are the TCP slaves on different computers, IP, etc?
12-09-2013 10:52 AM
Hello Valarauca
I want to create two TCP Server in one cRIO(with different unit ID) that can send and recieve the data from one master device.
Varun
12-09-2013 10:59 AM
Simply set up 2 slaves on different ports (changing UnitID's is optional then). Then have a single master that will connect to both slaves on different ports (502 and 503) with seperate connections.
If you want/have to use a single port, and do seperate UnitID's. You need to build your own MODbus server demon to handle the UnitID switching. I don't see that as being 'that' difficult. I've done it before in the past. The problem is there are some bugs in the lower level TCP libraries that sometimes mistake UnitID for being part of the filler of the TCP packet and filter it out (I spent about a week on the phone with National Insturments until they told me the bug would be filled under Don't Fix).
Short story: Use ports.
Long story: A very up hill battle that will end in you likely being defeated and using ports.
12-09-2013 11:11 AM
But there is no option of choosing ports if you use dsc libraries. are you talking about normal modbus libraries which NI dont support ?
12-09-2013 11:33 AM
@Varun_ECK wrote:
But there is no option of choosing ports if you use dsc libraries. are you talking about normal modbus libraries which NI dont support ?
yes am I. Most my experience is with those not with the 'fully supported' NI libraries.
The next question will be is if the dsc library slave demon allows for you to differeiate between UnitID's (aka assign registers to each UnitID). If it doesn't you'll either have to write your own slave demon, OR combine the registers of both Slaves into a single slave.
12-10-2013 02:02 AM
Hello Valarauca 🙂
Thanks for the reply.:)
Please refer to the link i mentioned . Do you know if there are any updates from NI related to the issue mentioned in the link.
Varun
02-07-2014 04:23 AM
Hello
Did anybody got the solution for creating different addressess of Modbus server created through shared variable ?
Thanks Varun