KUNBUS-COM EtherCAT
35 / 135
the associated command code. The mask byte only makes it
possible to write single bits to the target register. Thereby, only bits
that are set to "1" in the mask are transferred from the data byte (i.e.
these bits are set to the value as found in the data byte). All other bits
are left unchanged in the register.
During transmission of this first block, the module sends the status of
the previous data transmission. The module first returns the status
for the previous access when sending the next transmission block. If,
however, no further write or read operation should follow the write
access, then the Master must send another transmission block with
the command code 0 ("NO_OPERATION") for retrieving the status,
in which the module returns the status for the last write access
operation.
The status response from the module is structured as follows for all
write access types:
Transmission block with fixed length
Status code
(1 byte)
Error code
(2 bytes)
Not used
(2 bytes)
Description
0x00
0xXXXX
0xXXXX
NO_PREVIOUS_OPERATION
0x01
0x0000
0xXXXX
WRITE_SUCCESS
0x02
ERROR_CODE
1
0xXXXX
WRITE_FAILURE
1
See Table "ErrorCode"
The first byte returns the status. If it is set to "0", the Master then
indicates that it cannot return any current status information since
there was no previous operation (this is usually the response to the
very first block transmission). A "1" indicates the successful
completion of the previous transmission. In the case of a 2, the
module sends the error code of an error in the subsequent byte,
which occurred during the previous block transmission. The possible
error codes are listed at the end of this subsection.
Writing 2 bytes (Word)
This access type basically proceeds as when writing 1 byte. It differs
in the following points:
– Instead of a mask byte, the second byte of the 16-bit wide user data is
transmitted with the data block. Access to individual bits in the target
register is not possible with this access type.
– The 16-bit wide register content to be written must be prepared by the
Master in such a way that the higher-value byte is transmitted as the 4th
byte and the lower-value byte is transmitted as the 5th byte ("Big-
Endian" or "Motorola format").
Components