Enabling/disabling the WAN interface
A common example of controlling the WAN communication through scripting is enabling and disabling the WAN port based on the state of a tag.
In the example below, the boolean tag Switch enables the WAN port when it is high and disables it otherwise.
Rem --- eWON user (start) DoSwitch: IF (Switch@<>0) THEN REM Open Internet connection SETSYS COM,"load" REM --- WANCnx = 2 for Ethernet SETSYS COM,"WANCnx","2" SETSYS COM,”WANPermCnx”,”1” SETSYS COM,"save" PRINT Time$;" Connection opened" ELSE REM Close Internet connection SETSYS COM,"load" REM – WANCnx = 0 for disabled SETSYS COM,"WANCnx","0" SETSYS COM,"save" PRINT Time$;" Connection closed" ENDIF END