background image

EM3028B / EM3028B-R / EM3028B-X  User’s Manual  -  Page 4 of 8

Serial Interface

When the serial interface is enabled, all parallel inputs T1 ~ T8 are
disabled and all Parallel Modes are no longer applicable. But there
is a serial mode command to read the parallel inputs.

The serial interface consists of a female DB9 serial port supporting
both RS-232 (default setting) and RS-485. To support RS-485, you
must move the internal jumper J2 to the “485” setting.

On the DB9 connector, three pins are used for RS-232: pin 2 for
RX, pin 3 for TX, pin 5 for ground. Two pins on the same connector
are used for RS-485: pin 1 for negative, pin 9 for positive.

The hardware protocol is fixed at 9600 baud, eight data bits, no
parity and one stop bit (9600, 8N1). Other protocols may be sup-
ported by special request.

For RS-232 applications, the system (a DCE device) is connected
to a DTE device (such as a PC) with a regular serial cable (not a
null modem cable). For RS-485 applications, up to 32 systems,
each assigned with a unique address, can be daisy chained on the
same bus with a 2-wire cable.

To enable the Serial Mode on the system, the configuration file
must contain a two-digit address ranging from “01” to “32”. This
address assignment seems unnecessary for RS-232 applications
because RS-232 is a one-to-one interface. But it is necessary for
us because we want to provide a uniform protocol for both RS-232
and RS-485.

The benefit of a uniform protocol is that it allows us to control mul-
tiple systems from a DTE which has only a RS-232 port. In this
case a RS-232 to RS-485 hardware converter is needed to convert
the DTE’s RS-232 port into a RS-485 port.

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 (one exception explained below).

A communication session always starts with a selection process.
The DTE should first sends out an ASCII “A” which, as the only
exception, will not be confirmed by any system on the bus. The
DTE should then sends a binary coded address byte ranging from
1 to 32. If there is a system with the matching address, it will re-
spond by sending back an ASCII “a” within 100 ms. Otherwise the
selection process has failed and should be restarted.

Once the selection process is finished successfully, the DTE can
issue one of the serial commands, one byte at a time. For each
byte sent, the DTE should expect to receive a proper confirmation
within 100 ms. If the confirmation is missing or invalid, the whole
session must be aborted.

Testing the Serial Port

The serial port can be easily tested by using a Windows utility pro-
gram called “HyperTerminal”. HyperTerminal allows you to send
and receive data through the PC’s serial port. All you need to do is
type the letters on the keyboard to send them, and watch the screen
for received data.

The first step is to create a text file called “MODE.TXT” on the flash
card. Put only two letters in the file: 01. This will put the player into
the Serial mode of operation with a device ID #1. You may use
Windows Notepad or Wordpad to do it, just be sure to save the file
as “text only” and Windows will add “.TXT” automatically.

In addition to the MODE.TXT file, you also need to put a test sound
file on the flash card. For testing purpose, this sound file should be
called “001.WAV”.

The next step is to connect the player to the PC using a “straight
through” serial cable, not a “null modem” one. A straight through
cable has pin 2 connected to pin 2, pin 3 connected to pin 3, and
pin 5 connected to pin 5. Those are the only three pins we use.
Other pins, whether connected or not, do not matter.

Power up the player and run HyperTerminal on the PC. This pro-
gram is usually found under

Start>Programs>Accessories>Communications>HyperTerminal

Make a new connection on the COM port to which the player is
connected, with the following parameters:

Bits per second = 9600
Data bits = 8
Parity = None
Stop bits = 1
Flow control = None

Now we are ready to send the following  commands to the player.

We Type

Player Responds

------------------------------------------------------

A

-

ALT/01

a

(see notes below)

F

f

0

0

0

0

1

1

At this point the player should start playing the test sound file, and
the test is considered successful.

Note that in order to type the device ID in the binary format on the
PC’s keyboard, you must hold down the ALT key while entering the
numbers on the numerical keypad (make sure the NUM light is
on). In this test, for example, we need to type device ID 01, so you
must hold the ALT key down, press “0”, “1” on the numeric keypad
(“0” first then “1”), then release the ALK key.

If you made a mistake and typed a wrong letter during the test, the
player will either respond with a letter ‘e’ (for error) or not respond
at all, depending on the situation. In this case, you need to re-type
the command from the very beginning.

Содержание EM3028B

Страница 1: ...on board jumper J3 to the OFF position Busy Output Terminal BY This output is manually controlled when the system runs in the Script mode In all other modes this signal is automatically turned on duri...

Страница 2: ...he highest to T8 the lowest However it does not mean a higher priority input can interrupt a lower one It only means that if multiple triggers are applied at the same time the highest priority wins Ro...

Страница 3: ...n all relays XFn turn off relay n EM3028B R EM3028B X only Example XF6 turns off relay 6 XFF turn off all relays EM3028B R EM3028B X only Example XFF turns off all relays Xnnn send binary to relay EM3...

Страница 4: ...the selection process is finished successfully the DTE can issue one of the serial commands one byte at a time For each byte sent the DTE should expect to receive a proper confirmation within 100 ms I...

Страница 5: ...f 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 necte...

Страница 6: ...ename e g 001tiger wav Note that if you want to store the maximum number of files 512 on a single flash card you should keep the filenames including the file number within 8 characters Any filename lo...

Страница 7: ...s as soon as the button 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 preva...

Страница 8: ...mples 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...

Отзывы: