Lecnet software protocol – Lectrosonics UDR200b User Manual

Page 19

Advertising
background image

Wireless Diversity Receiver

LecNet SOFTWARE PROTOCOL

Note: This section is for developement of custom control applications and is not necessary for general operation of the receiver

and the LecNet control software provided by the factory.

The UDR200B uses a modification of the typical one-to-one
connection between two RS-232 compatible devices. The
UDR200B has both an RS-232 transmitter and receiver sec­
tion. The transmitter section is "tri-stated", or placed in a high
impedance mode, until the particular device is addressed. To
facilitate the simple parallel connection of multiple devices on a
single RS-232 port, an addressing scheme is employed to
route commands from the host to the proper device. When a
device receives its address from the host computer, it tempo­
rarily turns on its RS-232 transmitter long enough to send
whatever data is requested by the host. In this way, multiple
devices may drive a single transmit signal back to the host,
because only the addressed UDR200B will turn on its transmit­
ter.

The following code fragment, in BASIC, would be used to get
an "Acknowledge" name string back from an UDR200B:

Valid address values are 128-254 (80h-FEh). 255 (FFh) is an
invalid address and must not be used. Because the UDR200B
will interpret any single data byte whose value is greater than
127 as an address, single byte data (as opposed to addresses)
sent from the host must be in the range of 0-127. If a data
value needs to be output that exceeds 127, two bytes are
output such that the first byte is the lower 7 bits of the 8 bit
value, and the second byte is 1 if the MSB of the data byte is
1, or 0 if the MSB of the data byte is 0 (see the Two Byte
Format guidelines below).

Every UDR200B command must be preceded by the address
of the device to be controlled. If a device with the requested
address exists on the system, it will respond by sending a "0"
back to the host.

OPEN "COM1:9600,N,8,1" FOR RANDOM AS #1 LEN = 25

'Open Com1:9600, N, 8, 1.

...
...

PRINT #1, CHR$(150)

'Output the device address. Default address of
‘UDR200B is 150.

DataByte% = ASC(INPUT$(1,#1))

'Receive "0" byte. The ASC function is used to convert
‘the received string data to numeric data.

PRINT #1, CHR$(1)

'Output the "Acknowledge" command.

DataByte% = ASC(INPUT$(1,#1))

'Receive the length of the acknowledge string
‘(7 for the UDR200B).

Name$ = INPUT$(DataByte%,#1)

'Receive the name string ("UDR200B")

The first PRINT and INPUT$ sequence must precede every
command sent, even if the command is sent to the same
UDR200B as the previous command. Thus, each interchange
with an UDR200B follows this pattern:

1) Host sends device address (1 byte);

2) Host receives byte of “0” from UDR200B as

acknowledgement;

3) Host sends command (1 byte) to UDR200B;

4) Host and UDR200B interact based on particular

command sent.

This process must be followed for every command that is sent
to the LecNet device. The implication here is that even if the
host sends several commands to the same device, each
command must be preceded by the LecNet address/acknowl­
edge byte exchange.

Rio Rancho, NM – USA

19

Advertising