To download NI software, including the products shown below, visit ni.com/downloads.
The attached VI checks internet connectivity by attempting a connection to the Google public DNS server (8.8.8.8). If the connection fails for three consecutive minutes, a telnet connection is opened to a DSL modem and reboot commands are issued.
I created this VI to deal with a flaky Zyxel C1100Z DSL modem. It seemed that whenever my DSL connection went down, I had no choice but to either unplug or reboot the modem, or the connection would never recover on its own. This example automates the process of checking internet connectivity and then automatically issuing the reboot command sequence over an unsecured telnet connection. Connectivity is monitored by attempting to open a TCP connection to Google's public DNS every minute. If this fails more than 2 times in a row we open a telnet connection to a modem and issue a reboot command using LabVIEW's TCP API.
1. Simply run the VI (you may have to adjust your modem IP)
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.