
EM34A / EM34A-R / EM34A-X User’s Manual Page 3 of 6
Script Playback Mode
Instead of playing a single sound file, the Script Playback mode
executes a script of commands for each trigger. Note that the Busy
output will not turn on/off automatically in the Script mode. It must
be specifically turned on/off with the BN and the BF commands.
Written in the configuration file using plain text, the script consists
of multiple lines each containing the commands for a particular
trigger in the following format:
?nnn=Command1,Command2...
Here “nnn” is the trigger number and “?” is one of the following:
N - Non-interruptible
This trigger is not interruptible.
I - Interruptible
This trigger can be interrupted by another trigger but not itself.
H - Holdable
Execution continues for as long as the trigger is applied, repeating
if necessary. Stops immediately when the trigger is removed.
In the DS and RS modes, there are 4 direct triggers (001 ~ 004,
corresponding to T1 ~ T4).
In addition to the direct triggers, there are also indirect triggers. An
indirect trigger can be activated only by jumping from another trig-
ger using the Jump command.
In the DS and RS modes, there are 995 possible indirect triggers
(005 ~ 999).
These are the script commands:
Fnnn - play file #nnn one time
Example: F168 plays file #168. Note that the next command (if
any) will not be executed until the file has played to the end.
Wnnnnn - wait nnnnn units of 0.1 second
Maximum value for nnnnn is 65535 (6553.5 seconds).
Example: W00020 = wait 2 seconds.
Note: W00000 = wait forever.
Jnnn - jump to trigger #nnn
Example: J007 jumps to trigger 007.
BF - turn off the Busy output
Use this command to turn the Busy output off.
BN - turn on the Busy output
Use this command to turn the Busy output on.
Rgnn - random play one time
Play a random file from group g, within range 01 to nn. For ex-
ample, R015 will random play a file within 001 to 015; R208 will
random play a file within 201 to 208.
XNn - turn on relay #n (EM34A-R & EM34A-X only)
Example: XN3 turns on relay #3.
XNN - turn on all relays (EM34A-R & EM34A-X only)
Example: XNN turns on all relays.
XFn - turn off relay #n (EM34A-R & EM34A-X only)
Example: XF2 turns off relay #2.
XFF - turn off all relays (EM34A-R & EM34A-X only)
Example: XFF turns off all relays.
END
Always add the word END at the end of the entire script. You may
add any comments for your own reference after END.
Important Notes
- All command letters must be in upper case.
- Script lines must be separated by carriage returns (the Enter key).
- A script line is limited to 128 characters, excluding ‘=’ and ‘,’. If
more space is needed, use the Jump command.
- A command is always fully executed before the next one starts.
For example, the command after ‘F001’ will not be executed until
the 001 file has played to the end.
Automatic Execution of Script 000
Upon powerup or reset, the system will automatically executes script
000 once if it exists.
Script Example
DS
N001=F007,W00030,BN,R926,BF,J168
I168=F001,W36000,J168
H033=F273
END
DS is not really a script command, but it tells the system to enter the
Direct Script mode. You can also use RS to enable the Round-Robin
Script mode.
When the T1 input is triggered, the system start executing trigger
N001. Since this trigger is non-interruptible, it will always executes
to the end. Trigger N001 is executed as the following:
- play file #007,
- wait 3 seconds,
- turn on the Busy output,
- random play a file within 901 to 926,
- turn off the Busy output,
- jump to trigger 168 (I168).
Trigger I168 is executed as the following:
- play file #001,
- wait 60 minutes,
- jump back to itself.
Since trigger I168 is interruptible, this endless loop can be broken
by any future trigger.
Trigger H033 will never be executed because it is an indirect trig-
ger in the DS mode, yet it is not jumped to by any other trigger.
Background Music Example
The automatic execution feature can be used to play background
music while no trigger is being executed. For example,
DS
I000=F123,J000
N001=F001,J000
END
Here file #123 is looped from power-up but can be interrupted by
trigger inputs T1. The J000 command at the end of script 001 jumps
to script 000, so file #123 starts to loop again (although from the
beginning instead of where it left off).
Random Play Consideration
All files within a random range must exist, or the system will play
nothing when a non-existing file is selected for random play. For
example, the script command R926 randomly selects a file within
901 to 926, so every file from 901 to 926 must exist.
Note that random play does not guarantee that every file in the
range will be played once before it selects the same file again.