User manual
IEC61131 User and Reference Manual
April 22, 2008
606
Unprotected Write
The Unprotected Write function writes 16-bit values into any area of the I/O database of the
slave device. Access to the I/O database is limited to the unprotected address range of the
slave device. The data may come from any area of the master I/O database within its
unprotected address range.
Any number of 16-bit registers may be written up to the maximum number supported by the
slave device or the maximum number above, which ever is less. The write may start at any
16-bit register, provided the entire block is within the unprotected address range of the slave
device.
Sending Messages
A master message is initiated in two ways:
using the master_message function from a C application program; or
using the MSTR function block from a ladder logic program.
These functions specify the port on which to issue the command, the function code, the
slave station number, and the location and size of the data in the slave and master devices.
The protocol driver, independent of the application program, receives the response to the
command.
The application program detects the completion of the transaction by:
calling the get_protocol_status function in a C application program; or
using the output of the MSTR function block in a ladder logic program.
A communication error has occurred if the slave does not respond within the expected
maximum time for the complete command and response. The application program is
responsible for detecting this condition. When errors occur, it is recommended that the
application program retry several times before indicating a communication failure.
The completion time depends on the length of the message, the length of the response, the
number of transmitted bits per character, the transmission baud rate, and the maximum
message turn-around time. One to three seconds is usually sufficient. Radio systems may
require longer delays.