EM38A / EM38A-R / EM38A-X User’s Manual
Page 6 of 8
Serial Commands
The communication protocol uses software handshake on a per-
byte basis. That is, for every byte it receives, the system sends an
confirmation byte to the DTE. The DTE must not send the next byte
until it receives the confirmation byte.
Play File
DTE Sends: F### (### is the three-digit file number)
System Confirms: f### (### is the same file number as above)
If the file exists, it will be played once. If the file does not exist, the
system will simply ignore the command.
If the system is playing/paused when the ‘F’ letter is received, it will
return the error code ‘e’ instead of ‘f’. At this point the command
should be aborted. You should use the Stop Playback command to
stop the currrent playback first before starting a new one.
Loop File
DTE Sends: L### (### is the three-digit file number)
System Confirms: l### (### is the same file number as above)
If the file exists, it will be played repeatedly. If the file does not exist,
the system will simply ignore the command.
If the system is playing/paused when the ‘L’ letter is received, it will
return the error code ‘e’ instead of ‘l’ (lower case L). At this point
the command should be aborted. You should use the Stop Play-
back command to stop the currrent playback first before starting a
new one.
Stop Playback
DTE Sends: S
System Confirms: s
If the system is not playing/paused, it will simply ignore the com-
mand. Otherwise it will terminate the current playback.
Pause Playback
DTE Sends: P
System Confirms: p
If the system is not playing, it will simply ignore the command.
When the system is being paused, its Busy output (terminal BY) is
still active.
Resume Playback
DTE Sends: R
System Confirms: r
If the system is not paused, it will simply ignore the command.
Busy?
DTE Sends: B
System Confirms: b (if playing/paused) or s (otherwise)
Query Parallel Input Status
DTE Sends: Q
System Confirms: one status byte read from the parallel input
This command 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 these devices can be read, they cannot be used to
trigger the audio because the Parallel Interface is disabled when
the Serial Port is enabled.
The status byte has T1 as the LSB and T8 as the MSB. Note that
an input is at logic “1” when connected to +5V or left unconnected,
and it is at logic “0” when connected to 0V (the ground).
This command can be issued at any time.
Script Command
DTE Sends: C###C (### is one line of script commands)
System Confirms: c###c (### is an echo of the script line)
For example, if you send “CF001F002C” then the confirmation will
be “cf001f002c”. If a Script command is received when the system
is busy, it will be executed when the system is no longer busy. A
script command will be denied with the error code ‘e’ if there is
already a script command waiting for execution.
Refer to the ‘Script Playback Mode’ section for details on how to
write the script.
Relay On (EM38A-R & EM38A-X only)
DTE Sends: XN# (# is the relay number)
System Confirms: xn# (# is the same relay number as above)
For example, “XN3” turns on relay #3. To turn on all relays, use
“XNN”. This command can be issued at any time.
Relay Off (EM38A-R & EM38A-X only)
DTE Sends: XF# (# is the relay number)
System Confirms: xf# (# is the same relay number as above)
For example, “XF2” turns off relay #2. To turn off all relays, use
“XFF”. This command can be issued at any time.
Send Binary to Relay (EM38A-R & EM38A-X only)
DTE Sends: Xnnn (nnn is a 3-digit number with leading zeros)
System Confirms: xnnn (nnn is the same number as above)
For example, “X005” turns on relay #1 and #3 and turns off all
others because the binary code for 005 is 00000101.
Get Current Relay Status (EM38A-R & EM38A-X only)
DTE Sends: Y
System Confirms: nnn
nnn is a 3-digit number equal to the decimal value of the binary
form of the relays. For example, if nnn=128 (binary form 10000000)
then relay #8 (MSB of the binary form) is on and others are off.
Set Volume
DTE Sends: V##nn
System Confirms: v##nn (##nn is the same number as above)
Ranging from 00 (silence) to 64 (loudest), ## and nn are the 2-digit
volume level for the left and right channels respectively. The physi-
cal volume knob, however, is still functional and sets the max. which
is divided into 64 levels for this command to set.
Get Volume
DTE Sends: W
System Confirms: ##nn
## and nn are the 2-digit volume level for the left and right chan-
nels respectively.
Serial Command Error Code
The system will confirm with an “e” if an invalid command is re-
ceived, or if a valid command is received at the wrong time. At this
point, the command should be aborted.