Special function blocks – ProSoft Technology MVI56E-GSC/ GSCXT User Manual

Page 92

Advertising
background image

Reference

MVI56E-GSC ♦ CompactLogix or MicroLogix Platform

User Manual

Enhanced Generic ASCII Serial Communication Module

Page 92 of 140

ProSoft Technology, Inc.

May 9, 2014

The ladder logic is required to handle all read data transferred from the
communication port buffers to the processor. The simple example ladder logic
assumes the received data block contains no more than 200 bytes (200 ASCII
character codes) of data for each port. Since the receive buffer for each
application port in the module can hold up to 4096 bytes (characters), the ladder
logic to handle incoming strings larger than 200 bytes is more complex than that
shown in the simple example logic.

If more than two hundred bytes are present in the buffer to be sent to the
controller, the length field will be set to a value of -1 for all Read Blocks
transferred, except for the last block. Each new block with the next 200 bytes
from the buffer will arrive with a new Block Sequence Number and a length of -1.
When 200 or fewer bytes remain in the buffer, the module will send the last block
with a positive number in the length field. The value passed is the remaining
number of valid bytes present in the data area that completes the long received
message.

If you expect to receive incoming messages that will contain more than 200 bytes
(characters) per message, your ladder logic must be modified to process
sequential 200-byte blocks of data and recognize the final partial block in order to
successfully handle those larger messages.

The two word values at bytes 3 & 4 (Port 1 Transmit Count) and bytes 253 & 254
(Port 2 Transmit Count) inform the processor of the number of bytes transferred
from the last write block to the respective port transmit buffers. If a value of zero
is returned in one of these words and data was sent in the last write block, the
ladder logic must re-send the data in the next write block as the port was in a
busy state and could not buffer the new data to be transmitted. If a value is
returned in one of these words, the value represents the number of bytes from
the last write block moved into the port’s transmit buffer.
The status information transferred in the Read Block can be used by the
processor to determine the state and "health" of the module and the device or
devices attached to each application port. An important member of the value in
the status object is the Error Word for each port. This value contains the
configuration error flags for each port and the receive buffer overflow error flag.

4.4

Special Function Blocks

Special function blocks are special blocks used to control the module or request
special data from the module. The current version of the software supports three
special function blocks:

1 Warm Boot block
2 Cold Boot block
3 Configuration Data block

Advertising