ProSoft Technology MVI56E-GSC/ GSCXT User Manual

Page 89

Advertising
background image

MVI56E-GSC ♦ CompactLogix or MicroLogix Platform

Reference

Enhanced Generic ASCII Serial Communication Module

User Manual

ProSoft Technology, Inc.

Page 89 of 140

May 9, 2014

 Load the character codes for the outgoing message string into the controller

tag GSC.Px_Data.WriteString (where x = 1 for Port 1 or 2 for Port 2)

 Set the tag GSC.Px_Data.WriteLength to the number of characters to send
Once the number of characters to transmit in the write block is set greater than
zero (value in word at bytes 3 & 4 and/or 253 & 254), the ladder logic program
will trigger the Process Write Block function and move a new sequence number
value into Byte 0 of the output image. This Block Sequence Number will be the
value received in the most recently received Read Block. If the selected port is
not already busy, the data in the block will be moved to the port’s transmit buffer
and sent out the port.

For devices that do not buffer received data, when interfacing with a modem in
command mode, or when simulating keyboard or keypad entry, inter-character
delays may be required. In order to pace the characters for the write operation,
an inter-character delay value can be sent with each write message.

For example, if the port is tied to a device that expects input with delays of 200
milliseconds between each character, set the Inter-character Delay word (Bytes 1
& 2 for Port 1 or Bytes 251 & 252 for Port 2) to a value of 200 in the module’s
output image using processor ladder logic. The message will be transmitted with
a 200-millisecond wait period between each character. Because this delay value
is sent from the processor for each write message, the inter-character delay can
be set independently for each message.

For example, when writing AT commands to a dial-up modem, an inter-character
delay of 100 milliseconds may be required for dialing. But, when the modem has
made its connection and is ready for data transfer, the Inter-character Delay
might need to be set to 0. When the delay is set to 0, the whole packet of data
will be placed in the module’s transmit buffer at one time and all characters will
be sent one after the other with no delay in between.

4.3.2 Read Block

The module buffers the data received on its application serial ports in individual
port receive buffers until one of the specified termination condition is recognized.
The module will then transfer the received block of data from the port buffer to
the controller. Read data blocks transfer information from the module to the
ControlLogix processor.

The structure of the input image used to transfer this data is shown below.

Port 1

Byte Offset

Description

0

Reserved

1 to 2

Number of characters (0 to 200) in Port 1 receive block (5 to 204). If the receive
data in the module is larger than 200 bytes, multiple blocks will be transferred. Any
block with a value of -1 in this field represents the first or continuation block and the
block contains 200 bytes of data. The last block of data will contain a positive
number in this field that represents the number of characters in the last block.

3 to 4

Number of characters transmitted (0 to 200) from last block write Port 1

Advertising