LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Modbus Servers with Different Unit ID running in cRIO 9074. Possible ?

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

 

0 Kudos
Message 1 of 8
(3,539 Views)

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?

0 Kudos
Message 2 of 8
(3,531 Views)

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

0 Kudos
Message 3 of 8
(3,515 Views)

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.

0 Kudos
Message 4 of 8
(3,511 Views)

But there is no option of choosing ports if you use dsc libraries. are you talking about normal modbus libraries which NI dont support ?

0 Kudos
Message 5 of 8
(3,507 Views)

@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.

0 Kudos
Message 6 of 8
(3,503 Views)

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

0 Kudos
Message 7 of 8
(3,487 Views)

Hello  

 

Did anybody got the solution for creating different addressess of Modbus server created through shared variable ?

 

Thanks Varun

0 Kudos
Message 8 of 8
(3,313 Views)