![](/html/df/df5e/df5e62011ef11ab67e53d9313cd0af61aa5a7109b07e1d50f939f92c3a892d3f/bg2.png)
2 Model CD-2 – External Control Manual
Introduction
The purpose of this document is to describe how the external control interface of the device
works.
Serial Settings
The serial port settings are always 8 data bits, no parity and one stop bit with a baud rate of
115200.
Commands and Requests
All commands and requests start with the ‘!’ character.
Commands end with a combination of the Carriage Return character (ascii 0x0D, referred to
as <CR> in this document) and Line Feed (ascii 0x0A, <LF>). Often, a single <CR> is used,
but because different systems handle these characters differently, it is also allowed to end
with <LF>, <CR><LF> or even <LF><CR>. In this document, it is expected to be <CR><LF>,
but all of these combinations are allowed instead.
Requests end with the character ‘?’ and <CR><LF> (or any <CR><LF> combination as
above).
Commands can have parameters, these are enclosed in parenthesis.
Replies to a request are formatted as the request with the reply values as parameters.
Replies always use the <CR><LF> combination of line-end characters.
Commands and requests are not case sensitive. In addition, it is possible to subscribe to
status changes from the device. In this situation, whenever a status has changed (new state,
new track etc.) the device will send a status. This status is formed exactly like a reply to a
request, except it is followed by the character '!' before the <CR><LF> to indicate, that this is
an asynchronous message, not a reply.
!REQUEST(status)!<CR><LF>
A status, which has changed
Commands and requests which are malformed or has invalid parameters will just be ignored.
If a command or request is correct but followed by garbage before the line end chracter(s),
the command or request will be executed and the garbage ignored.
![](/html/df/df5e/df5e62011ef11ab67e53d9313cd0af61aa5a7109b07e1d50f939f92c3a892d3f/bg3.png)
3 Model CD-2 – External Control Manual
Requests
The following requests are available on the CD-2:
Requests the SW
version in the CD-2
!VER(1.23a)<CR><LF>
If the version is 1.23a
Requests the current
state.
One of:
!STATE(OFF)<CR><LF>
!STATE(OPENING)<CR><LF>
!STATE(OPEN)<CR><LF>
!STATE(CLOSING)<CR><LF>
!STATE(NODISC)<CR><LF>
!STATE(DISCERROR)<CR><LF>
!STATE(READING)<CR><LF>
!STATE(PLAY)<CR><LF>
!STATE(STOP)<CR><LF>
!STATE(PAUSE)<CR><LF>
!STATE(WIND)<CR><LF>
!STATE(REWIND)<CR><LF>
Requests the number of
the track currently
being played.
From
!TRACK(1)<CR><LF>
to
!TRACK(99)<CR><LF>
or
!TRACK(-)<CR><LF>
if no track is currently being
played
Requests the number of
tracks on the current
disc.
From
!NOFTRACKS(1)<CR><LF>
to
!NOFTRACKS(99)<CR><LF>
or
!NOFTRACKS(-)<CR><LF>
if there is no current disc.