BaltechScript / RunSequence Protocol Frame
This command allows to run complex switch sequences for
IO-Ports. A switch sequence can be one or multiple (nested)
loops (with separate timing each) that are controlling one
or multiple different LEDs.
A sample for a switch sequence is:
- toggle green LED 3 times with 10 Hz frequency
- enable red LED for 2 sec
- repeat from step 1 four times.
Currently it is not possible to run more than one
switch sequence at the same time.
All parameters of switch sequences (=frequencies, LED ids
and repeat count) are static.
Format
|
Name
|
Type/Size
|
Description
|
|
Cmds
|
Array
|
This is a list of commands, that has to be finished
with the EndOfSequence command.
After the EndOfSequence command the
Script may continue with regular BaltechScript commands.
|
|
Cmd.CmdCode
|
Enumeration (8 bits)
|
A command is a basic building block for switch
sequences. Every command controls either a LED,
delays execution or manages control flow
(mainly loops).
Values:
-
EnablePort (0x01)
Enable the port ID stored in the Field Param.
-
DisablePort (0x02)
Disable the port ID of the Field Param.
-
RepeatLoop (0x05)
Jumps back to the corresponding StartLoop a
specified number of repetitions. The field Param
specifies the number of loops (0-255).
-
WaitMs (0x08)
Wait exactly the amount of ms specified in the field
Param before going on.
-
WaitSec (0x09)
Wait exactly the amount of seconds specified in
Param before going on.
-
EndOfSequence (0xF1)
End Of Script Marker.
Has to be present at the end of every script.
-
StartLoop (0xF2)
Starts a loop. Has to be followed by RepeatLoopX
or RepeatLoop.
-
OnStop (0xF3)
If execution of the sequence was aborted, jump to this label
and run the following commands until EndOfSequence to
restore a default LED state. The following commands must not
contain WaitXXX commands as it has to finish
immediately.
-
EnablePortGreenLed (0x10)
This is a ShortCut for EnablePort GreenLed
(requires only one byte intead of 2).
-
EnablePortRedLed (0x11)
-
EnablePortBeeper (0x12)
-
EnablePortRelay (0x13)
-
EnablePortBlue (0x16)
-
DisablePortGreenLed (0x20)
This is a Shortcut for DisablePort GreenLed
(requires only one byte intead of 2).
-
DisablePortRedLed (0x21)
-
DisablePortBeeper (0x22)
-
DisablePortRelay (0x23)
-
DisablePortBlue (0x26)
-
InvertPortGreenLed (0x30)
This is a ShortCut for EnablePort GreenLed, if
GreenLed is enabled otherwise DisablePort GreenLed.
-
InvertPortRedLed (0x31)
-
InvertPortBeeper (0x32)
-
InvertPortRelay (0x33)
-
InvertPortBlue (0x36)
-
Repeat1Times (0x51)
This is a Shortcut for RepeatLoop 1 which is
actually a dummy operation, as the repeat block is was
already executed once.
-
RepeatLoop2Times (0x52)
This is a ShortCut for RepeatLoop 2. It repeats all
operations since corresponding StartLoop exactly once. Thus
in summary they were run twice (once the first time and once
by repeating them).
-
RepeatLoop3Times (0x53)
-
RepeatLoop4Times (0x54)
-
RepeatLoop5Times (0x55)
-
RepeatLoop6Times (0x56)
-
RepeatLoop7Times (0x57)
-
RepeatLoop8Times (0x58)
-
RepeatLoop9Times (0x59)
-
RepeatLoop10Times (0x5A)
-
RepeatLoop11Times (0x5B)
-
RepeatLoop12Times (0x5C)
-
RepeatLoop13Times (0x5D)
-
RepeatLoop14Times (0x5E)
-
RepeatLoop15Times (0x5F)
-
Wait100Ms (0x81)
This is a Shortcut for WaitMs 100. It waits 100 ms
before going on with the next operation.
-
Wait200Ms (0x82)
-
Wait300Ms (0x83)
-
Wait400Ms (0x84)
-
Wait500Ms (0x85)
-
Wait600Ms (0x86)
-
Wait700Ms (0x87)
-
Wait800Ms (0x88)
-
Wait900Ms (0x89)
-
Wait1000Ms (0x8A)
-
Wait1100Ms (0x8B)
-
Wait1200Ms (0x8C)
-
Wait1300Ms (0x8D)
-
Wait1400Ms (0x8E)
-
Wait1500Ms (0x8F)
-
Wait1600Ms (0x90)
-
Wait1700Ms (0x91)
-
Wait1800Ms (0x92)
-
Wait1900Ms (0x93)
-
Wait2000Ms (0x94)
-
Wait2100Ms (0x95)
-
Wait2200Ms (0x96)
-
Wait2300Ms (0x97)
-
Wait2400Ms (0x98)
-
Wait2500Ms (0x99)
-
Wait2600Ms (0x9A)
-
Wait2700Ms (0x9B)
-
Wait2800Ms (0x9C)
-
Wait2900Ms (0x9D)
-
Wait3000Ms (0x9E)
-
Wait3100Ms (0x9F)
-
Wait3200Ms (0xA0)
-
Wait3300Ms (0xA1)
-
Wait3400Ms (0xA2)
-
Wait3500Ms (0xA3)
-
Wait3600Ms (0xA4)
-
Wait3700Ms (0xA5)
-
Wait3800Ms (0xA6)
-
Wait3900Ms (0xA7)
-
Wait4000Ms (0xA8)
-
Wait4100Ms (0xA9)
-
Wait4200Ms (0xAA)
-
Wait4300Ms (0xAB)
-
Wait4400Ms (0xAC)
-
Wait4500Ms (0xAD)
-
Wait4600Ms (0xAE)
-
Wait4700Ms (0xAF)
-
Wait4800Ms (0xB0)
-
Wait4900Ms (0xB1)
-
Wait5000Ms (0xB2)
-
Wait5100Ms (0xB3)
-
Wait5200Ms (0xB4)
-
Wait5300Ms (0xB5)
-
Wait5400Ms (0xB6)
-
Wait5500Ms (0xB7)
-
Wait5600Ms (0xB8)
-
Wait5700Ms (0xB9)
-
Wait5800Ms (0xBA)
-
Wait5900Ms (0xBB)
-
Wait6000Ms (0xBC)
-
Wait6100Ms (0xBD)
-
Wait6200Ms (0xBE)
-
Wait6300Ms (0xBF)
|
|
Optional field, condition:
CmdCode == CmdCode.RepeatLoop
|
|
|
Cmd.RepeatCnt
|
Integer (8 bits)
|
The number of repetitions of the code block
between the matching tLoop
this atLoopmand. If this number is
2 the interpreter jumps back to tLoop
exactly one time (which results in summary in
to repetitions).
|
|
Optional field, condition:
(CmdCode == CmdCode.WaitMs) or (CmdCode == CmdCode.WaitSec)
|
|
|
Cmd.Param
|
Integer (8 bits)
|
This field represents a time (either in milliseconds or
seconds). The UI-sequence interpreter will delay the amount
of (milli-)seconds before going on.
|
|
Optional field, condition:
(CmdCode == CmdCode.EnablePort) or (CmdCode == CmdCode.DisablePort)
|
|
|
Cmd.SwitchIoPort
|
Enumeration (8 bits)
|
I/O pins of the reader that can be controlled by the user.
Values:
-
GreenLed (0x00)
Enable/disable/toggle the green
LED (if available).
-
RedLed (0x01)
Enable/disable/toggle the red
LED (if available).
-
Beeper (0x02)
Enable/disable/toggle the beeper
(if available).
-
Relay (0x03)
Enable/disable/toggle the relay
(if available).
-
Input0 (0x04)
Retrieve the state of the custom
input 0.
-
Input1 (0x05)
Retrieve the state of the custom
input 1.
-
BlueLed (0x06)
Enable/disable/toggle the blue
LED (if available).
-
TamperAlarm (0x07)
Retrieve the state of the tamper
alarm.
-
Gpio0 (0x08)
Refers to a general purpose I/O. The physical pin
assigned to this logical I/O port depends on the
physical setup of the device.
-
Gpio1 (0x09)
Refers to a general purpose I/O. The physical pin
assigned to this logical I/O port depends on the
physical setup of the device.
-
Gpio2 (0x0A)
Refers to a general purpose I/O. The physical pin
assigned to this logical I/O port depends on the
physical setup of the device.
-
Gpio3 (0x0B)
Refers to a general purpose I/O. The physical pin
assigned to this logical I/O port depends on the
physical setup of the device.
-
Gpio4 (0x0C)
Refers to a general purpose I/O. The physical pin
assigned to this logical I/O port depends on the
physical setup of the device.
-
Gpio5 (0x0D)
Refers to a general purpose I/O. The physical pin
assigned to this logical I/O port depends on the
physical setup of the device.
-
Gpio6 (0x0E)
Refers to a general purpose I/O. The physical pin
assigned to this logical I/O port depends on the
physical setup of the device.
-
Gpio7 (0x0F)
Refers to a general purpose I/O. The physical pin
assigned to this logical I/O port depends on the
physical setup of the device.
-
CustomVled0 (0x40)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled1 (0x41)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled2 (0x42)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled3 (0x43)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled4 (0x44)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled5 (0x45)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled6 (0x46)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled7 (0x47)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled8 (0x48)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled9 (0x49)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled10 (0x4A)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled11 (0x4B)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled12 (0x4C)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled13 (0x4D)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled14 (0x4E)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
-
CustomVled15 (0x4F)
Custom Virtual LED (VLED) port. Allows RGB LEDs to
be activated with a user-defined color.
|