Industrial Protocols Manual
Industrial Protocols Manual
Protocols Manual
2021 May 28
Revision: 6.3.0.14
                                                                                                         Legal Notices
Legal Notices
The software described in this document is furnished under license, and may be used or copied only in accordance with
the terms of such license and with the inclusion of the copyright notice shown on this page. Neither the software, this
document, nor any copies thereof may be provided to, or otherwise made available to, anyone other than the licensee.
Title to, and ownership of, this software remains with Cognex Corporation or its licensor. Cognex Corporation assumes
no responsibility for the use or reliability of its software on equipment that is not supplied by Cognex Corporation.
Cognex Corporation makes no warranties, either express or implied, regarding the described software, its
merchantability, non-infringement or its fitness for any particular purpose.
The information in this document is subject to change without notice and should not be construed as a commitment by
Cognex Corporation. Cognex Corporation is not responsible for any errors that may be present in either this document or
the associated software.
Companies, names, and data used in examples herein are fictitious unless otherwise noted. No part of this document
may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, nor
transferred to any other media or language without the written permission of Cognex Corporation.
Copyright © 2020. Cognex Corporation. All Rights Reserved.
Portions of the hardware and software provided by Cognex may be covered by one or more U.S. and foreign patents, as
well as pending U.S. and foreign patents listed on the Cognex web site at: cognex.com/patents.
Other product and company trademarks identified herein are the trademarks of their respective owners.
                                                             2
                                                         Table of Contents
Table of Contents
 Legal Notices                                                         2
 Table of Contents                                                     3
 Symbols                                                               5
 About This Manual                                                     6
 Industrial Network Protocols                                          7
  EtherNet/IP                                                          7
    DMCC                                                               7
    Reader Configuration Code                                          8
    Setup Tool                                                         8
    Getting Started                                                    9
    Object Model                                                      13
    Rockwell ControlLogix Examples                                    25
    Rockwell CompactLogix Examples                                    38
  PROFINET                                                            51
    DMCC                                                              51
    Reader Configuration Code                                         51
    Setup Tool                                                        52
    Getting Started                                                   52
    Object Model                                                      56
    SIMATIC Examples                                                  64
    TIA Portal Examples                                               76
    DataMan 370/470 and 8700 v6.1.8 – PROFINET Class B                85
  iQ Sensor Solution                                                  87
    DMCC                                                              88
    Reader Configuration Code                                         88
    Setup Tool                                                        89
    Overview                                                          89
    Discovering DataMan Readers on GX Work2                           89
    Monitoring the status of the DataMan Reader                       90
  CC-Link IE Field Basic                                              91
    DMCC                                                              91
    Reader Configuration Code                                         92
    Setup Tool                                                        92
    Modules                                                           92
  SLMP Protocol                                                       97
    DMCC                                                              97
    Reader Configuration Code                                         97
    SLMP Protocol Scanner                                             98
    Getting Started                                                   98
    Network Configuration                                            100
    Data Block Configuration                                         100
    Interface                                                        101
    Operation                                                        106
    Examples                                                         110
                                              3
                                                Table of Contents
 ModbusTCP                                                  114
  DMCC                                                      114
  Reader Configuration Code                                 114
  Setup Tool                                                115
  Modbus TCP Handler                                        115
  Getting Started                                           115
  Network Configuration                                     116
  Data Block Configuration                                  117
  Interface                                                 118
  Operation                                                 123
  Examples                                                  127
Industrial Protocols for the Wireless DataMan              131
 Protocol Operation                                         131
   Ethernet Address                                         131
   PLC Triggering                                           131
   SoftEvents                                               131
   DMCC                                                     131
 Offline Buffering                                          132
 Status of Industrial Protocols                             132
                                       4
                                                                                                             Symbols
Symbols
The following symbols indicate safety precautions and supplemental information:
WARNING: This symbol indicates a hazard that could cause death, serious personal injury or electrical shock.
CAUTION: This symbol indicates a hazard that could result in property damage.
Tip: This symbol indicates suggestions and shortcuts that might not otherwise be apparent.
                                                           5
                                                                                                 About This Manual
The DataMan Industrial Protocols Manual provides information on how to integrate DataMan readers into your particular
environment using industrial protocols.
                                                            6
                                                                                           Industrial Network Protocols
EtherNet/IP
DataMan supports EtherNet/IP™, an application level protocol based on the Common Industrial Protocol (CIP).
EtherNet/IP provides an extensive range of messaging options and services transferring data and I/O over Ethernet. All
devices on an EtherNet/IP network present their data to the network as a series of data values called attributes. Attributes
can be grouped with other related data values into sets called Assemblies.
By default the DataMan device has the EtherNet/IP protocol disabled. The protocol can be enabled via DMCC, scanning
a configuration code, or in the DataMan Setup Tool.
    Note: If you have a wireless DataMan reader, see section Industrial Protocols for the Wireless DataMan on
    page 131
DMCC
The following commands can be used to enable/disable EtherNet/IP on a DataMan reader. The commands can be
issued via RS-232 or Telnet connection.
Note: Use a third party Telnet client such as PuTTY to communicate with your DataMan reader.
Enable:
                                                             7
                                                                                        Industrial Network Protocols
      ||>SET ETHERNET-IP.ENABLED ON
      ||>CONFIG.SAVE
      ||>REBOOT
Disable:
Note: You must reboot the device for the change to take effect.
Enable: Disable:
Scan the following reader configuration codes to enable/disable EtherNet/IP on your DataMan 8000 base station.
Note: You must reboot the device for the change to take effect.
Enable: Disable:
Setup Tool
In the Setup Tool's Communications application step's Ethernet tab, check EtherNet/IP to enable this industrial
protocol.
                                                            8
                                                                                        Industrial Network Protocols
Make sure to save the new selection by clicking the Save Settings button in the upper toolbar before disconnecting from
the reader.
Note: The new settings take effect only after the reader is rebooted.
Getting Started
Perform these steps to start using EtherNet/IP:
   1. Make sure that you select the Add-on Profile (AOP) installation and the Samples installation. The Add-on Profile
      is only used with Rockwell ControlLogix or CompactLogix PLCs.
   2. Install the Rockwell Add-on Profiles by navigating to the following directory on Cognex.com:
      https://support.cognex.com/en/downloads/dataman/software-firmware.
                                                             9
                                                                                      Industrial Network Protocols
3. In the search box, type Add-on Profile. Click the file and download it from the following page:
4. From the Start menu, go to Programs -> Rockwell Software -> EDS Hardware Installation Tool.
                                                       10
                                                                                            Industrial Network Protocols
Note: If you have an existing EDS file, uninstall it first, then install the latest version of the EDS.
6. Run the DataMan Setup Tool and update the DataMan firmware.
7. Check if the DataMan firmware is up-to-date by clicking, in the Setup Tool, View and then System Info.
                                                          11
                                                                                      Industrial Network Protocols
 9. In order for the changes to take effect, save your settings and cycle power. Go to System and click Save
    Settings.
10. Reboot your reader.
11. Your DataMan is visible now in the RSLinx.
                                                       12
                                                                                           Industrial Network Protocols
Note: If your DataMan is visible, but the icon is a question mark, repeat the EDS Installation.
12. Open one of the sample jobs and integrate your DataMan into your program using the Add-on Profile.
Object Model
The ID Reader Object is a vendor specific object class. This means that it is not part of the CIP common (public)
architecture but an extension. It is a custom object that Cognex has added to the EtherNet/IP architecture on the
DataMan device. All the data and functionality of this object model are available in the DataMan reader. This includes
triggering, status, events, errors, and result data.
The ID Reader Object is identified by its vendor specific class code:
DataMan ID Reader Object Class Code: 0x79
Objects are made up of attributes (data) and services (functionality). These can be defined at the class level (common to
all instances of the class) or the instance level (unique to an individual instance). The CIP specification defines common
attributes and services that apply to all objects (often these are optional). Vendors may also define their own attributes
and services for their vendor specific classes.
                                                            13
                                                                                         Industrial Network Protocols
The ID Reader Object attributes and services can be individually accessed via explicit messaging. In addition, a number
of the ID Reader Object attributes are exposed in the DataMan assembly objects which allow them to be accessed as a
group via implicit messaging.
Attributes
The DataMan ID Reader Object (Class Code: 0x79) has the following attributes:
                                                          14
                                                                                              Industrial Network Protocols
SoftEvents
SoftEvents act as “virtual” inputs. When the value of a SoftEvent changes from 0 to 1, the action associated with the event
is executed. When it is done, the corresponding SoftEventAck bit changes from 1 to 0 to mark completion.
                                                           15
                                                                                                Industrial Network Protocols
The SoftEvent and SoftEventAck form a logical handshake. After SoftEventAck changes to 1 the original SoftEvent is set
back to 0. When that occurs, SoftEventAck is automatically set back to 0.
The “ExecuteDMCC” and “SetMatchString” SoftEvent actions require user supplied data. This data must be written to the
UserData and UserDataLength area of the Input Assembly prior to invoking the SoftEvent. Since both of these SoftEvents
depend on the UserData, only one can be invoked at a time.
General Fault Indicator
When a communication related fault occurs, the “GeneralFault” bit changes from 0 to 1. The only fault conditions
supported are SoftEvent operations. If a SoftEvent operation fails, the fault bit will be set. The fault bit remains set until
either the next successful SoftEvent operation or until TriggerEnable is set to 0 and then back to 1.
Services
The ID Reader Object supports the following Common CIP services:
Acquire Service
The Acquire Service triggers an acquisition (if the acquisition system is ready to acquire an image). If the acquisition
could not be triggered, then the Missed Acquisition bit of the AcqStatusRegister will be set until the next successful
acquisition.
SendDMCC Service
The SendDMCC Service sends a DMCC command string to the device. The request data consists of the DMCC
command string that is to be sent to the reader. The reply data will contain the string result of the DMCC command.
Additionally, the service provides a numeric result status for the call. Most of these result codes relate to the basic
success/failure of the service execution. However, the service also maps the actual DMCC status codes. This allows the
PLC to interpret the service request without having to parse the actual DMCC return string.
                                                               16
                                                                                                 Industrial Network Protocols
DMCC commands transferred through the Industrial Ethernet protocols are automatically routed to the Wi-Fi reader. The
commands cannot be executed while the Wi-Fi reader is powered off, hibernating, or out-of-range.
    Note: The DMCC command string must be in the CIP STRING2 format (16-bit integer indicating the string length in
    characters followed by the actual string characters, no terminating null required).
GetDecodeResults Service
The GetDecodeResults service reads data from the DecodeResults attribute of the ID Reader Object. This service takes
parameters indicating the “size” (number of bytes to read) and the “offset” (offset into the DecodeResults attribute to
begin reading). This gives the service the flexibility to be used with PLCs that have different restrictions on the amount of
data allowed in an explicit message. It also allows you to access very large codes that cannot be completely transferred
with implicit messaging (assembly object).
Acquisition Sequence
DataMan can be triggered to acquire images by several methods. It can be done either implicitly through the Assembly
object, or done explicitly through the ID Reader object. When using explicit messaging, you can either:
The ID Reader attributes are discussed in this section. These same values can also be accessed through the assembly
objects. On startup, the AcqTriggerEnable attribute is False. Set the attribute to True to enable triggering. When the
device is ready to accept triggers, the Trigger Ready bit in the AcqStatusRegister is set to True.
While the AcqStatusRegister “Trigger Ready” bit is True, each time the ID Reader object sees the AcqTrigger attribute
change from 0 to 1, it initiates an image acquisition. When setting the Trigger Ready bit to True through the assembly
objects, make sure that the attribute is held in the new state until that same state value is seen in the Trigger Ack bit of the
AcqStatusRegister (this is a necessary handshake to guarantee that the change is seen by the ID Reader object).
                                                               17
                                                                                             Industrial Network Protocols
During an acquisition, the Trigger Ready bit in the AcqStatusRegister is cleared and the Acquiring bit is set to True.
When the acquisition is completed, the Acquiring bit is cleared. The Trigger Ready bit is again set to True once the
device is ready to begin a new image acquisition.
If results buffering is enabled, the device will allow overlapped acquisition and decoding operations. Trigger Ready is set
high after acquisition is complete but while decoding is still in process. This can be used to achieve faster overall trigger
rates. If result buffering is not enabled, the Trigger Ready bit will remain low until both the acquisition and decode
operations have completed.
In certain cases, you can cancel an acquisition by clearing the Trigger signal before the read operation is finished. This
allows you to cancel reads in Presentation and Manual mode if no code is in the field of view. To ensure that a read is
not unintentionally cancelled, make sure that the PLC holds the Trigger signal True until both TriggerAck and
ResultsAvailable are True (or DecodeComplete toggles state).
To force a reset of the trigger mechanism, set the AcqTriggerEnable attribute to False until the AcqStatusRegister is 0.
Then the AcqTriggerEnable can be set to True to re-enable acquisition.
Behavior of DecodeStatusRegister
Bit Bit Name             Results if Buffering Disabled                           Results if Buffering Enabled
 1 Decoding Set when decoding an image.                            Set when decoding an image.
 2 Decode Toggled on completion of an image decode.                Toggled on completion of an image decode.
   Complete
                                                             18
                                                                                            Industrial Network Protocols
