User guide

eWON 500-2001-4001-4002 User Guide - Programming the eWON
eWON 500®2001®4001®4002® Version 4_3_0 - User Guide - 10/5/05 - ©ACT'L sa - Page 152
9.2.51 ONCHANGE
Syntax [command]
ONCHANGE S1,S2
• S1 is the Tag name to scan for value change
• S2 is the command line to execute in case of value change.
Purpose:
Executes S2 command line when the value of Tag with Tag name given by S1 changes.
The EVTINFO parameter (see GETSYS page 141) is set to the Tag id when command is called.
Example:
See also:
“GETSYS, SETSYS” on page 141, “ONxxxxxx” on page 151
9.2.52 ONERROR
Syntax [command]
ONERROR S1
• S1 is the command line to execute when an error occurs during program execution.
Purpose:
The EVTINFO parameter (See GETSYS, SETSYS on page 141) is set to the code of the error.
Example:
See also:
“GETSYS, SETSYS” on page 141, “ONxxxxxx” on page 151
9.2.53 ONPPP
Syntax [command]
ONPPP S1
• S1 is the command line to execute when the PPP connection goes online or offline.
Purpose:
The EVTINFO parameter (see GETSYS page 141) is set to one of the following values:
Example:
See also:
“GETSYS, SETSYS” on page 141, “ONxxxxxx” on page 151
ONCHANGE "MyTag","goto MyTagChange"
ONERROR "goto TrapError"
EVTINFO Value Situation
1 The PPP connection has gone ONLINE
2 The PPP has gone OFFLINE
Table 98: ONPPP - EVTINFO values
ONPPP "goto PppAction"
END
PppAction:
I%=GETSYS PRG,"EVTINFO"
IF I%=1 then
PRINT "Online with address";GETSYS PRG,"PPPIP"
ELSE
PRINT "PPP Going offline"
ENDIF
END