LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use tcp/ip protocol trough secondary ethernet port

Hi,

I need to read a data memory area address from an Omron PLC using LabVIEW. To achieve this, the PLC has a fixed IP address and subnet mask assigned to an Ethernet port where I need to connect my PC.

However, my PC's Ethernet card only has one port which is currently being used for internet connection. To connect to the PLC, I've decided to use an Ethernet to USB converter, effectively adding a secondary Ethernet card.

Now, with two Ethernet cards (one native, one via USB), how do I assign the port I want to use for the TCP/IP connection? The TCP/IP Modbus library only requests the slave (the PLC) address, without specifying the master IP address or Ethernet port to use.

It's important to note that I'm working in a professional environment connected to a large Ethernet network. Therefore, the PLC communication needs to function as a separate network where I communicate exclusively through TCP/IP with the PLC.

thx

0 Kudos
Message 1 of 6
(300 Views)

Then put the PLC in a subnet different from your main LAN (say 192.168.1.x instead of 10.0.x.x.). The OS will take care of sending data via the correct adapter.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 6
(292 Views)

Do I need to make any additional configurations on the PC or in LabVIEW so that the operating system knows where to search for the address? Such as assigning that subnet to the specific Ethernet card or something similar?

Thanks for the response 🙂

0 Kudos
Message 3 of 6
(278 Views)

Yes, of course in the OS you need to set the additional Ethernet card with a static address in the same subnet as the PLC. For example, the card address would be 192.168.0.2 and the PLC 192.168.0.100 with 255.255.255.0 subnet mask (I'm assuming you are able to set the PLC address at will).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 6
(256 Views)

@miguel_af wrote:

Do I need to make any additional configurations on the PC or in LabVIEW so that the operating system knows where to search for the address? Such as assigning that subnet to the specific Ethernet card or something similar?

Thanks for the response 🙂


As stated, you just need to make sure your two ports on the PC are using different subnets.  The PC will take care of everything else based on the IP address you try to connect to with LabVIEW.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(245 Views)

It seems you don't know what a subnet mask is...

 

Write your IP adress in binary form, and write your subnet mask below as well:

 

 

192     .168     .0       .42

11000000.10101000.00000000.00101010

255     .255     .255     .0

11111111.11111111.11111111.00000000

 

 

The subnet mask is always a number of ones, followed by a number of zeros, nothing else.It shows which bits of the IP define the network, and which are for the individual adress of a device within that network. So, IPs 192.168.0.42 and 192.168.0.42 are in different networks if the subnet is 255.255.255.0, but they are in the same network if the subnet is 255.255.254.0

So, the subnet does not define a network. It just defines which part of the IP defines the network.

 

0 Kudos
Message 6 of 6
(132 Views)