Results Buffering
There is an option to enable a queue for decode results. Enabling it allows a finite number of decode result data to
queue up until the client (PLC) has time to read them. This is useful to smooth out data flow if the client (PLC) slows
down for short periods of time.
If result buffering is enabled, the device will allow overlapped acquisition and decode operations. Depending on the
application this can be used to achieve faster overall trigger rates. See Acquisition Sequence description above for more
details.
If reads occur faster than results can be sent out, the primary difference between buffering or not buffering is determining
which results get discarded. If buffering is not enabled, the most recent results are kept and the earlier result (which was
not read by the PLC fast enough) is lost, because the more recent result will overwrite the earlier result. If buffering is
enabled (and the queue becomes full) the most recent results are discarded until space becomes available in the results
queue.
                                                            19
                                                                                         Industrial Network Protocols
    Note: If you have an overflowing queue and then disable buffering, there will be a greater than 1 difference
    between the TriggerID and ResultID values. This difference represents the number of reads that had occurred but
    could not be queued because the queue was full (number of lost reads equals TriggerID - ResultID - 1). After the
    next read, the ResultID value returns to the typical operating value of TriggerID - 1.
Assembly Object
Assemblies are combinations of selected attributes (data items) from CIP objects within a device. The device vendor
defines assemblies according to their needs and combine data together in useful groupings according to the
requirements of the application.
DataMan is an I/O adapter class device. The convention for adapters is that Input Assemblies produce (transmit) data for
another device (that is, DataMan to PLC) and Output Assemblies consume (receive) data from another device (that is,
PLC to DataMan). DataMan acts as an I/O module for another device such as a PLC.
Assembly objects use implicit messaging. They are blocks of data which are transmitted as the raw payload of implicit
messaging packets. These implicit messaging packets are produced (transmitted) repeatedly at a predefined chosen
rate (for example, 100ms or 200ms).
DataMan readers have a single input assembly and single output assembly. These assemblies combine selected
attributes (data) of the DataMan ID Reader Object into groupings that minimize network bandwidth, and still allow for
efficient control and processing. The data in these assemblies can also be accessed individually from the ID Reader
Object. However, using the assembly objects is much more efficient, thus they are the primary means of runtime
communication between a DataMan reader and a PLC.
Input Assembly
The Input assembly provides status information, process state, and decode results.
                                                           20
                                                                                             Industrial Network Protocols
 Instance Byte       Bit 7       Bit 6       Bit 5        Bit 4          Bit 3           Bit 2        Bit 1      Bit 0
    11       0                      Reserved                         Missed Acq        Acquiring   Trigger Ack Trigger
                                                                                                               Ready
             1     General                Reserved                     Results    Results Buffer    Decode     Decoding
                    Fault                                             Available     Overrun        Complete
                                                                                                    Toggle
             2     SoftEvent SoftEvent    SoftEvent     SoftEvent     SoftEvent        SoftEvent   SoftEvent   SoftEvent
                    Ack 7      Ack 6        Ack 5        Ack 4          Ack 3           Ack 2       Ack 1       Ack 0
            3-5                                                    Reserved
             6                                           Trigger ID (16-bit integer)
             7
             8                                            Result ID (16-bit integer)
             9
             10                                         Result Code (16-bit integer)
             11
             12                                       Result Extended (16-bit integer)
             13
             14                                      Result Data Length (16-bit integer)
             15
             16                                                   Result Data 0
             ...
            499                                               Result Data 483
Output Assembly
The Output assembly contains control signals, software event signals, and any user data required for the trigger and
decode.
                                                            21
                                                                                              Industrial Network Protocols
 Instance     Byte      Bit 7           Bit 6        Bit 5       Bit 4         Bit 3        Bit 2       Bit 1       Bit 0
     21           0                         Reserved                         Results       Buffer      Trigger     Trigger
                                                                              Ack         Results                  Enable
                                                                                          Enable
                  1   SoftEvent   SoftEvent        SoftEvent   SoftEvent    SoftEvent     SoftEvent   SoftEvent   SoftEvent
                          7           6                5           4            3             2           1           0
                         2                                                  Reserved
                         3
                         4                                     User Data Option (16-bit integer)
                         5
                         6                                     User Data Length (16-bit integer)
                         7
                         8                                                 User Data 0
                         ...
                        499                                              User Data 491
PCCC Object
DataMan has limited support for the Rockwell PCCC object. This allows legacy PLCs (PLC-5, SLC, and so on) to
communicate with DataMan using their native PCCC command set and explicit messaging. The PCCC object allows
DataMan to look like a Rockwell PLC-5 logic controller.
PCCC commands are organized to work with “data tables” that exist in legacy logic controllers. Each data table is an
array of a give data type (BYTE, INT, FLOAT, and so on). The commands are oriented to read/write one or more data
items of a given data table. Items are addressed by specifying the data table and the index of the item in the table
(indexes base from 0). For instance, to read the 6th integer in PLC data table, you need to send the PCCC command to
read N7:5. “N” specifies an integer table, “7” is the table number in the PLC (each table has a unique numeric identifier –
assigned when the user PLC program was created), and “5” is the index into the table (note indexes begin at 0).
The PCCC object in DataMan maps the read and write requests to ID Reader assemblies, or in one special case to the
DMCC service. Read commands return data from the Input assembly (instance 11). Write commands send data to the
Output assembly (instance 21). The implementation only supports an Integer data table (N7) and an ASCII data table
(A9). There is one special case of String data table (ST10:0) for DMCC.
The ResultCode value is located at word offset 5 (counting from 0) of the Input Assembly. To access this value, issue the
following PLC command:
                                                               22
                                                                                           Industrial Network Protocols
The decode ResultData begins at byte offset 16 (counting from 0) of the Input Assembly. To read the first 4 bytes of result
data, issue the following PLC command:
The UserData begins at word offset 4 (counting from 0) of the Output Assembly. To write 4 words of UserData, issue the
following PLC command:
                                                            23
                                                                                              Industrial Network Protocols
The bit to trigger an acquisition is in byte offset 0 of the Output Assembly. To write to this byte, issue the following PLC
command:
The PCCC Object supports a special case mapping of a string table element (ST10:0) to the DMCC service. Any string
written to ST10:0 is passed to the DMCC service for processing. This allows PCCC write string commands to be used to
invoke DMCC commands.
Note: The string table is only one element in size. Writing to the other elements will return an error.
                                                              24
                                                                                          Industrial Network Protocols
Implicit Messaging
EtherNet/IP implicit messaging allows a DataMan reader’s inputs and outputs to be mapped into tags in the ControlLogix
PLC. Once these connections are established, the data is transferred cyclically at a user defined interval (10ms, 50ms,
100ms, and so on).
The figure below represents Ethernet-based I/O through EtherNet/IP:
The Input Assembly and Output Assembly map various attributes (data) from the ID Reader object: The Input Assembly is
the collection of DataMan reader data values sent to the PLC (PLC inputs); and the Output Assembly is the collection of
data values received by the DataMan reader from the PLC (PLC outputs).
   1. Open RSLogix5000 and load your project (or select “File -> New…” to create a new one).
      From the I/O Configuration node, select the Ethernet node under the project Ethernet Module, right-click on the
                                                           25
                                                                                      Industrial Network Protocols
2. From the Select Module dialog, choose your model of DataMan ID Reader from the list.
Note: This option is only available after you install the DataMan Add-On Profile.
Note: The rest of the steps is identical regardless of which DataMan model is selected.
                                                       26
                                                                                       Industrial Network Protocols
3. After selecting the device, the configuration dialog for the DataMan ID Reader system is displayed. Give the
   module a name and enter the DataMan’s IP address. The default is a bidirectional (send/receive) connection
   consisting of control, status, and 32 bytes of result data with keying disabled. To change this default connection,
   click the Change… button. If no change is required, skip the next step.
4. Clicking the Change… button brings up the Module Definition dialog. This dialog is used to alter the connection
   configuration. You can change:
        l   DataMan revision
        l   Electronic keying
        l   Connection type (bidirectional/receive-only)
        l   Amount of data received (from the DataMan)
        l   Amount of data sent (to the DataMan)
                                                           27
                                                                                     Industrial Network Protocols
Electronic Keying: Defines the level of module type checking that is performed by the PLC before a connection
is established.
Exact Match – All of the parameters must match or the connection will be rejected.
    l   Vendor
    l   Product Type
    l   Catalog Number
    l   Major Revision
    l   Minor Revision
Compatible Module – To prevent the inserted module from rejecting the connection:
    l   The Module Types have to match
    l   Catalog Number has to match
                                                    28
                                                                                       Industrial Network Protocols
   Output Data to Sensor: Defines the amount of data transmitted on the connection (to the DataMan). The
   minimum amount is the Control data only. The connection can be configured to also send user data. The amount
   of user data sent is defined in fixed increments (16 bytes, 32 bytes, 64 bytes, and so on). To enable User Data
   output, right-click the DataMan module and then go to Properties -> Change -> Output Data to Sensor.
5. The final step is configuring the connection rate. The rate at which data is transmitted/received is defined as the
   Requested Packet Interval (RPI). The RPI defines how frequently the data is transmitted/received over the
   connection. To optimize network performance, do not set this rate lower than required by a given application, or
   lower than half the expected maximum read rate of the user application. Setting it lower wastes bandwidth and
   does not improve processing performance.
                                                        29
                                                                                     Industrial Network Protocols
6. Select the “Connection” tab of the “New Module” dialog to set the rate.
7. After adding the module to ControlLogix, the I/O tree should appear as follows:
                                                       30
                                                                                         Industrial Network Protocols
   8. When the DataMan module is added to the I/O tree, RSLogix 5000 creates tags that map to the DataMan reader
      Input and Output Data (that is, the Input and Output Assembly Objects in the DataMan Reader). These tags can
      be found under the “Controller Tags” node of the project tree.
           Note: The base name of these tags is the name you gave to the DataMan Module that you added to the I/O
           Configuration in the previous steps.
       The tags are organized in two groups: Status and Control. The Status group represents all the data being
       received from the DataMan. The Control group represents all the data being sent to the DataMan.
       These tags are the symbolic representation of the DataMan Assembly Object contents. The PLC ladder is written
       to access these tag values. By monitoring or changing these tag values the PLC ladder is monitoring and
       changing the DataMan Assembly Object contents.
           Note: Based on the configured RPI, there is a time delay between the DataMan and the PLC tag values.
           Take this time delay into account when writing all PLC ladders.
                                                           31
                                                                                       Industrial Network Protocols
l   TriggerReady: Indicates when the DataMan reader can accept a new trigger. This tag is True when the Control
    tag “TriggerEnable” has been set , and the sensor is not acquiring an image.
l   TriggerAck: Indicates when the DataMan reader has been triggered (that is, the Control tag “Trigger” has been
    set to True). This tag stays set until the Trigger tag is cleared.
l   Acquiring: Indicates when the DataMan reader is acquiring an image either by setting the Trigger bit or by an
    external trigger.
l   MissedAcq: Indicates when the DataMan reader misses an acquisition trigger. It is cleared when the next
    successful acquisition occurs.
l   Decoding: Indicates when the DataMan reader is decoding an acquired image.
l   DecodeCompleted: Tag value is toggled (1 to 0 or 0 to 1) when a decode is completed.
l   ResultsBufferOverrun: Indicates when the DataMan reader discards a set of decode results because the results
    queue is full. Cleared when the next set of results are successfully queued.
l   ResultsAvailable: Indicates when a set of decode results are available (that is, the ResultID, ResultCode,
    ResultLength and ResultsData tags contain valid data).
l   GeneralFault: Indicates when a fault has occurred (that is, SoftEvent “SetMatchString” or “ExecuteDMCC” error
    has occurred).
l   TrainCodeAck: Indicates that the SoftEvent “TrainCode” is complete.
l   TrainMatchStringAck: Indicates that the SoftEvent “TrainMatchString” has completed.
l   TrainFocusAck: Indicates that the SoftEvent “TrainFocus” has completed.
l   TrainBrightnessAck: Indicates that the SoftEvent “TrainBrightness” has completed.
l   UnTrainAck: Indicates that the SoftEvent “UnTrain” has completed.
l   ExecuteDmccAck: Indicates that the SoftEvent “ExecuteDMCC” has completed.
l   SetMatchStringAck: Indicates that the SoftEvent “SetMatchString” has completed.
l   TriggerID: Value of the next trigger to be issued. Used to match triggers issued with corresponding result data
    received later.
                                                        32
                                                                                          Industrial Network Protocols
l   ResultID: The value of TriggerID when the trigger that generated these results was issued. Used to match
    TriggerID’s with result data.
