DAD Driver Software Integration Guide
DAD Driver Software Integration Guide
DAD/DRIVER
Fieldbus Master
Fieldbus Slave
Node #2
Fieldbus Slave
Node #3
Fieldbus Slave
Node #1
Fieldbus Communication
Datalogic S.r.l.
Via S. Vitalino, 13
40012 Calderara di Reno (BO)
Italy
Tel. +39 051 3147011
Fax +39 051 3147205
Disclaimer
Datalogic has taken reasonable measures to provide information in this manual that is complete and accu-
rate, however, Datalogic shall not be liable for technical or editorial errors or omissions contained herein,
nor for incidental or consequential damages resulting from the use of this material. Datalogic reserves the
right to change any specification at any time without prior notice.
Trademarks
Datalogic and the Datalogic logo are registered trademarks of Datalogic S.p.A. in many countries, including
the U.S.A. and the E.U.
All other trademarks and brands are property their respective owners.
Patents
See [Link] for patent list.
TABLE OF CONTENTS
CHAPTER 1. INTRODUCTION..................................................................................... 1
About this Manual ............................................................................................................ 1
Manual Conventions ............................................................................................................................1
Technical Support ............................................................................................................ 1
Support Through the Website .............................................................................................................1
Reseller Technical Support .................................................................................................................1
Manual Conventions
The following conventions are used in this document:
The symbols listed below are used in this manual to notify the device of key issues or
procedures that must be observed when using the device:
TECHNICAL SUPPORT
INTEGRATION GUIDE 1
CHAPTER 2
FIELDBUS COMMUNICATION
DATA EXCHANGE
The Fieldbus Master is usually a PLC. Sometimes it could be a PC-based device as well.
The Datalogic device is always a Slave in the Fieldbus network.
Fieldbus Master
Fieldbus Slave
Node #2
Fieldbus Slave
Node #3
Fieldbus Slave
Node #1
Basically, two shared memory areas (Exchange Areas) exist between SLAVE and MASTER
so both devices provide information to each other. Exchange areas are physically placed
in the Fieldbus device inside the SLAVE.
Input and output areas always refer to the Master: this means that the slave writes to
the Input buffer and the PLC writes to the Output buffer.
Dimensions of exchange areas can be set to different values by the PLC through the spe-
cific Fieldbus Configuration file (i.e. GSD file for Profibus) or by the slave's configuration
program.
The reserved bytes are used to implement many different features, such as:
• Flow-control and corresponding buffering in both directions
• Fragmentation and reassembling of data longer than the exchange area sizes
• Synchronization of flow control numbers
• Service Access Point oriented communication
• Length information
NOTE: If the Datalogic Flow Control is disabled, all the bytes of the
exchange areas are used by the application layer. The input area is updated
whenever a new reading event has to be transferred to the Master station.
• In this situation, the Master must read the input area before it changes due to a
new message, typically new barcode occurrence.
• Moreover, two occurrences of the same barcode cannot be understood, since the
input area does not change.
• In addition, if application data is longer than input area sizes, data is automatically
truncated.
FCM can be selected by means of the Data Flow Control parameter.
INTEGRATION GUIDE 3
FIELDBUS COMMUNICATION
From now the Input Area will be referred to as a buffer made up of InputAreaSize bytes:
IN[0] IN[1] IN[2] ... IN[InputAreaSize - 1]
Only the first three bytes are used by the DAD Driver layer in both buffers:
Control Field Used to issue and control the driver primitives such as flow-
(byte 0) control, fragmentation and resynchronization.
Used to distinguish among different services and to provide
Service Access Point Field future expandability. (Since this SAP definition is introduced
(byte 1) by the DAD Driver, it must not be confused with the SAP that
is defined by the international standard).
Contains the number of bytes used by the application layer:
Length Field (see also note below)
(byte 2) Length Field ≤ (InputAreaSize - 3) for the Input Area
Length Field ≤ (OutputAreaSize - 3) for the Output Area.
INTEGRATION GUIDE 5
FCM WITH DAD DRIVER
NOTE: If Data Consistency is enabled, then the last byte is used for packet
integrity and therefore the bytes available to the application are reduced by
1. See Chapter 4, Data Consistency for details.
The Application Data buffer holds useful information, typically the barcode messages,
processed by the application program. IN[3] contains the first significant byte of the
Application Data buffer (the same first byte you would see if the device transmitted the
barcode buffer onto a serial port instead of the Fieldbus interface).
The structure of the application buffer and its length strictly depend on the selected
data format on the device. Barcode messages longer than (InputAreaSize - 3) will be
split in pieces through an automatic fragmentation process (see "Fragmentation and
Reassembling" on page 13).
CONTROL FIELD
This is the core of the flow-controlled communication.
The Input Area structure reserves bit 0 and bit 1 of IN[0] for handshake purposes while
the Output Area structure, which is symmetrical, reserves bit 0 and 1 of OUT[0].
At any time, the Master station can make a resynchronization request by means of bit 2
of the Output Area. This process, which resets the synchronization numbers (bit 0 and
bit 1 of both Input and Output areas), has to be acknowledged by the Slave on bit 2 of
the Input Area.
Bit 3 is used to control a fragmentation sequence in both directions.
Bit 7 is always set to 1.
SAP FIELD
SAP (Service Access Point) is an identifier that is used to implement multiple services
sharing the same communication channel between two remote stations.
The following values have been defined:
SAP = 0 Used to transfer information messages between the device and the PLC
SAP = 255 Reserved for driver services (see details in paragraph 2.8)
All other SAP values are free, and they could be used by dedicated application programs
after agreement between the application programs themselves.
INTEGRATION GUIDE 7
FCM WITH DAD DRIVER
LENGTH FIELD
The Application layer uses all or a part of the remaining bytes of the Exchange Area buf-
fers that are not used by the DAD Driver. The Length Field is introduced to keep the
information of how many bytes are really used by the Application Layer.
A fragment that is not the last one of a fragmentation sequence must fill this field with
[InputAreaSize - 3] (or [OutputAreaSize - 3]), depending on whether it is an Input or an
Output fragment. Otherwise this field gets a value that is less than or equal to [InputAr-
eaSize - 3].
• IN[0].bit0 [ A ] is used by the device to notify that “Slave has written a new data so
Master can read it”
• OUT[0].bit0 [ B ] must be used by PLC to notify that “Master has read last data so
Slave can send next message”
This happens each time bit A (or B) changes its state (toggles). Bit level doesn't matter,
only the transition has to be considered.
The following state machine shows data transmission from Slave to Master. Please note
that each cycle transfers two data messages.
1. After power-on, Input and Output areas are generally filled by zero. According to
DAD driver implementation, Input area has Control Field = 80Hex and SAP = 00Hex.
2. PLC must also set the Control Field of Output area properly, as long as DAD mes-
saging protocol is used.
Input 80Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area
3. The device reads a barcode "01234567". Let's assume standard data formatting
with <CR> as terminator. The device toggles bit A.
Input 81He
00Hex
09He 30He 31He 32He 33He 34He 35He 36He 37He 0DHe
00Hex 00Hex 00Hex 00Hex
Area x x x x x x x x x x x
INTEGRATION GUIDE 9
FCM WITH DAD DRIVER
4. PLC detects transition of bit A so now it can read incoming data (it copies 9 bytes
in its memory from IN[3] on) then toggles bit B as acknowledge.
NOTE: Before the acknowledge, all further barcodes read by the device are
buffered.
Input 81Hex 00Hex 09Hex 30Hex 31Hex 32Hex 33Hex 34Hex 35Hex 36Hex 37Hex
0DHe
00Hex 00Hex 00Hex 00Hex
Area x
Output 81He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x
Input 80He
00Hex 5Hex 31Hex 30Hex 44Hex
4CHe 0DHe
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x x x
6. PLC reads new data message (it copies 7 bytes in its memory from IN[3] on) then
toggles bit B as acknowledge.
Output 80He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x
Input 81He
00Hex 04Hex 41Hex 42Hex 43Hex
0DHe
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x x
8. PLC reads new data message (it copies 4 bytes in its memory from IN[3] on) then
toggles bit B as acknowledge.
Output 81He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x
• OUT[0].bit1 [ C ] must be used by PLC to notify that "Master has written new data
so Slave can read it"
• IN[0].bit1 [ D ] is used by the device to notify that "Slave has read data so Master
can send next message"
This happens each time bit C (or D) changes its state (toggles). Bit level doesn't matter,
only the transition has to be considered.
The following state machine shows data transmission from Master to Slave. Please note
that each cycle transfers two data messages.
INTEGRATION GUIDE 11
FCM WITH DAD DRIVER
RESYNCHRONIZATION
The resynchronization process restarts the messaging protocol from a predefined state.
It may be used either at the Master startup to detect if the Slave is on line or during nor-
mal operations in case of errors requiring a protocol reset procedure.
The process is based on bit two:
The following state machine shows the resynchronization cycle, requested by the PLC
and performed together with the device:
Let's analyze the resynchronization process, starting from the previous data exchange
discussed in "Data Transmission from the device to PLC"…
Output 85He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x
2. The device detects the request and so it resets IN[0].bit0 and IN[0].bit1. Then it
gives an acknowledge back to the PLC by means of bit F.
Input 84He
00Hex 04Hex 41Hex 42Hex 43Hex
0DHe
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x x
3. PLC has to reset OUT[0].bit0 and OUT[0].bit1 before completing its request with
bit E = 0.
Output 80He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x
Input 80He
00Hex 04Hex 41Hex 42Hex 43Hex
0DHe
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x x
5. Now Flow Control has been returned to a predefined state. All data exchange bits
in the Control Field are surely zero and data transmission can proceed safely.
INTEGRATION GUIDE 13
FCM WITH DAD DRIVER
More Bit = 0 indicates that all the information is included within the current message.
When Application Data is longer than (exchange area size - 3), the first partial message
is transmitted having More Bit = 1. Following fragments keep More Bit = 1 and only the
last piece will have More Bit = 0 again. Thanks to this mechanism, the receiver station
may detect the last piece and so reassemble the entire information.
Some notes:
• Intermediate fragments have Length Field = (exchange area size - 3)
• Last fragment has Length Field ≤ (exchange area size - 3)
• Bit0 and Bit1 of both Input and Output areas are independently managed for any
fragment
The following figures show how the Control Byte changes according to the fragmenta-
tion process. Both data flow directions are considered.
1. After power-on, Input and Output areas are generally filled by zero. According to
DAD driver implementation, Input area has Control Field = 80Hex and SAP = 00Hex.
2. PLC must also set the Control Field of Output area properly, as long as DAD mes-
saging protocol is used.
Input 80Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area
Input 89He
00Hex
0DHe 30He 31He 32He 33He 34He 35He 36He 37He 38He 39He 30He 61He 62He
Area x x x x x x x x x x x x x x x
4. PLC detects transition of bit A so now it can read first incoming fragment (it copies
13 bytes in its memory from IN[3] on) then toggles bit B as acknowledge.
Output 81He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x
Input 88He
00Hex
0DHe 63He 64He 65He 31He 32He 33He 34He 35He 36He 37He 38He 39He 30He
Area x x x x x x x x x x x x x x x
6. PLC reads second fragment (it copies 13 bytes in its memory from IN[3] on) then
toggles bit B as acknowledge.
Output 80He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x
7. The device sends third (last) fragment "abcde<CR><LF>" (finally More Bit = 0) and
toggles bit A.
Input 81He
00Hex
06He 61He 62He 63He 64He 65He 0DHe 00He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x x x x x x x x x
INTEGRATION GUIDE 15
FCM WITH DAD DRIVER
8. PLC reads last fragment (it copies 7 bytes in its memory from IN[3] on) and now
the reassembling can be completed. Then it toggles bit B as acknowledge.
Output 81He
00Hex 00Hex 00Hex 00Hex 00Hex 00Hex 00Hex
Area x
SAP SERVICES
When SAP = 255, the FLUSH QUEUE is the unique driver service currently available. It
performs flushing of the internal queues and may be issued at any time.
FLUSH QUEUE SERVICE
Request Flush data buffers (issued by the Master station to the device)
Action Flush all information from previous decoding phases
Command accepted/rejected (generated by the device toward the
Response
Master).
Application data areas must be formatted as follows:
From the practical point of view, a complete message in the Input area could be consid-
ered consistent as soon as the PLC verifies that IN[0] is equal to IN[InputAreaSize - 1].
The PLC should take care to double OUT[0] in OUT[OutputAreaSize - 1] to let the driver
check the consistency.
Due to the new byte used by the DAD driver, barcode messages longer than (InputArea-
Size - 4) will be split into pieces through an automatic fragmentation process.
INTEGRATION GUIDE 18
DATA CONSISTENCY
1. After power-on, Input and Output areas are generally filled by zero. According to
DAD driver implementation, Input area has Control Field = IN[0] = IN[15] = 80Hex
and SAP = 00Hex.
2. PLC must set Control Field = OUT[0] = OUT[7] = 80Hex according to DAD messag-
ing protocol with Data Consistency.
Input 80He 00He 00He 00He 00He 00He 00He 00He 00He 00He 00He 00He 00He 00He 00He 80He
Area x x x x x x x x x x x x x x x x
Input 89Hex
00He 0CHe
30Hex 31Hex 32Hex 33Hex 34Hex 35Hex 36Hex 37Hex 38Hex 39Hex 30Hex 61Hex 89Hex
Area x x
4. PLC detects transition of bit A so now it can read first incoming fragment (it copies
12 bytes in its memory from IN[3] on) then toggles bit B as acknowledge.
Input 89He 00He 0CHe 30He 31He 32He 33He 34He 35He 36He 37He 38He 39He 30He 61He 89He
Area x x x x x x x x x x x x x x x x
Output 81Hex
00He 00He 00He 00He 00He 00He
81Hex
Area x x x x x x
Input 88Hex
00He 0CHe
62Hex 63Hex 64Hex 65Hex 31Hex 32Hex 33Hex 34Hex 35Hex 36Hex 37Hex 38Hex 88Hex
Area x x
6. PLC reads second fragment (it copies 12 bytes in its memory from IN[3] on) then
toggles bit B as acknowledge.
Input 88He 00He 0CHe 62He 63He 64He 65He 31He 32He 33He 34He 35He 36He 37He 38He 88He
Area x x x x x x x x x x x x x x x x
Output 80Hex
00He 00He 00He 00He 00He 00He
80Hex
Area x x x x x x
7. Slave sends last fragment "90abcde<CR><LF>" (finally More Bit = 0) and toggles bit
A.
Input 81Hex
00He
08Hex 39Hex 30Hex 61Hex 62Hex 63Hex 64Hex 65Hex
0DHe
00Hex
00He 00He 00He
81Hex
Area x x x x x
8. PLC reads last fragment (it copies 9 bytes in its memory from IN[3] on) and now
the reassembling can be completed. Then it toggles bit B as acknowledge.
Input 81He 00He 08He 39He 30He 61He 62He 63He 64He 65He 0DHe 00He 00He 00He 00He 81He
Area x x x x x x x x x x x x x x x x
Output 81Hex
00He 00He 00He 00He 00He 00He
81Hex
Area x x x x x x
INTEGRATION GUIDE 20
CHAPTER 5
NETWORK CONFIGURATION
NOTE: A configuration file must first be installed into the PLC environment
in order for a new device to be identified and to work on the Fieldbus net-
work.
The Fieldbus configuration files (EDS and GSDML) are found on the specific product
page under "Downloads>Software & Utilities". See [Link].
The Fieldbus configuration file is a certified part of the device and must not be changed
manually. This file is also not changed by the configuration tool.
NOTES
INTEGRATION GUIDE 22
© 2023 Datalogic S.p.A. and /or its affiliates • All rights reserved • Without limiting
the rights under copyright, no part of this documentation may be reproduced,
stored in or introduced into a retrieval system, or transmitted in any form or by any
means, or for any purpose, without the express written permission of Datalogic
S.p.A. and/or its affiliates • Datalogic and the Datalogic logo are registered trade-
marks of Datalogic S.p.A. in many countries, including the U.S. and the E.U.
[Link]
Datalogic S.r.l.
Via S. Vitalino, 13 | 40012 Calderara di Reno | Bologna - Italy
Tel. +39 051 3147011 | Fax +39 051 3147205
June 2023