Verifying IP interfaces are online and correct

This section pertains to data loggers with IP interfaces that are performing communications. IP communications will generally go out the default network interface unless you tell the data logger to do something different. This can create a problem if the traffic (such as FTP) must go out a particular interface. For example, the data logger needs to communicate over a private network via Ethernet, but it needs to send FTP traffic out the PPP interface which has a cellular modem.

To check if you have a routing issue, verify the default interface of your data logger. Use Device Configuration Utility and any Network Interface tab such as Ethernet, PPP, CS I/O IP. In the following example, we're using the PPP tab. The Network Status shows that Ethernet is the default network interface.

In this case, the Ethernet connection has no Internet access. It is meant only for communicating with a PLC via Modbus. All FTP requests need to go out to the Internet, but the data logger is sending all traffic out the default Ethernet interface. Add something similar to this to your CRBasic program: 

IPRoute ("",1,1)

IPRoute ("192.168.13.95",0,1)

The first IPRoute()sends all traffic out the PPP interface. The second instruction is used to make an exception to the first rule and always send traffic destined for the 192.168.13.95 IP address out the Ethernet interface. The first parameter of IPRoute() is the IP address of the traffic. Using a pair of double quotes next to each other means all traffic. The second parameter specifies the IPInterface where traffic will be sent out from.

The CRBasic help describes and lets you select viable parameter options.

The two instructions need to be inserted in your program in a place where they will initialize after the data logger network interfaces have come online. Running them earlier can result in them not taking effect. Good places to insert them include a slow sequence scan, the main scan, or a subroutine.