l   ResultCode: Indicates success/failure of this set of results.
         l   Bit 0 ,1=read 0=no read
         l   Bit 1 ,1=validated 0=not validated (or validation not in use)
         l   Bit 2 ,1=verified 0=not verified (or verification not in use)
         l   Bit 3 ,1=acquisition trigger overrun
         l   Bit 4 ,1=acquisition buffer overflow (not the same as result buffer overflow).
         l   Bits 5-15 , reserved (future use)
l   ResultExtended: Unused.
l   ResultLength: Number of bytes of result data contained in the ResultData tag.
l   ResultData: Decode result data. Control tag group is the data sent from the ControlLogix to the DataMan reader:
l   TriggerEnable: Setting this tag enables EtherNet/IP triggering. Clearing this field disables the EtherNet/IP
    triggering.
l   Trigger: Setting this tag triggers an acquisition if:
         l   The TriggerEnable tag is set.
                                                            33
                                                                                             Industrial Network Protocols
    l   TrainBrightness: Changing this tag from 0 to 1 invokes the train brightness operation.
    l   Untrain: Changing this tag from 0 to 1 invokes the un-train operation.
    l   ExecuteDMCC: Changing this tag from 0 to 1 invokes the DMCC operation. A valid DMCC command string must
        be written to UserData prior to invoking this SoftEvent.
    l   SetMatchString: Changing this tag from 0 to 1 invokes the set match string operation. The match string data must
        be written to UserData prior to invoking this SoftEvent.
    l   UserDataOption: Unused.
    l   UserDataLength: Number of bytes of user data contained in the UserData tag.
    l   UserData: This data is sent to the DataMan reader to support acquisition and/or decode.
    Note:
    Configure the DataMan module in RSLogix 5000 to manually add UserData to the output assembly.
The output assembly controller tags now list UserData as part of the output assembly.
                                                             34
                                                                                              Industrial Network Protocols
            Note: The current TriggerID value is 1. Make sure that the results of the next trigger to be issued come back
            with a corresponding ResultID of 1.
   5. After the acquisition/decode has completed, the DecodeCompleted tag will toggle, and the ResultsAvailable tag
      goes to 1. This example shows a successful read (ResultCode bit 0 = 1) and the read has returned 16 bytes of
      data (ResultLength=16). The data is in the ResultData tag.
Explicit Messaging
Unlike implicit messaging, explicit messages are sent to a specific device that always sends a reply to that message. As
a result, explicit messages are better suited for operations that occur infrequently. Explicit messages can be used to read
and write the attributes (data) of the ID Reader Object. They can also be used for acquiring images, sending DMCC
commands and retrieving result data.
                                                             35
                                                                                           Industrial Network Protocols
string characters, no null terminator. Therefore, some of the sample ladder involves converting to/from the two different
string formats.
    Note: The instruction to send a DMCC is intended as a demonstration of DataMan explicit messaging behavior.
    This same operation could be written in a much more efficient ladder but would be less useful as a learning tool.
                                                            36
                                                                                   Industrial Network Protocols
2. Add the following two rungs to the MainRoutine of your ControlLogix project:
3. Edit the MSG instruction. Configure it for “CIP Generic”, service 0x34 “SendDMCC”, class 0x79 “ID Reader
   Object” and instance 1. Set the source to “Message_Data” and the destination to “Message_Result”.
                                                      37
                                                                                         Industrial Network Protocols
   4. On the MSG instruction Communication tab, browse for and select the DataMan which you added to the project
      I/O Configuration tree. This tells Logix where to send the explicit message.
To operate:
   1. Place a DMCC command in the “DMCC_Command_String” tag. For example “||>GET TRIGGER.TYPE$r$l”. Note
      the $r$l at the end of the string. This is how Logix represents a CRLF.
   2. Toggle the “Send_DMCC_Command” tag to 1.
   3. When the “Send_DMCC_Command” tag goes back to 0 execution is complete. The DMCC command results can
      be found in “DMCC_Result_String”.
                                                           38
                                                                                          Industrial Network Protocols
1. Right-click the Ethernet node in the I/O Configuration tree and select New Module....
2. From the Select Module dialog, choose your model of DataMan ID Reader from the list.
After the selection is completed, the configuration dialog for the DataMan ID Reader system is displayed. From this point
on, configuration and programming are done exactly as shown in the ControlLogix section above.
                                                           39
                                                                                       Industrial Network Protocols
   2. The Allen-Bradley SLC has 2 channels available for configuration: Channel 1 (Ethernet); and Channel 0 (DF1
      Full Duplex - serial). Click on the Chan. 1 - System tab.
   3. Configure Channel 1 (Ethernet) as necessary. Consult with a network administrator about settings.
                                                         40
                                                                                             Industrial Network Protocols
The following setup parameters can be configured within a Message (MSG) Instruction.
    l   Target Device: Choose PLC5 to talk to a DataMan reader. This tells the SLC which communication protocol to
        use. The DataMan reader acts much like a ControlLogix controller (see Rockwell document 13862).
    l   Local/Remote: Choose Local to indicate that the DataMan reader is on the same network as the SLC; Remote
        tells the SLC that you will be communicating to a DataMan on another network. For remote communication, you
        have to direct the message through another device acting as a gateway to that secondary network. Typically, this
        could be an Allen-Bradley ControlLogix controller. (See the Rockwell documentation on how to address devices
        on other networks through a gateway.)
    l   Control Block: This is a temporary integer file that the MSG instruction uses to store data (that is, IP address,
        message type, and so on). This is typically not the user data to be sent.
    l   Control Block Length: This is automatically computed by the MSG instruction.
    l   Setup Screen: Selecting Setup Screen opens the Message Instruction Setup dialog.
