Write block – ProSoft Technology MVI46-GSC User Manual
Page 47

Reference MVI46-GSC
♦ SLC Platform
Generic Serial Communication Module
ProSoft Technology, Inc.
Page 47 of 78
December 5, 2007
The receive buffer in the module is set to 4096 bytes. This large size permits the
buffering of a large amount of data before a transfer of the data to the controller
is required. The ladder logic to use a buffer larger than 256 bytes is more
complex. The module buffers the data in this buffer until one of the specified
termination condition is recognized. The module will then transfer the received
block of data to the controller. If the block of data received is larger than 256
bytes, multiple blocks will be used to transfer the data to the controller. The first
block will contain a value of –1 in the Number of Characters Received data field.
This indicates that there will be more blocks to follow and that the current block
contains 256 bytes of data. As long as more than 256 bytes are present in the
buffer being sent to the controller, the length field will be set to a value of –1.
When 256 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 represents the
number of bytes present in the data area. The ladder logic must recognize the
presence of the positive number and end the packet received.
The two word values 287 (port 1 transmit count) and 288 (port 2 transmit count)
inform the processor of the number of bytes transferred in 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 is in a busy state and cannot buffer the
new data. If a value is returned in one of these words, the value represents the
number of bytes in 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(s)
attached to each application port. An important member of the value in the status
object is error word for each port. This value contains the configuration error flags
for each port and the receive buffer overflow error flag.
Write Block
These blocks of data transfer information from the SLC processor to the module.
The structure of the output image used to transfer this data is shown below:
The Block Sequence Number is that received on the last read block transfer
through the M1 file image on the module. The ladder logic should copy this value
from word 0 of the M1 file to word 100 of M0 file.
M0: File Offset
Description
100
Block Sequence Number (Read block number as set by module)
101
Intercharacter delay for this message (milliseconds between characters)
Port 1
M0: File Offset
Description
102
Number of characters to transmit on Port 1 (0 to 256)
103 to 230
Port 1 data to transmit
231
Intercharacter delay for this message (milliseconds between characters)