User`s guide
hardware devices. You have to have both the correct IP address and port to
communicate with a device over Ethernet.
One final discussion: static versus dynamic IP addressing. To make the
installation of new PC’s easier on the IT people, something called DHCP was
invented. DHCP is a protocol used to automatically provide IP addresses to
devices. The DHCP retains a list of IP addresses that can be used and when a
new computer connects to the LAN, it finds the DHCP server and requests an IP
address to use. This address is called a dynamic IP address. It is dynamic
because the next time the PC or device is powered up and requests an address
from the DHCP server, it may be a different address. A static IP address is
specified directly on the PC or device and is fixed. Dynamic IP addresses work
because most of the stuff people do on PC’s are client based, meaning they start
the communications and connect to a server or other device with a known fixed IP
address. If your PC or device has a dynamic IP address, you cannot access it
externally because you don’t know its address. It would be like trying to
telephone somebody whose telephone number changed every day.
Dynamic IPs are also used by ISP’s to stretch the number of users they can have
on a group of static IPs. The ISP might own 100 IP addresses and have 200
subscribers. But not all 200 subscribers are on the Internet at the same time, so
they rotate IPs among those that are connected. Since much web browsing is a
connect, download, and release mechanism, it is pretty easy to rotate IPs even if
200 people are browsing the web at the same time.
Now the important points:
1) To connect to an Ethernet device using DAQFactory and TCP, you must know
the IP address of the remote device. The IP address also must be accessible
from your subnet. So if your device has an IP of 192.168.1.2 and you have an
IP of 10.0.0.3 and your subnet is 255.0.0.0, you probably won’t be able to
connect to your device. When you first start, you should always try and put
your device on the same subnet so you don’t have to worry about routing.
2) You also must know the port number of the TCP/IP connection that your
device is listening on. Many devices listen to multiple ports using different
protocols, so make sure you get the right port.
3) In order to put a device on the Internet in a way that allows access to that
device, the device must have a static, Internet capable, address. This means
the address can’t start with 192.168 or 10. You will have to contact your ISP
or IT people for a static IP address, and it may cost extra. This is a very
insecure method. Alternatively, you can use a technology like VPN to access
your LAN and then get access to the local addresses. In this case, your device
will still have to have a static IP, but it can be a local address, i.e. one that
starts with 192.168 or 10. VPN typically requires a special type of hardware
firewall. VPN is much more secure then simply giving your device a static IP
on the internet.
4) The only way to connect a PC directly to a device without using a switch, hub
or router is to use a crossover cable. In this case, you will need both the
device and the PC to have IP addresses on the same subnet. Your best bet is
to simply use 192.168.1.2 and 192.168.1.3, but it doesn’t really matter
because there are no other computers or devices to interfere with.
5) Some devices require a crossover cable to initially set the IP address. The
device may come from the factory with an IP of 192.168.1.1 or similar. You