background image

EM38A / EM38A-R / EM38A-X  User’s Manual  

Page 3 of 8

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

Execution  of  this  trigger  is  not  interruptible.

I - Interruptible

Execution  of  this  trigger  can  be  interrupted  by  any  trigger  other
than  itself.

H - Holdable

Execution of this trigger  continues for as long as the  trigger is ap-
plied,  repeating  itself  if  necessary.  The  execution  stops  immedi-
ately  when  the  trigger  is  removed.

In  the  DS  and  RS  modes,  there  are  8  direct  triggers  (001  ~  008,
corresponding  to T1  ~ T8).  In  the  BS  mode,  there  are  128  direct
triggers (001 ~ 128, corresponding to the binary code on T1 ~ T7).

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  991  indirect  triggers  (009  ~
999). In the BS mode, there are 871 indirect triggers (129 ~ 999).

These  are the  script  commands:

Fnnn - play File #nnn

Example:  F168  plays  file  #168.

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.

XNn - turn on relay #n (EM38A-R & EM38A-X only)

Example: XN8 turns on relay #8.

XNN - turn on all relays (EM38A-R & EM38A-X only)

Example:  XNN  turns  on  all  relays.

XFn - turn off relay #n (EM38A-R & EM38A-X only)

Example: XF6 turns  off relay #6.

XFF - turn off all relays (EM38A-R & EM38A-X only)

Example:  XFF  turns  off  all  relays.

Xnnn - send binary to relay (EM38A-R & EM38A-X only)

Example: X63 turns on relay #1~6 because 63 = binary 00111111.

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.

Automatic Execution of Script 000

Upon powerup or reset, the system will automatically executes script
000 once if  it exists.

Script Examples

DS
N001=F007,W00030,BN,F899,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 or BS to enter the Round-
Robin Script mode or the Binary 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,
-  play file  #899,
- 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
N002=F002,J000
N003=F003,J000
END

Here  file #123  is  looped from  power-up but  can  be interrupted  by
trigger inputs T1, T2, and T3. After interruption, it always jumps to
trigger 000 so file #123 starts to loop again, although from the be-
ginning instead  of where  it left  off.

Summary of Contents for EM38A

Page 1: ...lex ibility if the unit runs in the Script mode In all other modes it is automatically turned on while playing audio with a maximum sink current of 200 mA It can be used to synchro nously activate an...

Page 2: ...les on the flash card 001 002 and 004 the system will only sequence from 001 to 002 File 004 will never be played because File 003 is missing The Sequential Trigger is prioritized from T1 the highest...

Page 3: ...R EM38A X only Example XNN turns on all relays XFn turn off relay n EM38A R EM38A X only Example XF6 turns off relay 6 XFF turn off all relays EM38A R EM38A X only Example XFF turns off all relays Xn...

Page 4: ...e file number to the beginning of the original filename e g 001 tiger mp3 Note that if you want to store the maximum number of files on the flash card you should keep the filenames including the file...

Page 5: ...cess the DTE can issue the command one byte at a time For each byte sent the DTE should wait to receive a proper confirmation within 100 ms If the confirmation is missing or invalid the whole session...

Page 6: ...mmand is usually used when the parallel inputs are con nected to switches sensors and or other similar devices and you want to know the on off status of these devices Note that although the status of...

Page 7: ...utton is released If the same button is pressed again later playing re starts from the beginning of the file instead of where it left off If both buttons are held down button 1 prevails To play both s...

Page 8: ...e Using Normally Closed Switches Sensors Normally closed switches and sensors are often used in security systems 1 Play when the switch sensor opens with no priorities Intended Operation Play file 001...

Reviews: