Modbus TCP Interface Model
This section describes the interface to the DataMan reader as seen by the PLC via Modbus TCP. The interface model consists of 6 data blocks grouped in 3 logical pairs:
- Control and Status
- Input Data and Output Data
- String Command and String Response
Control Block
The Control block contains bit type data. This block consists of the control signals sent from the PLC to the reader. It is used by the PLC to initiate actions and acknowledge certain data transfers.
| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
| Reserved | Results Ack |
Buffer Results Enable |
Trigger |
Trigger Enable |
|||
| Bit 15 | Bit 14 | Bit 13 | Bit 12 | Bit 11 | Bit 10 | Bit 9 | Bit 8 |
| Reserved | |||||||
| Bit 23 | Bit 22 | Bit 21 | Bit 20 | Bit 19 | Bit 18 | Bit 17 | Bit 16 |
| Reserved |
Initiate String Cmd |
Set User Data |
|||||
| Bit 31 | Bit 30 | Bit 29 | Bit 28 | Bit 27 | Bit 26 | Bit 25 | Bit 24 |
| SoftEvent 7 | SoftEvent 6 | SoftEvent 5 | SoftEvent 4 | SoftEvent 3 | SoftEvent 2 | SoftEvent 1 | SoftEvent 0 |
Control Block Field Descriptions
| Bit | Name |
Description |
| 0 | Trigger Enable | This field is set to enable triggering via the Trigger bit. Clear this field to disable the network triggering mechanism. |
| 1 | Trigger | Setting this bit triggers an acquisition. Note that the Trigger Ready bit must be set high before triggering an acquisition. |
| 2 | Buffer Results Enable | When this bit is set, each read result (ResultID, ResultCode, ResultLength and ResultData fields) will be held in the Output Block until it is acknowledged. Once acknowledged, the next set of read results will be made available from the buffer. If new read results arrive before the earlier set is acknowledged the new set will be queued in the reader’s buffer. The reader can buffer up to 50 and the Base Station can buffer up to 500 sets of read results. See Operation for a description of the acknowledgement handshake sequence. |
| 3 | ResultsAck | Set by the PLC to acknowledge that it has received the latest results (ResultID, ResultCode, ResultLength and ResultData fields). When the reader sees this bit transition from 0 to 1 it clears the ResultsAvailable bit. This forms a logical handshake between the PLC and reader. If result buffering is enabled, the acknowledgement will cause the next set of queued results to be moved from the buffer. See section Operation for a description of the acknowledgement handshake sequence. |
| 4-15 | Reserved | Future use |
| 16 | SetUserData | Set by the PLC to signal that new UserData is available. After reading the new UserData the reader sets SetUserDataAck to signal that the transfer is complete. This forms a logical handshake between the PLC and reader. |
| 17 | Initiate StringCmd | Set by the PLC to signal that a new StringCommand is available. After processing the command, the reader sets StringCmdAck to signal that the command result is available. This forms a logical handshake between the PLC and reader. |
| 18-23 | Reserved | Future use |
| 24-31 | SoftEvents |
Bits act as virtual discrete inputs. When a bit transitions from 0 -> 1 the associated action is executed. After executing the action the reader sets the corresponding SoftEventAck to signal that the action is complete. This forms a logical handshake between the PLC and reader. Bit0: Train code Bit1: Train match string Bit2: Train focus Bit3: Train brightness Bit4: Un-Train Bit5: Reserved (future use) Bit6: Execute DMCC command Bit7: Set match string |
Status Block
The status block contains bit type data. This block consists of the status signals sent from the reader to the PLC. It is used by the reader to signal status and handshake certain data transfers.
| Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
| Reserved |
Missed Acq |
Acquiring |
Trigger Ack |
Trigger Ready |
|||
| Bit 15 | Bit 14 | Bit 13 | Bit 12 | Bit 11 | Bit 10 | Bit 9 | Bit 8 |
|
General Fault |
Reserved | Results Available |
Results Buffer Overrun |
Decode Complete Toggle |
Decoding | ||
| Bit 23 | Bit 22 | Bit 21 | Bit 20 | Bit 19 | Bit 18 | Bit 17 | Bit 16 |
| Reserved |
String Cmd Ack |
Set User Data Ack |
|||||
| Bit 31 | Bit 30 | Bit 29 | Bit 28 | Bit 27 | Bit 26 | Bit 25 | Bit 24 |
|
SoftEvent Ack 7 |
SoftEvent Ack 6 | SoftEvent Ack 5 | SoftEvent Ack 4 |
SoftEvent Ack3 |
SoftEvent Ack 2 |
SoftEvent Ack 1 |
SoftEvent Ack 0 |
Status Block Field Descriptions
| Bit | Name | Description |
| 0 | Trigger Ready | Indicates when the reader is ready to accept a new Trigger. The reader sets this bit when TriggerEnable has been set and the reader is ready to accept a new trigger. |
| 1 | TriggerAck | Indicates when the reader recognizes that Trigger has been set. This bit will remain set until the Trigger bit has been cleared. |
| 2 |
Acquiring |
Set to indicate that the reader is in the process of acquiring an image.
|
| 3 | Missed Acq | Indicates that the reader missed a requested acquisition trigger. The bit is cleared when the next acquisition is issued. |
| 4-7 | Reserved | Future use |
| 8 | Decoding | Deprecated. The value of the Decoding bit is always the same as the Acquiring bit. |
| 9 |
Decode Complete Toggle |
Indicates new result data is available. Bit toggles state (0 -> 1 or 1 -> 0) each time new result data becomes available. |
| 10 |
Results Buffer Overrun |
Set to indicate that the reader has discarded a set of read results because the PLC has not acknowledged the earlier results. Cleared when the next set of result data is successfully queued in the buffer. This bit only has meaning if result buffering is enabled. |
| 11 | Results Available | Set to indicate that new result data is available. Bit will remain set until acknowledged with ResultsAck even if additional new read results become available. |
| 12-14 | Reserved | Future use |
| 15 |
General Fault |
Set to indicate that an Ethernet communications fault has occurred. Currently only used by SoftEvent operations. Bit will remain set until the next successful SoftEvent or until TriggerEnable is set low and then high again. |
| 16 | Set User Data Ack | Set to indicate that the reader has received new UserData. Bit will remain set until the corresponding SetUserData bit is cleared. This forms a logical handshake between the PLC and reader. |
| 17 |
String Cmd Ack |
Set to indicate that the reader has completed processing the latest string command and that the command response is available. Bit will remain set until the corresponding InitiateStringCmd bit is cleared. This forms a logical handshake between the PLC and reader. |
| 18-23 | Reserved | Future use |
| 24-31 |
SoftEvent Ack |
Set to indicate that the reader has completed the SoftEvent action. Bit will remain set until the corresponding SoftEvent bit is cleared. This forms a logical handshake between the PLC and reader. Bit0: Ack train code Bit1: Ack train match string Bit2: Ack train focus Bit3: Ack train brightness Bit4: Ack untrain Bit5: Reserved (future use) Bit6: Ack Execute DMCC command Bit7: Ack set match string |
Input Data Block
The Input Data block is sent from the PLC to the reader. The block consists of user defined data that may be used as input to the acquisition/decode operation.
| Word 0 | Word 1 | Word 2..N |
| User Data Option | User Data Length | User Data |
Input Data Block Field Descriptions
| Word | Name | Description |
| 0 | User Data Option |
Optional user data information. Currently only used by “Set Match String” SoftEvent. Specifies which code target to assign the string (16-bit Integer). Bit0: Assign string to all targets Bit1: Assign string to 2D codes Bit2: Assign string to QR codes Bit3: Assign string to 1D/stacked/postal codes |
| 1 | User Data Length | Number of bytes of valid data actually contained in the UserData field. |
| 2..N | User Data | User defined data that may be used as an input to the acquisition/decode. |
Output Data Block
The Output Data block is sent from the reader to the PLC. The block consists primarily of read result data.
| Word 0 | Word 1 | Word 2 | Word 3 | Word 4 | Word 5...n |
| Reserved | Trigger ID | Result ID | Result Code | Result Length | Result Data |
Output Data Block Field Descriptions
| Word | Name | Description |
| 0 | Reserved | Future use |
| 1 | Trigger ID | Trigger identifier. Identifier of the next trigger to be issued. Used to match issued triggers with result data that is received later. This same value will be returned as the ResultID of the corresponding read. |
| 2 | Result ID | Result identifier. This is the value of TriggerID when the corresponding trigger was issued. Used to match up triggers with corresponding result data. |
| 3 | Result Code |
Indicates the success or failure of the read that produced this result set. Bit0: 1=Read, 0=No read Bit1: 1=Validated, 0=Not Validated Bit2: 1=Verified, 0=Not Verified Bit3: 1=Acquisition trigger overrun Bit4: 1=Acquisition buffer overrun Bit5: Reserved Bit 6: 1=result is a DMCC response, 0=result is a read result. For more information, see DMCC Result Feedback from PLC. Bit7-15: Reserved (future use) |
| 4 |
Result Data Length |
Number of bytes of valid data actually in the ResultData field. |
| 5...n | Result Data | Result data from this acquisition/decode. Formatted as ASCII text with two characters per 16-bit register. No terminating null character. |
String Command Block
The String Command block is sent from the PLC to the reader. The block is used to transport string based commands (DMCC) to the reader.
| Word 0 | Word 1...n |
| Length | String Command |
String Command Block Field Descriptions
| Word | Name | Description |
| 0 | Length | Number of bytes of valid data in the StringCommand field. |
| 1..N |
String Command |
ASCII text string containing the command to execute. No null termination required. |
String Command Result Block
The String Command Result block is sent from the reader to the PLC. The block is used to transport the response from string based commands (DMCC) to the PLC.
| Word 0 | Word 1 | Word 2..N |
|
Result Code |
Length | String Command Result |
String Command Result Block Field Descriptions
| Word | Name | Description |
| 0 | Result Code | Code value indicating the success or failure of the command. Refer to the Command Reference, available through the Windows Start menu or the DataMan Setup Tool Help menu, for specific values. |
| 1 | Length | Number of bytes of valid data in the StringCommand field. |
| 2..N |
String Command Result |
ASCII text string containing the command to execute. No null termination required. |