LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i get multiple tcp/ip modbus to work together

Hi All,

 

I have got a system that uses 2 identical Serial (rs-485) Modbus libraries on 2 seperate ports.

I can can put the 2 libraries on the same com port as long as I put them on different addresses.

 

Unfortunately the same doesn't appear to be true for TCP/IP.

 

The best I can do is multiple masters but only 1 slave and they all have to be on the same address.

Add a second library on a different address and it all goes bad.

 

Any suggestions/solutions?

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 1 of 13
(7,486 Views)

Hellow Timmar,

 

I'm not totally sure I know what you're talking about. Can you post screen shots showing how you are accomplishing this with modbus and screen shots of what you have tried for TCP/IP?

 

Thanks,

Joel C

National Instruments

0 Kudos
Message 2 of 13
(7,463 Views)

This is probably a moot point now,

 

Wiki Modbus shows a station address for the Serial version of the protocol, but for TCPIP a 1 byte "Slave address" which is generaly not supported.

 

SA-1.pngSA-2.pngTCPSA.png

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 3 of 13
(7,455 Views)

If adding as a slaveconfigure the master device with the IP address of the NIC that connects the LV MyComputer target to the deviceand you can host multiple slaves on that same IP and separate them using the slave address (as the dialogs you posted show). So long as your master device allows you to configure the unit id.

 

 

Not sure I understand exactly what your dilemma is, but the nice thing about ModbusTCP (IMHO) is the support for multiple masters. 

 

As you may have already suggested the serial bus address is replaced by the IP address. However, there is still a provision for including the old serial bus address for use in gateways (when many serial slaves are put 'behind' a single ModbusTCP gateway). Usually this is not even used by ModbusTCP devices, but some legacy devices still require this to be set to a certain value to work.

The NI Modbus function blocks include this in an input called the MBAP header. Within this input is the unit identifier which is the old serial bus address (I recently had to add this for a power quality meter that refused to talk unless this was set to 1).

 

From the detail help...

Unit Identifier—This field is for intra-system routing purposes. It typically communicates to a MODBUS serial line slave through a gateway between an Ethernet TCP-IP network and a MODBUS serial line. The MODBUS client sets this field in the request, and the server response must return this field with the same value.

 

 

 

 

 

 

0 Kudos
Message 4 of 13
(7,442 Views)

S1ack,

 

Thanks for the theory, That was my expectation as well,

 

In practice, it doesn't appear to work.

 

I built a simple 2 master 2 slave network across 2 devices (both NI to rule out supported/unsupported) - See attached.

 

Would be great if someone can figure out how to make it work.

 

As a bonus Kick in the guts,  I have only been able to host 1 TCP/IP Slave per device, even if they are on the same Unit address.

 

I have got that familiar feeling that I have stumbled into another Labview bug.

 

Tim L.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 5 of 13
(7,429 Views)

Hello Tim,

 

Unfortunately this is a limitation on our Modbus I/O Servers, as the Creating Modubs I/O Servers help article explains.

Regards,
Daniel REDS
RF Systems Engineer

Help us grow.
If a post solves your question, mark it as The Solution.
If a post helps, give Kudos to it.
0 Kudos
Message 6 of 13
(7,398 Views)

REDS,

 

Thanks for the Post and the Link.

 

I know this is an ongoing argument I have with NI but this has all the hallmarks of a "Bug", Not a "Limitation".

Do you know if there Is there a pending bugfix for it?

 

 

If you can't have multiple slaves on the one device, I guess that rules out the possibility of multiple masters accessing different slaves on the same device.

It may work but I can't use Labview to test it.

 

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 7 of 13
(7,386 Views)

Hello Tim,

 

Currently Modbus Ethernet is only designed to work with one slave on the same computer.  If this is something you want to see implemented in future versions of LabVIEW, please submit a request to ni.com/ideas.

Regards,
Daniel REDS
RF Systems Engineer

Help us grow.
If a post solves your question, mark it as The Solution.
If a post helps, give Kudos to it.
0 Kudos
Message 8 of 13
(7,373 Views)

REDS,

 

I accept that it only supports 1 Slave,

 

<Rant>

 

What made me unhappy was that other than a footnote buried in a user manual for a module I don't have installed, there was no hint that this was the case.

 

In fact Given that the same function works for serial modbus, a reasonable person would expect the TCP/IP to function the same way, after all there is the same communications address selector in the configuration dialogue.

 

---

 

What I would like to see is when I add another TCPIP Modbus Slave I get a dialogue telling me that multiple Modbus Slaves are not supported.

 

Instead I have been chasing cryptic error messages and have wasted several days chasing Ghosts.

 

</Rant>

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 9 of 13
(7,359 Views)

Take a look at setting up a multihome for the ethernet card in your pc. You can give it more than one ip address. Then you might be able to assign each slave to one of the ip addresses.

0 Kudos
Message 10 of 13
(7,343 Views)