06-24-2009 03:57 PM
Dear LabView experts:
My Labview system needs to communicate with three Modbus slave units (motor drive controllers with Modbus TCP/IP option installed) to send commands (speed reference) and read drive status (actual speed, output voltage/current/power etc). The PC has a quad-port Ethernet adapter with three of the ports connected via standard Ethernet cable to the three controllers. The three Ethernet ports on the PC have been given static IP addresses (192.168.1.10, 192.168.1.11, 192.168.1.12). The three controllers have been configured to give the Modbus slave options static IP addresses as well (192.168.1.20, 192.168.1.21, 192.168.1.22). I have also downloaded the NI Modbus library (version 1.2) and would like to use its VIs to perform Modbus Master Query operations. To do this, it is first necessary to open TCP connections to the three slave units using the TCP Open Connection vi, and this is where my problem comes in. How do I bind TCP Open Connection to use a specific Ethernet port (one of the first three IP addresses) on the PC ? Thanks in advance for your help.
VRA
Solved! Go to Solution.
06-25-2009 12:36 AM
Hi VRA,
what do you mean? There is a port input.
Mike
06-25-2009 10:02 AM
Hello Mike:
Thanks for your response. I should have browsed this forum a little more before sending the message out. You are right; one way is to restrict each Modbus-dedicated Ethernet port on the PC to a range or even a single port number (using Advanced settings), and use that port number in the TCP Open Connection vi to ensure that this connection will go out of that port. The other way is to use subnet masks as pointed out more than once on this forum; instead of using a subnet mask of 255.255.255.0 for all three ports (which would put them all on the same subnet), I could use a subnet mask of 255.255.255.192 which would allow for four separate subnets, then give the three PC ports IP addresses in the range 192.168.1.(2-62), 192.168.1.(66-126), 192.168.1.(130-190), with gateways set to 192.168.1.1, 192.168.1.65 and 192.168.1.129. The Modbus slave units (motor drive controllers) would then have to be configured with static IP addresses in the respective subnet ranges, so that a TCP Open Connection to that IP address would automatically go out on that subnet.
Thanks again.
VRA