User manual

Toolbox 32 User Manual 1.47d www.cse-semaphore.com/mykingfisher
Page
158
Driver - User Defined
The User Defined protocol allows new comms protocols to be developed completely in ladder logic. The
User Defined protocol is similar to the ASCII protocol driver but is more useful because it is not limited to
null-terminated ASCII strings, can accept unsolicited incoming messages and will work on all communication
ports.
Note: Comms Analyser will only show User Defined protocol traffic after it has been processed by the
function block. That is Logic must be enabled for Comms Analyser show any User Defined traffic.
Tx User
Transmits a string up to 200 characters long to an external device and then receives and stores the
response string (if any). If any bytes are received, the success counter corresponding to the device number
is incremented (Note: this protocol does not verify any checksum or CRC bytes in the message). If no bytes
are received within the timeout period, the fail counter is incremented. Tx User also works with other port
protocols (other than User Defined eg. Series 2). All characters received while the Tx User function is active,
are treated as the Tx User response string.
Comment: A 12-character description.
Device Number: (1-249) The RTU address assigned to the external device. Note: the Device Number is
only used to access the communications parameters stored in the Network List (and Phone List for PSTN
devices); it does not have to correspond to the physical address of the external device. The network link
configured for this Device Number is used to control communications.
TxData Source: (#R1 to #R2048) Local register containing the first character of the string to be transmitted.
Tx no. bytes: (#R1 to #R2048 or 1 to 200) The number of bytes of the string to transmit. Can be specified as
a local register or a constant.
RxData destination: (#R1 to #R2048) First local register to begin storing the received string in.
Rx No. bytes (max): (#R1 to #R2048 or 0 to 250) Maximum number of bytes expected in the response. This
can be specified as a local register or a constant. Enter 0 if no reply is expected. If non-zero, after the Tx
message string has been sent, the RTU will wait for a reply. The RTU will stop waiting after the timeout
specified in the Network List has expired. If a local register is specified, the register will be updated after the
function has completed to correspond to the actual number of bytes received. Note: a maximum of 250 bytes
can be received on a processor port.
Status Register: (#R1 to #R2048 or Blank) If a register is specified, it will be updated with the status of the
Tx User function as follows:
Ch1: Waiting flag. Set ON when the block is activated and set OFF when the block is finished.
Ch2: Status flag. Written to after the block is finished. Set OFF if the update was successful or set ON if
the update failed (due to communications failure).
Use network registers ?: If this box is selected, the function will read and write to network registers for the
specified device instead of local registers. This applies to the Tx and Rx data strings, the number of bytes
and the status register.
Local link ?: If this box is selected, the function will send the messages to the local device. When using
PSTN, GSM, GPRS or similar communications, the Tx User message will be sent to the local modem itself.
Eg. Local Link is used when reading SMS messages from a GSM or sending other AT commands.