The Ewon Cosy features an option that allows users to control the WAN or the VPN connection through its
Digital Input. The idea is to let the end customer decide whether the Integrator or the Machine
builder can connect the Ewon remotely or not using an electrical switch.
This option is unfortunately not directly embedded in the Ewon Flexy. Nevertheless, it is possible to make it
using a simple piece of BASIC Script.
APPLICABLE PRODUCTS
Ewon : Flexy
PROCEDURE
First create a Tag associated to a digital input of the Flexy. In this example we will use the first digital input of the Flexy Base Unit (DI1). See Appendix A of the Flexy 205 Installation Guide.
Secondly make sure your Ewon Internet connection is properly configured (You should have executed the Internet Configuration Wizard successfully)
Finally, open your BASIC IDE, paste the following BASIC Script and save it.
Version 1 - Enable/Disable the WAN/Internet Connection :
- In the Init Section, paste the following script
SETSYS COM,"LOAD"
WANCnxInUse$ = GETSYS COM,"WANCnx"
ONCHANGE "Switch","GOTO DoSwitch"
GOTO DoSwitch
- Create a new section with the name of your choice and paste this other script
DoSwitch:
IF (Switch@<>0) THEN
Rem Open Internet connection
SETSYS COM,"LOAD"
SETSYS COM,"WANCnx", WANCnxInUse$
SETSYS COM,"WANPermCnx","1"
SETSYS COM,"SAVE"
PRINT Time$;" Internet Connection opened"
ELSE
Rem Close Internet connection
SETSYS COM,"LOAD"
SETSYS COM,"WANCnx","0"
SETSYS COM,"SAVE"
PRINT Time$;" Internet Connection closed"
ENDIF
Version 2 - Enable/Disable the VPN Connection only :
- In the Init Section, paste the following script
ONCHANGE "Switch","GOTO DoSwitch"
GOTO DoSwitch
- Create a new section with the name of your choice and paste this other script
DoSwitch:
IF (Switch@<>0) THEN
Rem Open Internet connection
SETSYS COM,"LOAD"
SETSYS COM,"VPNCnxType","2"
SETSYS COM,"SAVE"
PRINT Time$;" VPN Connection opened"
ELSE
Rem Close Internet connection
SETSYS COM,"LOAD"
SETSYS COM,"VPNCnxType","0"
SETSYS COM,"SAVE"
PRINT Time$;" VPN Connection closed"
ENDIF
Do not forget to select the AutoRun option (Run > AutoRun) to start the Script execution at the Ewon Start-up.
At the end you should have this kind of result :