XT2500 Product Manual
Page 36 | 92
CONFIDENTIAL AND PROPRIETARY
5.2. I
NTERPRETER
S
CRIPTING
T
RIGGER
B
LOCK
E
XAMPLES
5.2.1. Packet Send Example
This example shows an alternate message being sent every two minutes. If flag[0] is set, then send packet 1,
otherwise, send packet 0. Always reset the timer and toggle the flag.
trigger when Eq(TimerExpired(0), 1)
condact when Eq(FlagIsSet(0), 1) [Debounce(0, 0)]
actions
run BuildAndSendMsg(1, 0, 1, 0)
run ClearFlag(0)
condact when Neq(FlagIsSet(0), 1) [Debounce(5, 0)]
# NOTE: debounce Hi for 5 seconds, to keep these actions from executing
due to
# the previous CondAct block clearing the flag.
actions
run BuildAndSendMsg(0, 0, 1, 0)
run SetFlag(0)
condact always
actions
run ResetTimer(0)
5.2.2. Build and Send Message
A message is created and sent when you send a
user event
to the interpreter. The
user event
can be sent via
:xrmsg <index>.
NOTE:
see actions[] array in src/interpreter/interpreter.c to find valid action indices and number of
arguments each action should take.
trigger when Eq(UserEventIsActive(0xff), 1)