AR.RunScript

This command runs a BaltechScript. This is a small sequence of instructions for the reader to execute. Typically, it's used to control reader feedback, i.e. LEDs, beeper, relay, and other I/O ports when you have highly specific requirements and/or want to store the script on the reader.

Instead of AR.RunScript, we recommend the UI command set as it's easier to implement and sufficient for the majority of use cases.

Script structure

A script consists of the following parts:

Examples

Here are a few examples of how to create a script. We'll use the following script commands as they're the most important ones:

Single script to control 1 port

In this example, we'll switch on the green LED permanently. To do so, we need to run the Enable script as follows:

01 00

Sequence of scripts

You can run a sequence of scripts in parallel by concatenating them.

Simultaneous feedback sequence

In this example, we'll switch on the green LED permanently. At the same time, we have the beeper beep 3 times for 200 ms. To do so, we extend the Enable script from the above example with a Toggle script:

01 00 03 02 03 02

The Toggle script in this sequence is composed as follows:

Consecutive feedback sequence

Concatenated scripts are always executed in parallel. However, you can still produce a consecutive feedback sequence using ToggleInverted and an appropriate delay. In this example, we'll use the toggle script from the above example to have the beeper beep 3 times for 200 ms. After the third beep, the red LED is enabled:

03 02 03 02 06 01 01 0C

The ToggleInverted script in this sequence is composed as follows:

Properties

Parameters (request frame)

Name Type/Size Description
Length of Script Integer (8 bits) Length of Script in byte
Script Raw data Script to execute

Returned values (response frame)

None