Connects to wrong Ethernet card


Stefan

Recommended Posts

Everything was going well. We then added a second Ethernet card to talk with another device. Now the DAQ is looking for the PLC on the 2nd network card. We have changed the priority metric and the priority order in the network card advanced setting that Windows support called for. This worked for the programming software to talk with the PLC. However, the DAQ still doesn't communicate. We assume that the DAQ is talking to the wrong card because disabling the new network card resulted in the DAQ communicating properly again. Can you help?

Link to comment
Share on other sites

The IP address of the PLC is: 169.254.192.166. Presently we are bringing the PLC and Internet into a switch and then to LAN 1. The LAN 2 has a computer controlled power strip connected to it. Presently the DAQ software seems to be trying to connect to the PLC through LAN 2. I sat this because by disabling LAN 2 card in the device manager the DAQ Ethernet connection began to work again. I say again because this difficulty didn't arise until we installed the 2nd LAN card. We are considering rearranging these connections. 

Link to comment
Share on other sites

169.254.192.166 is not a valid IP address.  It is the address devices give themselves when they are setup for DHCP but no DHCP server can be found.  It also is not on the same subnet as either of those cards.  My guess is that you unplugged the PLC from your LAN where there is a DHCP server and put it on its own network with the DAQFactory where there is not.  The PLC can't find a DHCP server and so doesn't get a usable IP address, and the of course DAQFactory can't talk to it.  So, it really has nothing to do with DAQFactory, but rather your LAN setup.

In general, I do not think you should ever have PLC's or any DAQ device running on DHCP in production.  It is great during startup because you can get to the device initially for configuration without changing your PC's IP, address, but you should always change your device to have a static IP address.  Despite what some may say, DHCP does not always give the same IP address to the same device.  So, if you had two identical PLC's wired into different stuff, both on DHCP, it is possible for the devices to actually swap IP addresses and then you are communicating with the wrong device, and could, so to speak, "fire the rocket" when you really just meant to turn on the lights.

Note that the IP address of the PLC will have to be on the subnet of the desired card, so either 192.168.2.X or 192.168.0.X depending on which card you are connecting to.

Also, just a general note: if your device is supposed do be somewhere on your LAN, and you are not connecting to it directly through the Internet (which I don't generally recommend), the IP address will pretty much always have to start with 192.168.x.x, or 10.x.x.x or 172.16.x.x through 172.31.x.x, and you rarely see the 172 range.  These are the only IP addresses used in LANs because they are non-routable and thus not directly accessible through the Internet.  If you get something else, like 169.254 and you aren't connecting to a device on the Internet, you know you did something wrong.

Link to comment
Share on other sites

Thank you for your assistance, after reading your information we rearranged the arrangement of the networks so that the Internet feed is coming directly into NIC 1's port. We then connected all of the local equipment to the switch and plugged that into NIC 2's port. After changing that, I made sure that I had everything set up for static addresses and changed the IP addresses as per your recommendations and everything worked well after that.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.