The following setup parameters can be configured within an MSG Instruction Setup screen.
    l   Communication Command: Make sure that it is the same command (READ/WRITE) as the command chosen on
        the first screen (as seen in MSG Instruction screen).
                                                             41
                                                                                               Industrial Network Protocols
    l   Data Table Address: The location of the data file on the SLC where data will be written to (READ) or sent from
        (WRITE) (as seen in MSG Instruction screen). In this instance, 'N7:0', 'N' indicates the integer file, '7' indicates the
        file number 7, and '0' indicates the offset into that file (in this case, start at the 0th element).
    l   Size in Elements: The number of elements (or individual data) to read. In this example, two elements are being
        read.
    l   Channel: Depends on the configuration of the SLC. In the SLC, Channel 1 is the Ethernet port.
    l   Message Timeout: Choose an appropriate length of time in which the DataMan reader can respond. If the
        DataMan does not respond within this length of time, the MSG instruction will error out. This parameter cannot be
        changed from this screen. The parameters entered in the Channel 1 setup dialog determine the Timeout
        Message.
    l   Data Table Address: The location on the DataMan reader where data will be read from or written to. In this
        instance, 'N7:1', 'N' indicates that the data is of type integer (16-bit); '7' is ignored by the DataMan (data is always
        being written to the Output Assembly, and read from the Input Assembly); and the '1' is the element offset from the
        start of the target buffer. For example: If the message were a READ, 'N7:2' would instruct to read the 3rd integer
        (the ':2' indicates the 3rd element, due to the SLC's 0-based index) from the Input Assembly (because a READ
        gets data from the DataMan's Input Assembly). If the message were a WRITE, 'N7:12' would indicate to write a
        (16-bit) integer value to the 13 integer location of the Output Assembly.
   Note: The ST10:0 destination address is a special case used for sending DMCC commands to a DataMan reader.
   Any string sent to ST10:0 will be interpreted as a DMCC command.
                                                               42
                                                                                   Industrial Network Protocols
4. Add a new Message (MSG) instruction to your ladder logic and configure it as shown in the following example:
                                                     43
                                                                                              Industrial Network Protocols
   6. Click the MultiHop tab and configure it as required (that is, set IP address of DataMan).
   7. When everything is configured, close the MSG window.
   8. Save your ladder logic, download it to the controller, then go online and set the controller in RUN mode.
   9. Trigger the message to send it to the DataMan reader.
The Enable (EN) bit of the message instruction will be set to 1 when the input to the instruction is set high. The Done
(DN) bit will be set to 1 when DataMan has replied that the DMCC command was received and executed with success. If
the Error bit (ER) is enabled (set to 1), it indicates a problem with the message instruction. If an error occurs, click the
Setup Screen for the MSG instruction. The Error Code will be shown at the bottom of the window.
                                                             44
                                                                                     Industrial Network Protocols
1. Open RSLogix5000 and load your project (or select “File->New…” to create a new one).
2. From the I/O Configuration node, select the Ethernet node under the project Ethernet Module, right-click the icon
   and select New Module... from the menu:
3. From the Select Module Type dialog, choose the Allen-Bradley Generic Ethernet Module.
                                                       45
                                                                                          Industrial Network Protocols
4. After selecting it, the configuration dialog for the Generic Ethernet Module is displayed. Configure the following:
        l   Give the module a name.
        l   Enter your DataMan’s IP address.
        l   Set the Comm Format to “Data – INT”. This tells the module to treat the data as an array of 16-bit integers.
        l   Input Assembly: Set instance 11. Set the size to the amount of Input Assembly data you want the PLC to
            receive. Basic “Status” data requires 8 integers. The amount beyond that will be the actual decode result
            data. In the example below the size is set to 24 (8 for status + 16 for result data). This connection will
            receive the status info plus 32 bytes of result data.
        l   Output Assembly: Set instance 21. Set the size to 4 integers. This size is sufficient to send all required
            “Control” data to the DataMan.
                                                          46
                                                                                       Industrial Network Protocols
5. Configure the connection rate. The rate at which data is transmitted/received is defined as the Requested Packet
   Interval (RPI). The RPI defines how frequently the data is transmitted/received over the connection. To optimize
   network performance, do not set this rate lower than absolutely required by a given application. You must not set
   it lower than half the median scan rate of the PLC ladder program. Setting it lower wastes bandwidth and does
   not improve processing performance.
6. After adding the generic module to ControlLogix, the I/O tree appears as follows.
7. When the Generic Module is added to the I/O tree, RSLogix 5000 creates tags that map to the DataMan reader
   Input and Output Data (that is, the Input and Output Assembly Objects in the DataMan Reader). You can find
   these tags under the “Controller Tags” node of the project tree.
Note: The base name of these tags is the name you gave to the Generic Module that you added to the I/O
Configuration earlier.
                                                       47
                                                                                          Industrial Network Protocols
The tags are organized in three groups: Config “MyDM200:C”, Input “MyDM200:I”, and Output “MyDM200:O”. You can
ignore the Config tags (not used). The Input tags represent all the data being received (from the DataMan). The Ouput
tags represent all the data being sent (to the DataMan).
These tags are the data table representation of the DataMan Assembly Object contents. The PLC ladder is written to
access these tag values. By monitoring or changing these tag values, the PLC ladder is actually monitoring and
changing the DataMan Assembly Object contents.
    Note: Based on the configured RPI, there is a time delay between the DataMan and the PLC tag values. Take this
    time delay into account when writing all PLC ladders.
    Note: The start of the Input tags “MyDM200:I.Data[0]” maps directly to the start of the DataMan Input Assembly.
    Likewise, the start of the Output tags “MyDM200:O.Data[0]” maps directly to the start of the DataMan Output
    Assembly.
Examples
Input Assembly “TriggerReady”: Bit 0 of word 0 of the Input Assembly. From the Input tag array for the DataMan select bit
0 of word 0.
                                                           48
                                                                                        Industrial Network Protocols
Input Assembly “ResultLength”: Word 7 of the Input Assembly. From the Input tag array for the DataMan select word 7.
                                                          49
                                                                                         Industrial Network Protocols
Output Assembly “Trigger”: Bit 1 of word 0 of the OutputAssembly. From the Output tag array for the DataMan select bit 1
of word 0.
                                                           50
                                                                                        Industrial Network Protocols
PROFINET
PROFINET is an application-level protocol used in industrial automation applications. This protocol uses standard
Ethernet hardware and software to exchange I/O data, alarms, and diagnostics.
DataMan supports PROFINET I/O. This is one of the two “views” contained in the PROFINET communication standard.
PROFINET I/O performs cyclic data transfers to exchange data with Programmable Logic Controllers (PLCs) over
Ethernet. The second “view” in the standard, PROFINET Component Based Automation (CBA), is not supported.
By default, the DataMan has the PROFINET protocol disabled. The protocol can be enabled via DMCC, scanning a
parameter code or in the DataMan Setup Tool.
    Note: If you have a wireless DataMan reader, see section Industrial Protocols for the Wireless DataMan on
    page 131
DMCC
The following commands can be used to enable/disable PROFINET. The commands can be issued via RS-232 or Telnet
connection.
Note: Use a third party Telnet client such as PuTTY to communicate with your DataMan reader.
Enable:
       ||>SET PROFINET.ENABLED ON
       ||>CONFIG.SAVE
       ||>REBOOT
Disable:
Note: You must reboot the device for the change to take effect.
Enable: Disable:
Scanning the following reader configuration codes enables/disables PROFINET for your DataMan 8000 base station.
Note: You must reboot the device for the change to take effect.
                                                           51
                                                                                         Industrial Network Protocols
Enable: Disable:
Setup Tool
   1. Open Setup Tool to discover the reader.
   2. If the reader appears as misconfigured, select the reader, and click Repair & Support to change the
      misconfigured IP address to the desired static IP.
Note: Having a properly configured IP address is mandatory to further connect to the reader via Setup Tool.
Note: Enabling PROFINET immediately turns off DHCP and turns the current IP address to a static IP.
   6. The Siemens engineering software (TIA or Step7) can discover the reader now.
   7. Using the engineering software, configure how the reader is discovered by the PLC. PROFINET offers two
      modes:
           a. The reader has a permanent static IP address. The static IP address must be configured in the PLC
              project and match the setting on the reader.
           b. The IP address of the reader is configured centrally in the PLC project. In this case, the reader boots up
              with the permanent IP address of 0.0.0.0. Once the PLC identifies the reader on the network by the station
              name of the reader, PLC assigns the configured IP address temporarily to the device. In this case,
              'temporarily' means that the reader starts again with the zero IP on the next boot.
   8. Click Save Settings in the upper toolbar before disconnecting from the reader.
Note: The new settings take effect only after the reader is rebooted.
Getting Started
Preparing to use PROFINET involves the following main steps:
    l   Make sure that you have either the SIMATIC Step 7 programming software or TIA Portal installed.
    l   Set up the Siemens Software tool so that it recognizes your DataMan device.
    l   Install the Generic Station Description (GSD) file.
   Note: Expanding the process image can have a performance impact on the PLC scan cycle time. If your scan time
   is critical, use the minimal acceptable module sizes and manually remap them down lower in the process image.
                                                              52
                                                                                    Industrial Network Protocols
3. Check if the DataMan's firmware is up-to-date by clicking, in the Setup Tool, View and then System Info.
                                                      53
                                                            Industrial Network Protocols
                                                    54
                                                                                   Industrial Network Protocols
                                                     55
                                                                                       Industrial Network Protocols
6. Open the PROFINET Tag Generator file that is included in the TIA Portal Integration Guide.
7. From the Windows Start menu, launch the SIMATIC Manager or TIA Portal.
Object Model
Modules
The PROFINET implementation on DataMan consists of seven I/O modules:
                                                         56
                                                                                           Industrial Network Protocols
                                                              57
                                                                                               Industrial Network Protocols
   3            Missed Ack       Indicates that the DataMan was unable to successfully trigger an acquisition. Bit is
                                 cleared when the next successful acquisition occurs.
  4-7            Reserved        Reserved for future use.
  8-23           Trigger ID      ID value of the next trigger to be issued (16-bit integer). Used to match issued triggers
                                 with corresponding result data received later. This same value is returned in ResultID of
                                 the result data.
    Note: The Missed Ack bit in the Acquisition Status Register will only be set if an acquisition triggered from the
    Acquisition Control Module could not get executed.
                                                               58
                                                                                                 Industrial Network Protocols
                                                                59
                                                                                          Industrial Network Protocols
    Note: There are 5 versions of the User Data module. Only one instance can be configured for use in a given
    application. The “User Data Option” and “User Data Length” fields are the same for each module. The “User Data”
    field varies in size based on the selected module. Choose the module which is large enough to exchange the
    amount of data your application requires.
Slot number: 6
Total Module size:
4 + 16 (16 bytes of User Data)
4 + 32 (32 bytes of User Data)
4 + 64 (64 bytes of User Data)
4 + 128 (128 bytes of User Data)
4 + 250 (250 bytes of User Data)
    Note: There are 5 versions of the Result Data module. Only a single instance can be configured for use in a given
    application. The “Result ID”, “Result Code”, “Result Extended” and “Result Length” fields are the same for each
    module. The “Result Data” field varies in size based on the selected module. Choose the module which is large
    enough to exchange the amount of result data your application requires.
Slot number: 7
Total Module size:
8 + 16 (16 bytes of Result Data)
8 + 32 (32 bytes of Result Data)
8 + 64 (64 bytes of Result Data)
8 + 128 (128 bytes of Result Data)
8 + 246 (246 bytes of Result Data)
                                                          60
                                                                                                Industrial Network Protocols
      0-1              Result ID         The value of the “Trigger ID” when the trigger that generated these results was
                                         issued. Used to match up triggers with corresponding result data (16-bit Integer).
      2-3            Result Code         Indicates the success or failure of the read that produced these results (16-bit
                                         Integer).
                                         Bit 0,1=read, 0=no read
                                         Bit 1,1=validated, 0=not validated (or validation not in use)
                                         Bit 2,1=verified, 0=not verified (or verification not in use)
                                         Bit 3,1=acquisition trigger overrun
                                         Bit 4,1=acquisition buffer overflow
                                         Bits 5-15 reserved
      4-5          Result Extended       Currently unused (16-bit Integer).
      6-7            Result Length       Actual number of bytes of read data contained in the “Result Data” field (16-bit
                                         Integer).
      8...            Result Data        Decoded read result data (array of bytes)
Operation
SoftEvents
SoftEvents act as “virtual” inputs. When the value of a SoftEvent changes from 0 -> 1 the action associated with the event
will be executed. When the action completes the corresponding SoftEventAck bit will change from 0 -> 1 to signal
completion. The acknowledge bit will change back to 0 when the corresponding SoftEvent bit is set back to 0.
The “ExecuteDMCC” and “SetMatchString” SoftEvent actions require user supplied data. This data must be written to the
UserData and UserDataLength area of the UserData Module prior to invoking the SoftEvent. Only one SoftEvent can be
invoked at a time because both of these SoftEvents depend on the UserData.
Acquisition Sequence
DataMan can be triggered to acquire images by several methods. It can be done explicitly by manipulating the Trigger bit
of the Acquisition Control Module, it can be triggered by external hard wired input, and it can be triggered via DMCC.
This section describes manipulating the Acquisition Control Module bits.
On startup the “Trigger Enable” bit will be False. It must be set to True to enable triggering. When the device is ready to
accept triggers, the “Trigger Ready” bit will be set to True.
                                                               61
                                                                                             Industrial Network Protocols
While the Trigger Ready bit is True, each time the reader detects the “Trigger” bit change from 0 to 1, it initiates an image
acquisition. Make sure that the client (PLC) holds the bit in the new state until that same state value is seen back in the
Trigger Ack bit. This is a necessary handshake to guarantee that the reader detects the change.
During an acquisition, the Trigger Ready bit will be cleared and the Acquiring bit will be set to True. When the acquisition
is completed, the Acquiring bit will be cleared. The Trigger Ready bit is again set to True once the device is ready to
begin a new image acquisition.
If results buffering is enabled, the device will allow overlapped acquisition and decoding operations. Trigger Ready will
be set high after acquisition is complete but while decoding is still in process. This can be used to achieve faster overall
trigger rates. If result buffering is not enabled, the Trigger Ready bit will remain low until both the acquisition and decode
operations are complete.
To force a reset of the trigger mechanism, set the Trigger Enable bit to False, until the Trigger Ready bit is 0. Then,
Trigger Enable can be set to True to re-enable acquisition.
As a special case, an acquisition can be cancelled by clearing the Trigger signal before the read operation is complete.
This allows cancelling reads in Presentation and Manual mode if no code is in the field of view. To ensure that a read is
not unintentionally cancelled, it is advised that the PLC hold the Trigger signal True until both TriggerAck and
ResultsAvailable are True or DecodeComplete toggles state.
                                                             62
                                                                                            Industrial Network Protocols
   2          Results Buffer        Remains set to zero.                              Set when decode results could not
                Overflow                                                              be queued because the client
                                                                                      failed to acknowledge a previous
                                                                                      result. Cleared when the decode
                                                                                      result is successfully queued.
   3        Results Available       Set when new results are placed in the Results    Set when new results are placed in
                                    Module. Stays set until the results are           the Results Module. Stays set until
                                    acknowledged by setting Results Ack to true.      the results are acknowledged by
                                                                                      setting Results Ack to true.
Results Buffering
There is an option to enable a queue for decode results. If enabled, this allows a finite number of decode result data to
queue up until the client (PLC) has time to read them. This is useful to smooth out data flow if the client (PLC) slows
down for short periods of time or if there are surges of read activity.
If result buffering is enabled, the device will allow overlapped acquisition and decode operations. Depending on the
application this can be used to achieve faster over all trigger rates. For more information, see the Acquisition Sequence
description.
In general, if reads are occurring faster than results can be sent out, the primary difference between buffering or not
buffering determines which results get discarded. If buffering is not enabled the most recent results are kept and the
earlier result (which was not read by the PLC fast enough) is lost. The more recent result overwrites the earlier result. If
buffering is enabled and the queue becomes full, the most recent results are discarded until space becomes available in
the results queue.
    Note: If the queue has overflowed and then buffering is disabled, there will be a greater than 1 difference between
    the TriggerID and ResultID values. This difference represents the number of reads that occurred but could not be
    queued because the queue was full (number of lost reads equals TriggerID - ResultID - 1). After the next read, the
    ResultID value will return to the typical operating value of TriggerID - 1.
                                                            63
                                                                                           Industrial Network Protocols
SIMATIC Examples
This section gives some examples of using the DataMan with a Siemens S7-300 PLC assuming that you are familiar with
the S7-300 and the SIMATIC programming software.
   1. If you already have a project, click Cancel to skip past the New Project wizard. Otherwise, let the wizard guide
      you through creating a new project.
   2. In the opened project, double-click the Hardware icon to open the HW Config dialog. From the main menu, select
      Options -> Install GSD File….
   3. Browse to the installation folder of the GSD file (or the folder where you saved the GSD file if you downloaded it
      from the web).
4. Select the GSD file you wish to install and follow the displayed instructions to complete the installation.
                                                            64
                                                                                       Industrial Network Protocols
       Note: If there is more than one GSD file in the list, and you are unsure which to install, choose the one with
       the most recent date.
5. Add your DataMan device to your project. This makes the DataMan available in the Hardware Catalog. Launch
   the SIMATIC Hardware Config tool.
6. In the main menu, select View -> Catalog.
7. The catalog is displayed. Expand the PROFINET IO tree to the Cognex ID Readers node.
                                                        65
                                                                                     Industrial Network Protocols
 8. Press and hold the left mouse button to drag the DataMan reader and drop it on the PROFINET IO network
    symbol in the left pane.
The HW Config tool automatically maps the DataMan I/O modules into the memory space.
        Note: By default, the 64 byte User Data and 64 byte Result Data Modules are inserted. There are multiple
        sizes available for both of these modules. To optimize performance, use the module size that most closely
        matches the actual data requirements of your application. You can change the module by deleting the one
        in the table and inserting the appropriate sized module from the catalog.
                                                      66
                                                                                             Industrial Network Protocols
  11. If your DataMan reader is configured to use its own static IP, uncheck Assign IP address via IO controller. As an
      alternative, if you wish the PLC to assign an IP address, select the Ethernet button and configure the appropriate
      address.
12. In the IO Cycle tab, select the appropriate cyclic update rate for your application.
  13. By default, the SIMATIC software maps the User Data and Result Data Modules to offset 256. This is outside of
      the default process image area size of 128. That is, data in these modules are inaccessible by some SFCs such
      as BLKMOV. As a solution, either remap the modules to lower offsets within the process image area or expand
      the process image area to include these modules.
If you choose to expand the process image area, make the size large enough for the module size plus the default 256
offset.
                                                            67
                                                                                        Industrial Network Protocols
    Note: Expanding the process image can have a performance impact on the PLC scan cycle time. If your scan time
    is critical, use the minimal acceptable module sizes and manually remap them down lower in the process image.
Symbol Table
It is recommended that you define symbols for the DataMan I/O module elements to make the code much easier to read
and reduce mistakes. This sample table shows symbols defined for a typical instance of a DataMan reader. It is possible
that DataMan I/O modules are at different addresses in your project. Make sure to adjust your symbol definitions based
on the specific offsets of the I/O modules.
                                                          68
                                                                              Industrial Network Protocols
Note: This sample can be used with any PROFINET enabled DataMan reader.
                                                      69
                                                                                           Industrial Network Protocols
6. The Siemens software extracts the sample archive and makes it available.
Reduced to the basics, the process of reading and retrieving results consists of the following:
   1. Define an area in your application to save read results. There are many options regarding how and where result
      data can be stored. In this example, a Data Block (DB) is defined containing the fields of the Result Data module
      that are relevant for our application.
                                                            70
                                                                                      Industrial Network Protocols
3. Set the trigger signal and set coil to indicate a read is pending.
5. As soon as the results are available, save a copy of the result data and set the results acknowledge signal.
                                                         71
                                                                                   Industrial Network Protocols
6. When the reader sees the result acknowledge signal, clear result acknowledge, clear the read pending coil, and
   signal that the read process is complete.
                                                     72
                                                                                         Industrial Network Protocols
Note: The reader clears “Results Available” as soon as it sees the PLC’s “Results Ack” signal.
Using SoftEvents
Run the sample program “DM200_SoftEvents” for the complete example program.
Note: This sample can be used with any PROFINET enabled DataMan reader.
                                                          73
                                                                                            Industrial Network Protocols
7. The Siemens software extracts the sample archive and makes it available.
SoftEvents are a means of invoking an activity by manipulating a single control bit. The activity for each bit is predefined
(for more details, see section SoftEvents). With the exception of “Execute DMCC” and “Set Match String” all SoftEvents
may be invoked in the same way. “Execute DMCC” and “Set Match String” require the added step of loading the User
Data module with application data before invoking the event.
Reduced to the basics, the process of invoking a SoftEvent consists of the following:
                                                             74
                                                                                         Industrial Network Protocols
Note: This sample can be used with any PROFINET enabled DataMan reader.
“Execute DMCC” is a SoftEvent which requires the added step of loading the User Data module with the desired DMCC
command string before invoking the event. Note that the SoftEvent mechanism does not provide a means of returning
DMCC response data other than a failure indication. This mechanism cannot be used for DMCC “||>GET…” commands.
The process of executing a DMCC command is the same for all other SoftEvents as in the example above except the
step of invoking the SoftEvent also includes copying the command string to the User Data Module. In this example the
command string is in a Data Block. This example can be expanded to utilize a Data Block with an array of command
strings that the copy function can reference by an index value. It allows the user to pre-define all DMCC commands that
are required by the application and invoke them by index.
                                                          75
                                                                                       Industrial Network Protocols
The function “Set User Data” (FC11) copies the provided string to the User Data module. Refer to the example program
for the actual STL code.
                                                         76
                                                                                        Industrial Network Protocols
3. Browse to the installation folder of the GSD file (or the location where you saved the GSD file if you downloaded it
   from the web).
4. Select the GSD file you wish to install and follow the displayed instructions to complete the installation.
Note: If there is more than one GSD file in the list and you are unsure which to install, choose the one with the most
recent date.
                                                         77
                                                                                    Industrial Network Protocols
   5. Go to Device Configuration and add your device in the Network View tab.
   6. The Hardware catalog is displayed on the right. Expand the “PROFINET IO” tree to the “Cognex ID Readers”
      node.
   7. Press and hold the left mouse button to drag the DataMan reader and drop it on the PROFINET IO network
      symbol in the left pane.
The HW Config tool automatically maps the DataMan I/O modules into the memory space.
                                                       78
                                                                                        Industrial Network Protocols
 Note: By default, the 64 byte User Data and 64 byte Result Data Modules are inserted. There are multiple sizes
 available for both of these modules. To optimize performance, use the module size that most closely matches the
 actual data requirements of your application. You can change the module by deleting the one in the table and
 inserting the appropriate sized module from the catalog.
 9. Give the reader a name. This must match the name of your actual DataMan reader. The name must be unique
    and follow DNS naming conventions. For details, see the TIA Portal help documentation.
10. If your DataMan reader is configured to use its own static IP, select the IP address is set directly at the device
    radio button. As an alternative, if you wish the PLC to assign an IP address, select the Ethernet button and
    configure the appropriate address.
11. Check the checkbox next to the device image and connect the selected device with the PLC by drawing a line
    with your mouse.
                                                         79
                                                                                       Industrial Network Protocols
  12. By default, the SIMATIC software maps the User Data and Result Data Modules to offset 256. This is outside of
      the default process image area size of 128. That is, data in these modules are inaccessible by some SFCs such
      as BLKMOV. As a solution, either remap the modules to lower offsets within the process image area or expand
      the process image area to include these modules.
If you choose to expand the process image area, make the size large enough for the module size plus the default 256
offset.
                                                         80
                                                                                        Industrial Network Protocols
    Note: Expanding the process image can have a performance impact on the PLC scan cycle time. If your scan time
    is critical, use the minimal acceptable module sizes and manually remap them down lower in the process image.
Symbol Table
It is recommended that you define symbols for the DataMan I/O module elements to make the code much easier to read
and reduce mistakes. This sample table shows symbols defined for a typical instance of a DataMan reader. It is possible
that DataMan I/O modules are at different addresses in your project. Make sure to adjust your symbol definitions based
on the specific offsets of the I/O modules. For more information, see the TIA Portal Integration Guide for In-Sight and
DataMan at https://support.cognex.com/en/downloads/detail/in-sight/3687/1033.
Note: This sample can be used with any PROFINET enabled DataMan reader.
   1. Start TIA Portal.
   2. Browse to find the sample file on your PC.
                                                          81
                                                                                           Industrial Network Protocols
3. Save the project on your PC. TIA Portal extracts the sample archive and makes it available.
Reduced to the basics, the process of reading and retrieving results consists of the following:
   1. Define an area in your application to save read results. There are many options regarding how and where result
      data can be stored. In this example, a temporary tag is defined containing the fields of the Result Data module
      that are relevant for our application.
3. Set the trigger signal and set coil to indicate a read is pending.
   4. As soon as the results are available, clear the trigger signal and save a copy of the result data and set the results
      acknowledge signal.
                                                            82
                                                                                             Industrial Network Protocols
   5. When the reader sees the result acknowledge signal, clear result acknowledge, clear the read pending coil, and
      signal that the read process is complete.
Note: The reader clears “Results Available” as soon as it sees the PLC’s “Results Ack” signal.
Using SoftEvents
SoftEvents are a means of invoking an activity by manipulating a single control bit. The activity for each bit is predefined.
For more details, see section SoftEvents. With the exception of “Execute DMCC” and “Set Match String” all SoftEvents
may be invoked in the same way. “Execute DMCC” and “Set Match String” require the added step of loading the User
Data module with application data before invoking the event.
Reduced to the basics, the process of invoking a SoftEvent consists of the following:
                                                             83
                                                                                        Industrial Network Protocols
Note: This sample can be used with any PROFINET enabled DataMan reader.
“Execute DMCC” is a SoftEvent which requires the added step of loading the User Data module with the desired DMCC
command string before invoking the event. Note that the SoftEvent mechanism does not provide a means of returning
DMCC response data (other than a failure indication). So this mechanism cannot be used for DMCC “||>GET…”
commands.
The process of executing a DMCC command is the same for all other SoftEvents (see example above) except the step of
invoking the SoftEvent also includes copying the command string to the User Data Module. In this example the command
string is exists in a Data Block. This example can be expanded to utilize a Data Block with an array of command strings
that the copy function can reference by an index value. This allows the user to pre-define all DMCC commands that are
required by the application and invoke them by index.
                                                         84
                                                                                          Industrial Network Protocols
SNMP (Simple Network Management Protocol) v2 is supported only when the V2.34 GSD file is used. PROFINET uses
the topology technology to detect and identify devices on SNMP.
Supported MIBs:
    l   LLDP-MID
    l   LLDP-EXT-DOT3-MIB
    l   MIB-II
Writable OIDs:
These OIDs are reset to the default settings after a factory reset. Other OIDs are also supported in the above MIBs but
have read access only.
PLC Changes
When upgrading the firmware on a DataMan 370/470 or 8700 reader to firmware version 6.1.8 or higher, you need to
remove the reader from the PLC hardware configuration, replace the General Station Description (GSD) file, then re-add
the “CC-B” version of the reader to the hardware configuration.
From the point of view of the PLC, a Class A device is replaced with a Class B device, which fundamentally changes how
the PLC communicates with the reader. The PLC treats the reader as a completely different device.
Follow these steps to replace the reader in the hardware configuration of the PLC while maintaining the IO module
addressing scheme to ensure that the logic in the project is not affected.
Note: It is highly recommended to follow this process for each reader being upgraded, one at a time.
   1. Go into the TIA Portal software and install the new GSD file from the Options drop down menu -> Manage
      General Station Description File dialog.
                                                           85
                                                                                    Industrial Network Protocols
       Note: If you are adding onto an existing hardware configuration and are not removing any existing DataMan
       readers, skip steps 2, 3, and 5.
2. Select the source path in the Manage General Station Description Files dialog and browse to the location of the
   DataMan GSD file: C:\Program Files (x86)\Cognex\DataMan\DataMan Software v6.1.8\Tools\Profinet
       Tip: The TIA software automatically assigns IO module addresses when a new system is added to the
       hardware configuration. To prevent different addresses from being assigned when the class B system is
       added, take a screenshot of the original IO Module addressing. This allows the new reader’s IO modules to
       be mapped to the correct address space in the PLC, and prevent broken logic in the project:
                                                      86
                                                                                            Industrial Network Protocols
   4. Expand the catalog in the TIA Portal software, select the “DataMan 370 CC-B” or “DataMan 470 CC-B” version
      and add it to your configuration.
   5. Confirm that the IO Module addressing matches what the original vision system was mapped to. If they are
      different, refer to the screenshot taken in step 2 to restore the IO module addresses to their previous values.
   6. To change the cycle time to 8 ms, or to another value, select the reader from the Device view, and on the General
      tab, select Real Time Settings. Select the appropriate cycle time from the Update Time drop down menu:
            Note: The new GSD file has a faster cycle time, defaulting to 4 ms from 8 ms. While this shortens the network
            update interval, it also doubles the amount of PROFINET traffic from this device.
iQ Sensor Solution
iQ Sensor Solution (iQSS) is an engineering tool offered by Mitsubishi Electric. It allows the intuitive configuration and
maintenance of sensors. If iQSS is enabled in the Setup tool, DataMan supports setting and monitoring of the following
device settings via iQSS:
Disabling iQSS blocks any attempts to remotely get or set these device settings.
                                                            87
                                                                                        Industrial Network Protocols
Note: If you have a wireless DataMan reader, read the section Industrial Protocols for the Wireless DataMan.
DMCC
The following commands can be used to enable or disable the iQ Sensor Solution. The commands can be issued via
RS-232 or Telnet connection.
    Note: Because you have to make changes to the Telnet client provided by Windows to communicate with DataMan,
    it is recommended you use third party clients such as PuTTY.
Enable:
           ||>SET IQSS.ENABLED ON
           ||>CONFIG.SAVE
           ||>REBOOT
Disable:
Choose language:
English:
           ||>SET IQSS.LANGUAGE 0
           ||>CONFIG.SAVE
           ||>REBOOT
Japanese:
           ||>SET IQSS.LANGUAGE 1
           ||>CONFIG.SAVE
           ||>REBOOT
Enable: Disable:
Scanning the following reader configuration codes will set the language for the iQSS on your DataMan reader.
                                                          88
                                                                                         Industrial Network Protocols
English: Japanese:
Setup Tool
The iQ Sensor Solution can be enabled by checking the box iQ Sensor Solution in the Communications step under the
Ethernet tab. Make sure to save the new selection by choosing Save Settings before disconnecting from the reader.
Overview
This topic describes how to configure the iQ Sensor Solution for DataMan devices, and transfer data between a reader
and a Mitsubishi Automation Controller using GX Works2. The examples in this topic were written assuming the following
components are being used:
    l   DataMan Reader
    l   Mitsubishi iQ-R, Q, L or F-series (3E Frame) Automation Controller
Note: iQ Sensor Solution is only available on Setup Tool using 6.1.5 version.
    Note: For more information on Mitsubishi iQ Sensor Solution, refer to Mitsubishi's iQ Sensor Solution Reference
    Manual.
Mitsubishi iQ Sensor Solution is a factory protocol that enables the GX Works2 software to control readers over the SLMP
Scanner protocol. With the iQ Sensor Solution, GX Work2 is able to discover readers on the network, read/write the
reader's SLMP Scanner parameter settings and monitor the status of a reader.
Note: For more information on GX Works2, refer to the GX Works2 Operating Manual.
   1. Launch GX Works2.
   2. From the Tool menu, select Register Profile. The Register Profile window opens.
   3. Create a new project in GX Works2.
                                                           89
                                                                                        Industrial Network Protocols
         Note: By default, the Cognex Language Package is installed to: C:\Program Files (x86)\Cognex\In-Sight\In-
         Sight Explorer 4.9.x\Factory Protocol Description\ESPP.
  5. Select Parameter --> PLC Parameter on the Project view. The L Parameter Setting window is displayed.
  6. Select the Built-in Ethernet Port Settings tab.
  7. Check the Set Open Setting in Ethernet Configuration window checkbox. The following message will be
     displayed.
  8. Click Yes; the Open Settings button will be changed to the Ethenet Conf. button.
  9. Click the Ethernet Conf. button. The Ethernet Configuration window will be displayed.
 10. Select Ethernet Configuration --> Online --> Detect Now; the following message is displayed.
 11. Read the message and click Yes. The actual system configuration is reflected on the Ethernet Configuration
     window.
 12. Select Close with Reflecting the Setting. The settings on the Ethernet Configuration window will be saved, and
     the system configuration setting is completed.
  Note: Up to 16 readers may be displayed (in ascending order of their IP addresses) on the Ethernet Configuration
  window after executing the automatic detection of connected devices. If the Detect Now button is pressed, and a
  reader in the network is not iQSS-compatible, the reader will not appear in the Ethernet configuration window. If a
  reader is iQSS-compatible but no profile was previously added to GX Works2, "Module With No Profile Found" will
  be displayed.
  Note: When a reader is detected in the actual system configuration, error information is displayed on the Output
  window when there is an error in the system configuration after executing the automatic detection of connected
  devices. Double-click the error on the Output window and correct the error at the error jump destination.
  2. From the Diagnostics menu, select Sensor/Device Monitor. The Module Selection (Sensor/Device Monitor)
     window will be displayed.
  3. Click OK; the Status of readers connected to the Built-in Ethernet port LCPU will be displayed on the
     Sensor/Device Monitor window.
                                                         90
                                                                                                Industrial Network Protocols
   4. Select the desired reader from the "list of devices" or "device map area". The status of the reader will be displayed
      on the Monitor Information window.
Note: Only one reader can be monitored in the Ethernet Configuration window at a time.
By default the DataMan has the CC-Link Protocol disabled. The protocol can be enabled in the Setup Tool, via DMCC, or
by scanning a parameter code.
Note: If you have a wireless DataMan reader, read the section Industrial Protocols for the Wireless DataMan.
DMCC
The following commands can be used to enable or disable the CC-Link IE Field Basic. The commands can be issued via
RS-232 or Telnet connection.
    Note: Because you have to make changes to the Telnet client provided by Windows to communicate with DataMan,
    it is recommended you use third party clients such as PuTTY.
Enable:
       ||>SET CC-LINK.ENABLED ON
       ||>CONFIG.SAVE
       ||>REBOOT
                                                               91
                                                                                                Industrial Network Protocols
Disable:
Enable: Disable:
Setup Tool
The CC-Link IE Field Basic can be enabled by checking the box CC-Link in the Communications step under the
Ethernet tab - > Industrial Protocols. Make sure to save the new selection by choosing Save Settings before
disconnecting from the reader.
Note: You must reboot your reader for the new settings to take effect.
Modules
The CC-Link IE Field Basic implementation on DataMan consists of four I/O modules:
   1. Control Block
   2. Status Block
Signal Layout
           Block name               Link Device Name                    Data Length                      Data Flow
        Control Block                       RY                64 bits (only the first 32 bits          PLC to Reader
                                                                        are used)
           Status Block                     RX                64 bits (only the first 32 bits          Reader to PLC
                                                                        are used)
     Output Data Block                     RWw                    32 Words (64 bytes)                  PLC to Reader
      Input Data Block                     RWr                    32 Words (64 bytes)                  Reader to PLC
                                                           92
                                                                                                       Industrial Network Protocols
    Note: The number of link devices can be increased up to a factor of 4, if the reader is configured in GXWorks to
    occupy more than one station. This can be useful if inspection results or DMCC commands need to be transmitted
    that are longer than 62 bytes.
Note: The Trigger Ready bit must be set high before triggering an acquisition.
     2           Buffer   When this bit is set, each read result set (ResultID, ResultCode, ResultLength and ResultData
                Results   fields) will be held in the Output Block until it is acknowledged. Once acknowledged, the next
                Enable    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->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 Operation for a description of the acknowledgement handshake
                        sequence.
   4-15      Reserved Future use
    16       Reserved Future use
    17       Reserved     Future use
   18-23     Reserved Future use
                                                                     93
                                                                                             Industrial Network Protocols
     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        Set to indicate that the reader is in the process of decoding an image.
                                                              94
                                                                                            Industrial Network Protocols
                                                            95
                                                                                              Industrial Network Protocols
                                                              96
                                                                                        Industrial Network Protocols
SLMP Protocol
The SLMP Protocol uses standard Ethernet hardware and software to exchange I/O data, alarms, and diagnostics. It is
Mitsubishi Electric’s publicly available, standardized communication format for communicating with Q, iQ and L Series
PLCs through Ethernet or serial connections. DataMan supports SLMP Protocol on Ethernet only.
By default, the DataMan has SLMP Protocol disabled. The protocol can be enabled in the Setup Tool, via DMCC, or by
scanning a configuration code.
    Note: If you have a wireless DataMan reader, see section Industrial Protocols for the Wireless DataMan on
    page 131.
DMCC
The following commands can be used to enable/disable SLMP Protocol. The commands can be issued via RS-232 or
Telnet connection.
Note: Use a third party Telnet client such as PuTTY to communicate with your DataMan reader.
Enable:
      ||>SET SLMP-PROTOCOL.ENABLED ON
      ||>CONFIG.SAVE
      ||>REBOOT
Disable:
Note: You must reboot the device for the change to take effect.
Enable: Disable:
Scanning the following reader configuration codes enables/disables SLMP protocol on your DataMan 8000 base station.
Note: You must reboot the device for the change to take effect.
                                                           97
                                                                                          Industrial Network Protocols
Enable: Disable:
Getting Started
By default, SLMP Protocol is not enabled on the DataMan reader. The protocol must be enabled and the protocol
configuration parameters must be set to correctly interact with a PLC. Protocol configuration is accomplished via the
DataMan Setup Tool.
In the Setup Tool's Communications application step's Ethernet tab, check SLMP Protocol to enable this industrial
protocol.
                                                           98
                                                                                         Industrial Network Protocols
Make sure to save the new selection by clicking the Save Settings button in the upper toolbar before disconnecting from
the reader.
Note: The new settings take effect only after the reader is rebooted.
SLMP Protocol configuration consists of two aspects: defining the network information and defining the data to be
exchanged. All configuration parameters are accessed via the SLMP Protocol tab.
You must modify the IP Address to match the address of your PLC. In addition, modify Network Number, PC Number
and Destination Module if they differ from your network.
                                                            99
                                                                                        Industrial Network Protocols
Network Configuration
The network configuration defines all the information that the DataMan reader needs to establish a connection with a
PLC.
                                                          100
                                                                                           Industrial Network Protocols
Not all data blocks are required. Configure only those data blocks which your application needs. Typically the Control
and Status blocks are defined because they control most data flow. However, there are some use cases where even
these blocks are not required.
A data block is configured by defining the PLC Device type (that is, memory type), Device offset and Number of Devices
contained in the data block. If either the Device type or Number of Devices is undefined, that block will not be used. That
is, no data is exchanged for that block.
                                                                                                                  32, if bit
                                                                                                                  type
                                                                                                                  2, if
                                                                                                                  word
                                                                                                                  type
                                                                                                                  (read-
                                                                                                                  only)
Status                                   <none>, D, W, R, ZR, M, X, Y, L, F, B                            0-    0, if type
                                                                                                          65535 <none>
                                                                                                                  32, if bit
                                                                                                                  type
                                                                                                                  2, if
                                                                                                                  word
                                                                                                                  type
                                                                                                                  (read-
                                                                                                                  only)
PLC Input                                None, D, W, R, ZR                                                0-    0 - 960
                                                                                                          65535
PLC Output                               None, D, W, R, ZR                                                0-    0 - 960
                                                                                                          65535
Command                                  None, D, W, R, ZR                                                0-    0 - 960
                                                                                                          65535
Command                                  None, D, W, R, ZR                                                0-    0 - 960
Result                                                                                                    65535
Interface
This section describes the interface to the DataMan reader as seen by the PLC via SLMP Protocol. The interface model
consists of six data blocks grouped in three logical pairs:
                                                           101
                                                                                                      Industrial Network Protocols
Not all of the blocks are required. You may select which blocks are appropriate for your particular application. However,
Control and Status will generally be included for most applications.
You can define the starting address and device type for each interface block that you choose to use in your application.
Undefined blocks will not be exchanged. For any transfer (read or write) the entire block is sent, even if only one field
within the block has changed value. The protocol implementation will minimize network use by grouping as many value
changes as logically possible into a single transfer.
Control Block
The Control block contains bit type data. However, the block may be defined to exist in either bit or word memory in the
PLC. 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.Control Block
Note: The Trigger Ready bit must be set high before triggering an acquisition.
     2           Buffer       When this bit is set, each read result set (ResultID, ResultCode, ResultLength and
                Results       ResultData fields) will be held in the Output Block until it is acknowledged. Once
                Enable        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.
                                                                     102
                                                                                              Industrial Network Protocols
Status Block
The status block contains bit type data. The block can also be defined to exist in either bit or word memory in the PLC.
This block consists of the status signals sent from the reader to the PLC. The reader uses it to signal status and
handshake certain data transfers.
                                                             103
                                                                                        Industrial Network Protocols
   3       Missed    Indicates that the reader missed a requested acquisition trigger. The bit is cleared when the next
            Acq      acquisition is issued.
   4-7    Reserved Future use
   8      Decoding Set to indicate that the reader is in the process of decoding an image.
   9       Decode Indicates new result data is available. Bit toggles state (0 to 1 or 1 to 0) each time new result
          Complete data becomes available.
           Toggle
   10      Results Set to indicate that the reader has discarded a set of read results because the PLC has not
            Buffer acknowledged the earlier results. Cleared when the next set of result data is successfully
           Overrun queued in the buffer. This bit only has meaning if result buffering is enabled.
   11     Results Set to indicate that new result data is available. Bit will remain set until acknowledged with
          Available ResultsAck even if additional new read results become available.
  12-14   Reserved Future use
   15     General    Set to indicate that an Ethernet communications fault has occurred. Currently only used by
           Fault     SoftEvent operations. Bit will remain set until the next successful SoftEvent or until
                     TriggerEnable is set low and then high again.
   16     Set User Set to indicate that the reader has received new UserData. Bit will remain set until the
          Data Ack corresponding SetUserData bit is cleared. This forms a logical handshake between the PLC and
                   reader.
   17      String Set to indicate that the reader has completed processing the latest string command and that the
          Cmd Ack 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 Set to indicate that the reader has completed the SoftEvent action. Bit will remain set until the
             Ack    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
                                                        104
                                                                                               Industrial Network Protocols
                                                              105
                                                                                              Industrial Network Protocols
    Note: Do not send string commands that change the reader configuration at the same time as reads are being
    triggered. Changing configuration during acquisition/decode can lead to unpredictable results.
Operation
SLMP Protocol is a command/response based protocol. All communications are originated from the DataMan reader.
The reader must send read requests to the PLC at a periodic interval to detect changes in the control bits.
Scanning
To initiate actions or control data transfer, the PLC changes the state of certain bits of the Control block. Since only the
reader can initiate communications, the reader scans (that is, reads the Control block from the PLC) at a periodic rate.
This rate is user-defined.
                                                             106
                                                                                              Industrial Network Protocols
After each scan, the reader will process changes in state of the bits in the Control block. Some state changes require
additional communications with the PLC, such as writing updated acknowledge bit values or reading a new string
command. The reader handles these additional communications automatically. Other state changes initiate activities
such as triggering a read or executing a SoftEvent. The reader performs the requested action and later reports the
results.
For any transfer (read or write), the entire interface block is sent, even if only one field within the block has changed
value. The protocol implementation will minimize network usage by grouping as many value changes as logically
possible into a single transfer.
Handshaking
A number of actions are accomplished by means of a logical handshake between the reader and the PLC: triggering,
transferring results, executing SoftEvents, string commands, and so on. This ensures that both sides of a transaction
know the state of the operation on the opposite side. Network transmission delays always introduce a finite time delay in
transfer data and signals. Without this handshaking, one side of a transaction might not detect a signal state change on
the other side. Any operation that has both an initiating signal and corresponding acknowledge signal uses this basic
handshake procedure.
The procedure involves a four-way handshake.
                                                             107
                                                                                              Industrial Network Protocols
   1. Assert signal
   2. Signal acknowledge
   3. De-assert signal
   4. De-assert acknowledge
The requesting device asserts the signal to request an action (set bit 0 to 1). When the target device detects the signal
and the requested operation is complete, it asserts the corresponding acknowledge (set bit 0 to 1). When the requesting
device detects the acknowledge, it de-asserts the original signal (1 to 0). Finally, when the target device detects the
original signal de-asserted, it de-asserts its acknowledge (bit 0 to 1). To function correctly, both sides must see the
complete assert/de-assert cycle (0 to 1 and 1 to 0). The requesting device should not initiate a subsequent request until
the cycle completes.
Acquisition Sequence
DataMan can be triggered to acquire images by several methods. It can be done via the SLMP Protocol by setting the
Trigger bit or issuing a trigger String Command, by DMCC (Telnet), or hardwired trigger signal. This section describes
the Trigger bit method.
On startup the TriggerEnable will be False. It must be set to True to enable triggering via the SLMP Protocol Trigger bit.
When the device is ready to accept triggers, the reader will set the TriggerReady bit to True.
While the TriggerReady bit is True, each time the reader detects the Trigger bit change from 0 to 1, it initiates a read.
Make sure that the Trigger bit is held in the new state until that same state value is seen in the TriggerAck bit. This is a
necessary handshake to guarantee that the reader detects the trigger.
During an acquisition, the TriggerReady bit will be cleared and the Acquiring bit will be set to True. When the acquisition
is completed, the Acquiring bit will be cleared. When the device is ready to begin another image acquisition, the
TriggerReady bit will again be set to True.
If results buffering is enabled, the reader will allow overlapped acquisition and decoding operations. TriggerReady will
be set high after acquisition is complete but while decoding is still in process. This can be used to achieve faster overall
trigger rates. If result buffering is not enabled, the TriggerReady bit will remain low until both the acquisition and decode
operations are complete.
To force a reset of the trigger mechanism, set the TriggerEnable to False until TriggerReady is also set to False. Then,
TriggerEnable can be set to True to re-enable acquisition.
As a special case, an acquisition can be cancelled by clearing the Trigger signal before the read operation is complete.
This allows for canceling reads in Presentation and Manual mode if no code is in the field of view. To ensure that a read
is not unintentionally cancelled, make sure that the PLC holds the Trigger signal True until both TriggerAck and
ResultsAvailable are True (or DecodeComplete toggles state).
                                                             108
                                                                                             Industrial Network Protocols
Results Buffering
There is an option to enable a queue for read results. If enabled, this allows a finite number of sets of result data to be
queued up until the PLC has time to read them. This is useful to smooth out data flow if the PLC slows down for short
periods of time.
If result buffering is enabled, the reader will allow overlapped acquisition and decode operations. Depending on the
application this can be used to achieve faster overall trigger rates. For more information, see the Acquisition Sequence
description.
In general, if reads are occurring faster than results can be sent out, the primary difference between buffering or not
buffering determines which results get discarded. If buffering is not enabled, the most recent results are kept and the
earlier result, which the PLC did not read quickly enough, is lost. The more recent result overwrites the earlier result. If
buffering is enabled and the queue becomes full, the most recent results are discarded until space becomes available in
the results queue.
    Note: If the queue has overflowed and then buffering is disabled, there will be a greater than 1 difference between
    the TriggerID and ResultID values. This difference represents the number of reads that occurred but could not be
    queue because the queue was full (number of lost reads equals TriggerID - ResultID - 1). After the next read, the
    ResultID value will return to the typical operating value of TriggerID - 1.
                                                            109
                                                                                                Industrial Network Protocols
SoftEvents
SoftEvents act as “virtual” inputs. When the value of a SoftEvent bit changes from 0 to 1, the action associated with the
event is executed. When the action completes, the corresponding SoftEventAck bit will change from 0 to 1 to signal
completion.
The SoftEvent and SoftEventAck form a logical handshake. After SoftEventAck changes to 1, the original SoftEvent
should be set back to 0. When that occurs, SoftEventAck will automatically be set back to 0.
    WARNING: Do not execute SoftEvents that change the reader configuration at the same time that reads are being
    triggered. Changing configuration during acquisition/decode can lead to unpredictable results.
    Note: The “ExecuteDMCC” and “SetMatchString” SoftEvent actions require user supplied data. This data must be
    written to the UserData and UserDataLength area of the Input Data block prior to invoking the SoftEvent. Since both
    of these SoftEvents depend on the UserData, only one may be invoked at a time.
String Commands
The DataMan SLMP Protocol implementation includes a String Command feature. This feature allows you to execute
string-based DMCCs over the SLMP protocol connection. The DMCC is sent to the reader through the String Command
block. The DMCC result is returned through the String Command Result block. Initiating a command and notification of
completion is accomplished by signaling bits in the Control and Status blocks.
To execute a DMCC, the command string is placed in the data field of the String Command block. The command string
consists of standard ASCII text. The same command format is used for a serial (RS-232) or Telnet connection. The string
does not need to be terminated with a null character. Instead, the length of the string (that is, the number of ASCII
characters) is placed in the length field of the String Command block.
After executing the DMCC, the result string is returned in the String Command Result block. Similar to the original
command, the result string consists of ASCII characters in the same format that is returned through a serial or Telnet
connection. Also, there is no terminating null character. Instead the length of the result is returned in the Command String
Result length field. The Command String Result block also contains a numeric result code. This allows you to determine
the success or failure of the command without having to parse the text string. The values of the result code are defined in
the DMCC documentation.
Examples
Included with the DataMan Setup Tool installer is an example PLC program created with Mitsubishi (GX Works2)
software. This program demonstrates the DataMan ID readers’ capabilities and proper operation. You can do the same
                                                              110
                                                                                               Industrial Network Protocols
operations by using more advanced features and efficient programming practices with Mitsubishi PLCs. For
demonstration purposes, the sample program is used.
Function
The example application demonstrates the following operations:
   1. Triggering a read
   2. Getting read results
   3. Executing string commands (DMCC)
   4. Executing SoftEvent operations
           a. Train code
The “Main” program contains a PLC ladder rung to invoke each of these operations. The operation is invoked by toggling
the control bit on the rung from 0 to 1. This invokes the associated subroutine to perform the operation. When the
operation is complete, the subroutine sets the control bit back to 0.
Triggering a Read
The example provides two trigger options; “Continuous Trigger” and “Single Trigger”. As the name implies, enabling the
“Continuous Trigger” bit will invoke a continuous series of read operations. Once enabled, the “Continuous Trigger”
control bit will remain set until you disable it. The “Single Trigger” control bit invokes a single read operation. This control
bit will automatically be cleared when the read is completed.
Primarily, the trigger subroutine manages the trigger handshake operation between the PLC and the reader. The control
Trigger bit is set, the PLC waits for the corresponding TriggerAck status bit from the reader, and the control Trigger bit is
reset. Refer to a description of handshaking in section Operation.
The trigger subroutine contains a delay timer. This is not required for operation. It exists simply to add an adjustable
artificial delay between reads for demonstration purposes.
Getting Read Results
For this example the operation of triggering a read and getting read results were intentionally separated. This is to
support the situation where the PLC is not the source of the read trigger. For example, the reader may be configured to
use a hardware trigger. In such a case, only the get results subroutine would be needed.
                                                             111
                                                                                            Industrial Network Protocols
Like the triggering subroutine, the get results subroutine manages the results handshake operation between the PLC
and the reader. However, it also copies the result data to internal storage. The routine waits for the ResultsAvailable
status bit to become active, it copies the result data to internal storage, and then executes the ResultsAck handshake.
Refer to a description of handshaking in section Operation.
The read result consists of a ResultCode, ResultLength, and ResultData. Refer to section Output Data Block Field
Descriptions for details of the ResultCode values. The ResultLength field indicates how many bytes of actual result data
exist in the ResultData field. The subroutine converts this byte length to word length before copying the results to internal
storage.
The get results subroutine gathers read statistics: number of good reads, number of no-reads, and so on. This is not
required for operation. It is simply for demonstration purposes.
Execute String Commands (DMCC)
The string command feature provides a simple way to invoke DMCC commands from the PLC. The command format and
command result format is exactly identical to that used for serial or Telnet DMCC operation.
This subroutine copies an example DMCC command (||>GET CAMERA.EXPOSURE) to the String Command block and
then manages the string command handshake operation between the PLC and the reader to invoke the command and
retrieve the command result. Any valid DMCC command may be invoked with this mechanism. Refer to the DataMan
Command Reference document available through the Windows Start menu or the DataMan Setup Tool Help menu.
Execute SoftEvents
SoftEvents are used to invoke a predefined action. Each SoftEvent is essentially a virtual input signal. Each of the
SoftEvent subroutines manages the handshake operation between the PLC and the reader to invoke the predefined
action. The associated action is invoked when the SoftEvent bit toggles from 0 to 1. The subroutine then watches for the
associated SoftEventAck bit from the reader which signals that the action is complete. For a description of handshaking,
see section Operation.
    Note: The “Execute DMCC” and “Set Match String” SoftEvents make use of the Input Data block. The subroutine for
    these two events copies the relevant data into the User Data fields of the Input Data block and then invokes the
    User Data subroutine to transfer the data to the reader. The actual SoftEvent action is invoked only after the user
    data is transferred. The user data needs to be transferred before invoking either of these events.
                                                            112
                                                                                    Industrial Network Protocols
Note: The “Train Match String” SoftEvent only prepares the training mechanism. The actual training occurs on the
next read operation. Therefore, a trigger must be issued following “Train Match String”.
                                                     113
                                                                                        Industrial Network Protocols
ModbusTCP
Modbus is an application layer protocol. It provides client/server communication between devices connected to different
types of buses or networks. Modbus is a request/response protocol, and its services are specified by using function
codes.
Modbus TCP provides the Modbus protocol using TCP/IP. System port 502 is reserved for Modbus communication. It
uses standard Ethernet hardware and software to exchange I/O data and diagnostics. DataMan provides Modbus TCP
server functionality only.
By default, DataMan has the Modbus TCP protocol disabled. The protocol can be enabled in the Setup Tool, via DMCC,
or by scanning a configuration code.
    Note: If you have a wireless DataMan reader, see section Industrial Protocols for the Wireless DataMan on
    page 131
DMCC
The following commands can be used to enable/disable Modbus TCP. The commands can be issued via RS-232 or
Telnet connection.
Note: Use a third party Telnet client such as PuTTY to communicate with your DataMan reader.
Enable:
       ||>SET MODBUSTCP.ENABLED ON
       ||>CONFIG.SAVE
       ||>REBOOT
Disable:
Note: You must reboot the device for the change to take effect.
Enable: Disable:
Scanning the following reader configuration codes enables/disables Modbus TCP for your DataMan 8000 base station.
Note: You must reboot the device for the change to take effect.
                                                          114
                                                                                          Industrial Network Protocols
Enable: Disable:
Setup Tool
Modbus TCP can be enabled by checking Enabled on the Industrial Protocols pane’s Modbus TCP tab. Make sure to
save the new selection by choosing “Save Settings” before disconnecting from the reader.
Note: You must reboot your reader for the new settings to take effect.
Getting Started
By default, Modbus TCP is not enabled on the DataMan reader. The protocol must be enabled and the protocol
configuration parameters must be set to correctly interact with a PLC. Protocol configuration is accomplished via the
DataMan Setup Tool.
In the Setup Tool's Communications application step's Ethernet tab, check Modbus TCP to enable this industrial
protocol.
                                                           115
                                                                                        Industrial Network Protocols
Make sure to save the new selection by clicking the Save Settings button in the upper toolbar before disconnecting from
the reader.
Note: The new settings take effect only after the reader is rebooted.
Network Configuration
The network configuration defines all the information that the DataMan reader needs to establish a connection with a
PLC. In most cases the default values may be used and no changes are need.
                                                           116
                                                                                             Industrial Network Protocols
Host Port              502           Fixed              Port number where Modbus TCP can be accessed on this reader.
Max Connections        3             1-6                Maximum number of simultaneous Modbus TCP connections.
Idle Timeout           120           1-3600             Timeout period after which the Modbus TCP connection will be
(seconds)                                               closed. If no traffic is received on a Modbus TCP connection for
                                                        this amount of time, the connection will automatically be closed.
String byte swap       False         True / False       String byte swap enable. If set to True, bytes within each register
                                                        that forms a string will be swapped.
Holding Register       False         True / False       Holding Register Only Mode enable. If set to True, all data blocks
Only Mode                                               will be mapped to the Holding Register space.
DataMan also supports an alternate block configuration. A number of PLCs can only access the ModbusTCP ‘Holding
Register’ address space. The alternate 'Holding Register Only' configuration exists to accommodate these PLCs. In this
alternate configuration, all reader input and output data is mapped to the ModbusTCP ‘Holding Register’ address space.
To enable this alternate mode, perform one of the following options:
    l    Check the “Holding Register Only” box on the ModbusTCP configuration screen.
    l    Use the DMCC, which switches on or off the alternate mode (Holding Register Only mode).
Enable:
||>SET MODBUSTCP-HOLDING-ONLY ON
Disable:
                                                            117
                                                                                             Industrial Network Protocols
Enable: Disable:
Enable: Disable:
Interface
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 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.
                                                            118
                                                                                                 Industrial Network Protocols
                                                                  119
                                                                                              Industrial Network Protocols
        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.
   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
                                                               120
                                                                                            Industrial Network Protocols
   8              Decoding              Set to indicate that the reader is in the process of decoding an image.
   9          Decode Complete           Indicates new result data is available. Bit toggles state (0 -> 1 or 1 -> 0) each
                  Toggle                time new result data becomes available.
  10            Results Buffer          Set to indicate that the reader has discarded a set of read results because the
                  Overrun               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               Set to indicate that the reader has completed processing the latest string
                  Cmd Ack               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             Set to indicate that the reader has completed the SoftEvent action. Bit will
                    Ack                 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
                                                           121
                                                                                                Industrial Network Protocols
     Note: Do not send string commands that change the reader configuration at the same time as reads are being
     triggered. Changing configuration during acquisition/decode can lead to unpredictable results.
                                                               122
                                                                                            Industrial Network Protocols
Operation
Modbus TCP is a request/response based protocol. All communications are originated from the PLC. The reader acts as
server.
Requests
To initiate actions or control data transfer, the PLC changes the state of certain bits of the Control block and sends
requests to the reader.
After each request, the reader will process changes in state of the bits in the Control block. Some state changes require
additional communications with the PLC, such as writing updated acknowledge bit values or reading a new string
command. These additional communications are handled automatically by the reader. Other state changes initiate
activities such as triggering a read or executing a SoftEvent. The reader performs the requested action and later reports
the results.
                                                            123
                                                                                             Industrial Network Protocols
Handshaking
A number of actions are accomplished by means of a logical handshake between the reader and the PLC (triggering,
transferring results, executing SoftEvents, string commands, and so on). This is done to ensure that both sides of a
transaction know the state of the operation on the opposite side. Network transmission delays will always introduce a
finite time delay in transfer data and signals. Without this handshaking, it is possible that one side of a transaction might
not detect a signal state change on the other side. Any operation that has both an initiating signal and corresponding
acknowledge signal will use this basic handshake procedure.
The procedure involves a four-way handshake.
   1. Assert signal
   2. Signal acknowledge
   3. De-assert signal
   4. De-assert acknowledge
The requesting device asserts the signal to request an action (set bit 0 -> 1). When the target device detects the signal
and the requested operation has completed, it asserts the corresponding acknowledge (set bit 0 -> 1). When the
requesting device detects the acknowledge, it de-asserts the original signal (1 -> 0). Finally, when the target device
detects the original signal de-asserted, it de-asserts its acknowledge (bit 0 -> 1). To function correctly both sides must
see the complete assert/de-assert cycle (0 -> 1 and 1 -> 0). The requesting device should not initiate a subsequent
request until the cycle completes.
Acquisition Sequence
DataMan can be triggered to acquire images by several methods. It can be done by setting the Trigger bit or issuing a
trigger String Command. It can also be done via DMCC command (Telnet) or hardwired trigger signal. The Trigger bit
method will be discussed here.
On startup, TriggerEnable will be False. It must be set to True to enable triggering via the Trigger bit. When the device is
ready to accept triggers, the reader will set the TriggerReady bit to True.
                                                            124
                                                                                             Industrial Network Protocols
While the TriggerReady bit is True, each time the reader detects the Trigger bit change from 0 -> 1, it will initiate a read.
The Trigger bit should be held in the new state until that same state value is seen in the TriggerAck bit (this is a
necessary handshake to guarantee that the trigger is seen by the reader).
During an acquisition, the TriggerReady bit will be cleared and the Acquiring bit will be set to True. When the acquisition
is completed, the Acquiring bit will be cleared. When the device is ready to begin another image acquisition, the
TriggerReady bit will again be set to True.
If results buffering is enabled, the reader will allow overlapped acquisition and decoding operations. TriggerReady will
be set high after acquisition is complete but while decoding is still in process. This can be used to achieve faster overall
trigger rates. If result buffering is not enabled, the TriggerReady bit will remain low until both the acquisition and decode
operations have completed.
To force a reset of the trigger mechanism set the TriggerEnable to False until TriggerReady is also set to False. Then,
TriggerEnable can be set to True to re-enable acquisition.
As a special case, an acquisition can be cancelled by clearing the Trigger signal before the read operation has
completed. This allows for the cancellation of reads in Presentation and Manual mode if no code is in the field of view. To
ensure that a read is not unintentionally cancelled, it is advised that the PLC hold the Trigger signal True until both
TriggerAck and ResultsAvailable are True (or DecodeComplete toggles state).
                                                             125
                                                                                             Industrial Network Protocols
Results Buffering
There is an option to enable a queue for read results. If enabled, this allows a finite number of sets of result data to be
queued up until the PLC has time to read them. This is useful to smooth out data flow if the PLC slows down for short
periods of time.
Also, if result buffering is enabled the reader will allow overlapped acquisition and decode operations. Depending on the
application this can be used to achieve faster overall trigger rates. See the Acquisition Sequence description for further
details.
In general, if reads are occurring faster than results can be transferred to the PLC, some data will be lost. The primary
difference between buffering or not buffering determines which results get discarded. If buffering is not enabled, the most
recent results are kept and the earlier result (which was not read by the PLC quickly enough) is lost. The more recent
result will overwrite the earlier result. If buffering is enabled (and the queue becomes full) the most recent results are
discarded until room becomes available in the results queue.
    Note: If the queue overflowed and then buffering is disabled, there will be a greater than 1 difference between the
    TriggerID and ResultID values. This difference represents the number of reads that occurred but could not be
    queued because the queue was full (number of lost reads equals TriggerID - ResultID - 1). After the next read, the
    ResultID value returns to the typical operating value of TriggerID - 1.
SoftEvents
SoftEvents act as virtual inputs. When the value of a SoftEvent bit changes from 0 to 1, the action associated with the
event is executed. When the action completes, the corresponding SoftEventAck bit changes from 0 to 1 to signal
completion.
The SoftEvent and SoftEventAck form a logical handshake. After SoftEventAck changes to 1, make sure that the original
SoftEvent is set back to 0. When that occurs, SoftEventAck is automatically set back to 0.
                                                            126
                                                                                                Industrial Network Protocols
    Note: Do not execute SoftEvents that change the reader configuration at the same time that reads are being
    triggered. Changing configuration during acquisition/decode can lead to unpredictable results.
The “ExecuteDMCC” and “SetMatchString” SoftEvent actions require user supplied data. Make sure that this data is
written to the UserData and UserDataLength area of the Input Data block prior to invoking the SoftEvent. Only one
SoftEvent can be invoked at a time, because both of these SoftEvents depend on the UserData.
String Commands
The DataMan Modbus TCP Protocol implementation includes a String Command feature. This feature allows you to
execute string-based DMCCs. The DMCC is sent to the reader through the String Command block. The DMCC result is
returned through the String Command Result block. Initiating a command and notification of completion is accomplished
by signaling bits in the Control and Status blocks.
To execute a DMCC, the command string is placed in the data field of the String Command block. The command string
consists of standard ASCII text. The same command format is used for a serial (RS-232) or Telnet connection. The string
does not need to be terminated with a null character. Instead, the length of the string, that is, the number of ASCII
characters, is placed in the length field of the String Command block.
After executing the DMCC, the result string is returned in the String Command Result block. Similar to the original
command, the result string consists of ASCII characters in the same format as returned through a serial or Telnet
connection. Also, there is no terminating null character. Instead, the length of the result is returned in the Command
String Result length field. The Command String Result block also contains a numeric result code. This allows you to
determine the success or failure of the command without having to parse the text string. The values of the result code are
defined in the DMCC documentation, available through the Windows Start menu or the Setup Tool Help menu.
Examples
Included with the DataMan Setup Tool installer are two example PLC programs created with CoDeSys v2.3 software.
These samples are designed and tested on a Wago 750-841 PLC. These programs demonstrate the DataMan ID
readers’ capabilities and proper operation. You can do the same operations by using more advanced features and
efficient programming practices with Wago PLCs. The examples try to show different approaches in the techniques used
for the communication to the DataMan reader and they are better for demonstration purposes.
                                                              127
                                                                                                 Industrial Network Protocols
    Note: All examples are designed to work only if the “Control” datablock is mapped to the Coil space and the
    “Status” datablock is mapped to the Discrete Input space.
ApplicationLayer Example
This sample realizes a generic data transfer between the DataMan reader and the PLC. Memory areas of the “Control”,
“Status” and “Output Area” are cloned in the PLC and synchronized cyclically, or as needed. Each data area is
synchronized with its own instance of “ETHERNETMODBUSMASTER_TCP”. This causes three TCP connections to be
open simultaneously. Make sure that the Modbus TCP related setting “Maximum Connections” on the DataMan reader is
set to at least 3 for this example to work.
Function
The example application demonstrates the following operations:
   1. Transfer the 32-bit “Control” register data from the PLC to the reader.
   2. Transfer the 32-bit “Status” register data from the reader to the PLC.
   3. Transfer “Output Data” from the reader to the PLC.
    Note: No synchronization is implemented from the reader to the PLC, so the local PLC data can be incorrect after
    building up the connection or if another Modbus TCP client manipulates the Contol register simultaneously. There
    is a timeout setting that can lead to a disconnect if you do not manipulate the “Control” register during this
    timeframe.
DataManControl Example
This sample shows in a sequential manner the steps to do to achieve one of the functions named in the following
subsection. To outline this chronological sequence, “Sequential Function Chart” is used as programming language.
Function
The example application demonstrates the following operations:
   1. Triggering a read
   2. Getting read results
   3. Executing string commands (DMCC)
                                                              128
                                                                                             Industrial Network Protocols
The “Main” program contains variables to invoke each of these operations. The operation is invoked by toggling the
control bool directly or from the visualization (red=0, green=1) from 0 to 1. This will invoke the associated subroutine to
perform the operation. When the operation 4 is complete, the subroutine will set the control bit back to 0.
Triggering a Read
The example provides a “Continuous Trigger”. As the name implies, enabling the “xTrigger” bit will invoke a continuous
series of read operations. Once enabled, the “xTrigger” control bit will remain set until you disable it.
Primarily, the trigger subroutine manages the trigger handshake operation between the PLC and the reader. The control
Result Ack and Trigger bits are reset, the Trigger Enable bit is set, the PLC waits for the corresponding TriggerReady
status bit from the reader, and the control Trigger bit is set. Refer to a description of handshaking in section Operation.
Execute SoftEvents
SoftEvents are used to invoke a predefined action. Each SoftEvent is essentially a virtual input signal. Each of the
SoftEvent subroutines manages the handshake operation between the PLC and the reader to invoke the predefined
action. The associated action is invoked when the SoftEvent bit toggles from 0 to 1. The subroutine then watches for the
associated SoftEventAck bit from the reader which signals that the action is complete. For a description of handshaking,
see section Operation.
                                                            129
                                                                                        Industrial Network Protocols
Note: The “Execute DMCC” and “Set Match String” SoftEvents make use of the Input Data block. The subroutine for
these two events copies the relevant data into the User Data fields of the Input Data block and then invokes the
User Data subroutine to transfer the data to the reader. Only after the user data is transferred is the actual SoftEvent
action invoked. It is required that the user data be transferred before invoking either of these events.
Note: The “Train Match String” SoftEvent only prepares the training mechanism. The actual training occurs on the
next read operation. Therefore, a trigger must be issued following “Train Match String”.
                                                        130
                                                                        Industrial Protocols for the Wireless DataMan
    l   powered down
    l   in hibernation mode
    l   physically out of range
Automatic power down and hibernation are features that preserve power and extend the time period between
recharging.
The following sections detail the necessary configurations you have to set to communicate with the DataMan base
station (through which information is routed to the DataMan wireless reader).
Protocol Operation
Because the wireless reader can become unavailable at times, the Industrial Ethernet protocols are actually run from the
base station. The base station is directly wired to the Ethernet network and is online continuously (even when the reader
is unavailable). In this way the Ethernet protocol operation is not disrupted when the reader is unavailable. This results in
a few special considerations.
Ethernet Address
Because the Ethernet protocols are run from the base station, you must use the base station Ethernet address when
configuring the protocol. For example, when configuring EtherNet/IP using the RSLogix5000 software package, you
select the DM8000 reader but you must enter the IP address of the base station (not the reader). The PLC using the
protocol must communicate with the base station.
PLC Triggering
Because the wireless reader can become unavailable at times, triggering from the PLC is not supported on wireless
readers. The PLC will receive all read results triggered from the reader. Also, SoftEvents and DMCC commands are
supported (when the reader is available).
SoftEvents
SoftEvents triggered from the PLC are supported. However, these events will fail if the reader is unavailable. Such a
failure will be signaled by the ‘General Fault’ bit.
    Note: Some operations assigned to SoftEvents are in general not supported on any handheld DataMan readers (for
    example, ‘Train Code’, ‘Train Focus’, ‘Train Brightness’). Unsupported operations will also result in the ‘General
    Fault’ signal being set.
DMCC
DMCC commands issued from the PLC are supported. However, these events will fail if the reader is unavailable.
Depending on which Industrial Ethernet protocol is in use, the failure will be signaled either with the ‘General Fault’
                                                            131
                                                                           Industrial Protocols for the Wireless DataMan
signal or an error status return code. The new DMCC error return code ‘105’ has been established to signal that the
reader is unavailable.
    Note: When issuing DMCC commands from the PLC to a wireless reader, do not change the DMCC response
    format (that is, do not issue the command ‘COM.DMCC-RESPONSE’). Doing this may disable DMCC operation on
    the wireless reader. This command can be used on non-Industrial Ethernet connections such as Telnet.
Offline Buffering
When the wireless reader is physically out of range of the base station, it will automatically buffer all reads. Buffer
capacity varies according to a number of factors. However, typically several hundred reads can be stored. These
buffered reads are also preserved if the reader enters hibernation (sleep mode). When the reader is brought back into
range of the base station the buffered reads will automatically be downloaded.
If this offline buffering situation is anticipated in the user application, then Industrial Ethernet protocol buffering should
also be enabled. Protocol buffering will allow a PLC to control the rate that read results are returned to the PLC. This
prevents the PLC from becoming overwhelmed by a rapid flow of read results. Refer to the specific Industrial Protocol
section of this document for details of enabling and utilizing protocol buffering.
                                                              132
                                                                     Industrial Protocols for the Wireless DataMan
                                                         133
                       Copyright © 2020
Cognex Corporation. All Rights Reserved.