2 send, 3 receive, 4 clearflags – Sensoray 2600 User Manual

Page 28: 5 open

Advertising
background image

2600 Family Instruction Manual

23

Chapter 4 : Serial Communication Server

4.4.2 Send

Function

Transmits a character string.

Opcode

0x01

Command

Data[]

Response

(Status)

Notes

All bytes in Data[] are buffered on the MM for
transmission to the remote serial device. The
transmit buffer is a FIFO, so any bytes that are
already pending in the transmit buffer will be sent
first, before the new data bytes.

The MM determines the number of data bytes in
the com port command by means of the UDP
datagram size. The MM assumes that all bytes
following the first com port command byte are
data bytes that are to be transmitted to the remote
serial device.

Note that the MM does not employ any delimiter
characters, such as carriage returns, to denote
logical partitions in the serial data stream.

4.4.3 Receive

Function

Returns a received character string.

Opcode

0x02

Command

(MaxSize[0]),(MaxSize[1])

Response

(Status),Data[]

Notes

The client can determine the number of bytes
received from the MM by examining the size of
the UDP datagram that comprises the com port
response. The size of Data[] equals the size of
the datagram minus one. The size of Data[] is
guaranteed to never exceed MaxSize.

All of the bytes returned in Data[] are removed
from the com port receive buffer.

4.4.4 ClearFlags

Function

Resets to zero the BRK bit and all error flags in
the status byte.

Opcode

0x03

Command none

Response

(Status)

4.4.5 Open

Function

Enables the serial transmitter and receiver.

Opcode

0x04

Command none

Response

(Status)

Notes

Before issuing an Open command, the
SetMode

command should be used to configure

the target com port for proper operation.

Upon module reset, all com ports default to the
closed (disabled) state. Each com port must be
enabled by Open before it will communicate
with a remote serial device.

Parameter

Function

Data[]

Array of byte values to be transmitted
to the remote serial device.

Parameter

Function

Status

Com port status. The REJ bit flag will
be set if the transmit buffer has
insufficient free space to accommodate
the specified byte string.

Parameter

Function

MaxSize

Maximum number of bytes to return.
The MM will return the smaller of
MaxSize

bytes or all unread bytes that

have been received from the remote
serial device.

Parameter

Function

Status

Com port status.

Data[]

Array of byte values received from the
remote serial device.

Parameter

Function

Status

Com port status condition that is
effective after this action executes.
The FRM, PAR, OVR and WRP bits are
all reset to zero.

Parameter

Function

Status

Com port status. The REJ flag will be
set if the port is already open.

Advertising