PLX30 Series
ASCII Protocol
Ethernet and Serial Gateways
User Manual
ProSoft Technology, Inc.
Page 155 of 200
September 19, 2012
8.1.2 Data Flow
The following illustration shows receive and transmit data flow of the ASCII
protocol.
Data received from the ASCII device is accepted by the receive driver and placed
in the receive database location configured by the user. The receive driver waits
until the user-configured termination condition is recognized while receiving the
data before placing the new data into the database.
For example, if the carriage-return character (ASCII 13) is used as the
termination condition for a received message, this signals the end of the
message. When the receive driver observes this character in the input stream, it
takes all received characters and places them in the internal database.
In both receive and transmit operations, a signal is required to determine when
new data is received or must be transmitted. The first word in the two data area
is used for this purpose. When the value of the first word changes, new data is
available.
Example:
The sequence number in the receive data block has a value of 0 as set when the
gateway initializes. The ASCII device sends a new data packet and the
termination condition is present. The receive driver copies the data into the
internal data area, sets the message length in the data area, and finally, sets the
new sequence number. Receive and transmit data block structure is discussed in
the following topics.