Industrial Protocols Manual
Industrial Protocols Manual
Protocols Manual
2024 January 04
Revision: 24.1.0.2
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 © 2023. 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 6
About This Manual 7
Industrial Network Protocols 8
EtherNet/IP 8
DMCC 8
Reader Configuration Code 9
Setup Tool 9
Getting Started 10
Object Model 14
Attributes 15
SoftEvents 16
PROFINET 36
DMCC 36
Reader Configuration Code 36
Setup Tool 37
Getting Started 37
Object Model 41
Modules 41
Operation 46
SIMATIC Examples 49
TIA Portal Examples 61
PROFINET Class B 69
PLC Changes 70
iQ Sensor Solution 72
DMCC 73
Reader Configuration Code 73
Setup Tool 74
Overview 74
Discovering DataMan Readers on GX Work2 74
Monitoring the status of the DataMan Reader 75
List of iQSS Error Codes: 76
3
Table of Contents
SLMP Protocol 82
DMCC 82
Reader Configuration Code 82
SLMP Protocol Scanner 83
Getting Started 83
Network Configuration 84
Data Block Configuration 85
Interface 86
Control Block 87
Status Block 88
Operation 91
Examples 95
ModbusTCP 99
DMCC 99
Reader Configuration Code 99
Setup Tool 100
Modbus TCP Handler 100
Getting Started 100
Network Configuration 101
Data Block Configuration 102
Interface 103
Control Block 103
Control Block Field Descriptions 104
Status Block 105
Status Block Field Descriptions 105
Input Data Block 106
Input Data Block Field Descriptions 106
Output Data Block 107
Output Data Block Field Descriptions 107
String Command Block 107
String Command Block Field Descriptions 108
String Command Result Block 108
4
Table of Contents
Operation 108
Requests 108
Typical Sequence Diagram 109
Handshaking 109
Acquisition Sequence 109
Decode / Result Sequence 110
Results Buffering 111
SoftEvents 111
String Commands 112
Examples 112
ApplicationLayer Example 113
DataManControl Example 113
5
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.
6
About This Manual
The DataMan Industrial Protocols Manual provides information on how to integrate the DataMan reader into your particular
environment using industrial protocols.
7
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 115
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:
8
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.
9
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:
l Install the Rockwell Software tool.
l Set up the Rockwell Software tool so that it recognizes your DataMan device.
l Install the DataMan Electronic Data Sheet (EDS) for the DataMan reader.
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.
10
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.
11
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.
12
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.
13
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.
14
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:
15
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.
16
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.
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.
17
Industrial Network Protocols
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:
l access the Acquire Service in a single step, or
l directly manipulate the ID Reader object attributes (AcqTrigger and AcqStatusRegister), or
l use DMCC commands.
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).
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.
18
Industrial Network Protocols
The reader allows acquisitions to overlap with the decoding of previous acquisitions. The Trigger Ready bit is set high after
the acquisition is complete, while decoding may still be in progress. The Decoding bit is deprecated and only mirrors the
behavior of the Acquiring bit. If trigger queuing is active or other trigger sources can interfere, the Trigger Ready bit may not
be reliable. As result, conflicting trigger overruns may occur, which are reported in Bit 3 of the ResultCode attribute of the ID
Reader object.
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.
Note: The only way to ensure that you are not losing results is to use BufferResults. Make sure that your application can
read each DecodeResult in time if you do not use BufferResultsEnable.
If the BufferResultsEnable attribute is set to True, the new results are queued. The earlier decode results remain in the
DecodeResults attribute until they are acknowledged by the client setting the ResultsAck attribute to True. After the Results
Available bit is cleared, the client sets the ResultsAck attribute back to False to allow the next queued results to be placed in
to the DecodeResults attribute. This is a necessary handshake to ensure that the DataManreader's client, the PLC, receives
the results, even if short gaps occur between results.
Behavior of DecodeStatusRegister
Bit Bit Name Results if Buffering Disabled Results if Buffering Enabled
1 Decoding Set when acquiring and decoding an image. Set when acquiring and decoding an image. The value
The value of the Decoding bit is always the of the Decoding bit is always the same as the Acquiring
same as the Acquiring bit. bit.
2 Decode Toggled on completion of an image decode. Toggled on completion of an image decode.
Complete
19
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 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.
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
20
Industrial Network Protocols
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.
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 Decoding1
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.
1 The value of the Decoding bit is identical to the value of the Acquiring bit. Both bits are true if an acquisition, or series of acquisitions of the
same trigger, is in progress.
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
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).
22
Industrial Network Protocols
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 icon
and select New Module... from the menu:
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.
23
Industrial Network Protocols
Note: The rest of the steps is identical regardless of which DataMan model is selected.
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.
24
Industrial Network Protocols
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)
25
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
l Major Revision has to match
l The Minor Revision of the module has to be equal to or greater than the one specified in the software.
Disable Keying – The controller does not employ keying at all.
Connection: Defines the type of data flow.
Data (Bidirectional) – The connection sends data to the DataMan and receives data from the DataMan.
Input (Results only) – The connection only receives data from the DataMan. If more than one PLC needs to receive
data from the same DataMan device, choose the Input connection option.
Input Results from Sensor: Defines the amount of data received on the connection from the DataMan. The
minimum amount is the Status data only. The connection can be configured to also receive read result data. The
amount of result data received is defined in fixed increments (16 bytes, 32 bytes, 64 bytes, and so on). Select the size
to return no more than the largest code size to be read by the application. Setting the size larger wastes network
bandwidth and diminishes performance.
26
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.
6. Select the “Connection” tab of the “New Module” dialog to set the rate.
27
Industrial Network Protocols
7. After adding the module to ControlLogix, the I/O tree should appear as follows:
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.
28
Industrial Network Protocols
The generated tags are divided into 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.
Status tag group is the data the ControlLogix receives from the DataMan reader:
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 DataManreader misses an acquisition trigger. This happens when trigger on through
the Trigger On bit of Ethernet/IP fails. It is cleared when the next successful acquisition occurs.
l Decoding: Deprecated. Same behavior as Acquiring.
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. Currently only used by Soft Event operations.
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.
29
Industrial Network Protocols
l TriggerID: Value of the next trigger to be issued. Used to match triggers issued with corresponding result data
received later.
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.
l No acquisition/decode is currently in progress.
l The device is ready to trigger.
l ResultsBufferEnable: When set, the decode results are queued. Results are made available each time the PLC
acknowledges the current results. The Decode ID, Decode Result and Decode ResultsData fields are held constant
until the ResultsAck field acknowledged and set them. The DataMan reader responds to the acknowledgment by
clearing the ResultsValid bit. Once the ResultsAck field is cleared, the next set of decode results are posted.
l ResultsAck: The ResultsAck tag is used to acknowledge that the PLC read the latest results. When ResultsAck is
set, the ResultsAvailable tag will be cleared. If results buffering is enabled, the next set of results are made available
when the ResultsAck tag is cleared again.
l TrainCode: Changing this tag from 0 to 1 invokes the train code operation.
l TrainMatchString: Changing this tag from 0 to 1 invokes the train match string operation.
l TrainFocus: Changing this tag from 0 to 1 invokes the train focus operation.
30
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: Optional user data information. For more information, see the PROFINET documentation.
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.
31
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.
32
Industrial Network Protocols
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.
33
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”.
34
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”.
35
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 115
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.
36
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.
Perform the following steps to set up PROFINET using SIMATIC or TIA Portal:
37
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.
38
Industrial Network Protocols
39
Industrial Network Protocols
40
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:
41
Industrial Network Protocols
42
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.
1 The value of the Decoding bit is identical to the value of the Acquiring bit. Both bits are true if an acquisition, or series of acquisitions of the
same trigger, is in progress.
43
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.
44
Industrial Network Protocols
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
45
Industrial Network Protocols
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 hardwired 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.
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.
46
Industrial Network Protocols
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.
The reader allows acquisitions to overlap with the decoding of previous acquisitions. The Trigger Ready bit is set high after
the acquisition is complete, while decoding may still be in progress. The Decoding bit is deprecated and only mirrors the
behavior of the Acquiring bit. If trigger queuing is active or other trigger sources can interfere, the Trigger Ready bit may not
be reliable. Conflicting trigger overruns are reported in the Result Code bit of the Result Data module.
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.
Note: The only way to ensure that you are not losing results is to use BufferResults. Make sure that your application can
read each DecodeResult in time if you do not use BufferResultsEnable.
If the Results Buffer Enable bit is set to True, the new results are queued. The earlier decode results remain in the Results
Module until the client acknowledges them by setting the “Results Ack” bit to True. After the Results Available bit is cleared,
make sure that the client sets the Results Ack bit back to False to allow the next queued results to be placed into the Results
Module. This is a necessary handshake to ensure the results are received by the DataMan client (PLC), even if short gaps
occur between results.
Behavior of DecodeStatusRegister
Bit Bit Name Results if Buffering Disabled Results if Buffering Enabled
0 Decoding Set when acquiring and decoding an image. The Set when acquiring and decoding an
value of the Decoding bit is always the same as image. The value of the Decoding bit
the Acquiring bit. is always the same as the Acquiring
bit.
47
Industrial Network Protocols
Results Buffering
There is an option to enable a buffer for decode results. If enabled, this allows a finite number of decode result data to queue
up in the buffer until the client (PLC) has time to read them.
If reads are occurring faster than results can be sent out, the primary difference between buffering or not buffering is which
results get discarded. If buffering is not enabled, the more recent result overwrites the earlier result. If Results Buffering is
enabled and the queue is full, the most recent results are discarded until space becomes available in the results queue.
Results buffering helps to smooth the data flow if the client (PLC) slows down for periods of time, or if there are surges of read
activity.
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.
48
Industrial Network Protocols
Results Fragmentation
Results Fragmentation is a PROFINET feature that is automatically enabled together with Results Buffering. This feature
splits decode result strings into chunks if the strings are too large for the Results Data field. The chunks are pushed to the
buffer like normal results. Then, the PLC can read the chunks one by one and reassemble the decode result string.
In contrast, if Results Buffering is disabled, large decode result strings are cut off to fit into the Results Data field, which
means that the end of the string gets lost.
A decode result chunk looks like a normal result. The Result Length represents the remaining number of result characters.
The last chunk of a Decode Result string can be found as follows:
l Its Result Length is lower or equal to the Result Buffer size.
l Its Result ID is different from the ID of the next result.
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….
49
Industrial Network Protocols
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.
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.
50
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.
51
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.
52
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.
53
Industrial Network Protocols
Note: This sample can be used with any PROFINET enabled DataMan reader.
54
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.
55
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.
56
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.
57
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.
58
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:
59
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.
60
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.
61
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.
62
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.
63
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.
64
Industrial Network Protocols
11. Check the checkbox next to the device image and connect the selected device with the PLC by drawing a line with
your mouse.
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.
65
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.
66
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.
67
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:
68
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.
PROFINET Class B
Upgrading a DataMan reader to firmware version 6.1.7 or higher installs a new PROFINET stack, adding support for
PROFINET Class B. While this adds new functions and capabilities, it is not a drop-in replacement for a DataMan reader
69
Industrial Network Protocols
running the Class A stack, which all previous versions of DataMan firmware supported. You need to update the hardware
configuration in the TIA software.
If you add new DataMan readers to an existing system that has other DataMan products, both GSD files need to be installed.
Refer to the table for which GSD file to use with a given reader.
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:
l 1.3.6.1.2.1.1.4.0 (sysContact, defaults to “Someone <[email protected]>”)
l 1.3.6.1.2.1.1.5.0 (sysLocation, defaults to “somewhere”)
l 1.3.6.1.2.1.1.6.0 (sysName, defaults to “something”)
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 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.
70
Industrial Network Protocols
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.
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 <version>\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:
71
Industrial Network Protocols
4. Expand the catalog in the TIA Portal software, select the “CC-B” version and add it to your configuration. For
example, “DataMan 470 CC-B”.
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:
l IP address and subnet mask
l The selected industrial protocol (SLMP, CC-Link IE Field Basic, or None).
l SLMP scanner parameters and device address mappings
Disabling iQSS blocks any attempts to remotely get or set these device settings.
72
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.
73
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 or later versions.
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.
74
Industrial Network Protocols
4. Navigate to the Cognex DataMan Language Package (English = CognexInsight_en.ipar; Japanese = CognexInsight_
ja.ipar), and click Register.
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.
3. Click OK; the Status of readers connected to the Built-in Ethernet port LCPU will be displayed on the Sensor/Device
Monitor window.
75
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
76
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
77
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 set
Enable 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
78
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 Deprecated. The value of the Decoding bit is always the same as the Acquiring bit.
79
Industrial Network Protocols
80
Industrial Network Protocols
81
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 115.
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.
82
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.
83
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.
Network Configuration
The network configuration defines all the information that the DataMan reader needs to establish a connection with a PLC.
84
Industrial Network Protocols
85
Industrial Network Protocols
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:
l Control and Status
l PLC Input and PLC Output
l Command and Command Response
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.
86
Industrial Network Protocols
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 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 to 1, it
clears the ResultsAvailable bit. This forms a logical handshake between the PLC and reader. If
result buffering is enabled, the acknowledgement will cause the next set of queued results to be
moved from the buffer. See section Operation for a description of the acknowledgement
handshake sequence.
4-15 Reserved Reserved for future use.
16 SetUserData Set by the PLC to signal that new UserData is available. After reading the new UserData, the
reader sets Set UserDataAck to signal that the transfer is complete. This forms a logical
handshake between the PLC and reader.
17 Initiate Set by the PLC to signal that a new StringCommand is available. After processing the
StringCmd command, the reader sets StringCmdAck to signal that the command result is available. This
forms a logical handshake between the PLC and reader.
18-23 Reserved Future use
87
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.
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 Deprecated. The value of the Decoding bit is always the same as the Acquiring bit.
88
Industrial Network Protocols
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
89
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.
90
Industrial Network Protocols
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.
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.
91
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 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.
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
92
Industrial Network Protocols
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.
The reader allows acquisitions to overlap with the decoding of previous acquisitions. The Trigger Ready bit is set high after
the acquisition is complete, while decoding may still be in progress. The Decoding bit is deprecated and only mirrors the
behavior of the Acquiring bit. If trigger queuing is active or other trigger sources can interfere, the Trigger Ready bit may not
be reliable. As result, conflicting trigger overruns may occur, which are reported in Bit 3 of the Result Code word of the Output
Data Block.
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).
Note: The only way to ensure that you are not losing results is to use BufferResults. Make sure that your application can
read each DecodeResult in time if you do not use BufferResultsEnable.
93
Industrial Network Protocols
If ResultsBufferEnable is set to True, the new results are queued in a buffer and DecodeComplete is toggled. The earlier read
results remain in the Output Data block until the PLC acknowledges them. After the acknowledgment handshake, if there are
more results in the queue, the next set of results will be placed in the Output Data block and ResultsAvailable is set to True.
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.
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.
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.
94
Industrial Network Protocols
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 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
b. Train match string
c. Train focus
95
Industrial Network Protocols
d. Train brightness
e. Un-train
f. Execute DMCC
g. Set match string
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.
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.
96
Industrial Network Protocols
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.
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”.
97
Industrial Network Protocols
98
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 115
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.
99
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.
100
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.
101
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 will
Only Mode 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:
102
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:
l Control and Status
l Input Data and Output Data
l String Command and String Response
Control Block
The Control block contains bit type data. This block consists of the control signals sent from the PLC to the reader. It is used
by the PLC to initiate actions and acknowledge certain data transfers.
103
Industrial Network Protocols
104
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
8 Decoding Deprecated. The value of the Decoding bit is always the same as the Acquiring bit.
105
Industrial Network Protocols
9 Decode Complete Indicates new result data is available. Bit toggles state (0 -> 1 or 1 -> 0) each time
Toggle new result data becomes available.
10 Results Buffer Set to indicate that the reader has discarded a set of read results because the PLC
Overrun 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 command
Cmd Ack 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 remain
Ack 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
106
Industrial Network Protocols
1 User Data Length Number of bytes of valid data actually contained in the UserData field.
2..N User Data User defined data that may be used as an input to the acquisition/decode.
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.
107
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.
108
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.
109
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 and Decoding bits will be set to True. When the
acquisition is completed, the Acquiring and Decoding bits will be cleared. When the device is ready to begin another image
acquisition, the TriggerReady bit will again be set to True.
The reader allows acquisitions to overlap with the decoding of previous acquisitions. The Trigger Ready bit is set high after
the acquisition is complete, while decoding may still be in progress. The Decoding bit is deprecated and only mirrors the
behavior of the Acquiring bit. If trigger queuing is active or other trigger sources can interfere, the Trigger Ready bit may not
be reliable. As result, conflicting trigger overruns may occur, which are reported in Bit 3 of the Result Code word of the Output
Data Block.
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).
Note: The only way to ensure that you are not losing results is to use BufferResults. Make sure that your application can
read each DecodeResult in time if you do not use BufferResultsEnable.
If ResultsBufferEnable is set to True, the new results are queued in a buffer and DecodeComplete is toggled. The earlier read
results remain in the Output Data block until they are acknowledged by the PLC. After the acknowledgment handshake, if
there are more results in the queue, the next set of results will be placed in the Output Data block and ResultsAvailable is set
to True.
110
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.
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.
111
Industrial Network Protocols
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.
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.
112
Industrial Network Protocols
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.
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)
4. Executing SoftEvent operations
a. Train code
b. Train match string
c. Train focus
d. Train brightness
e. Untrain
f. Execute DMCC
g. Set match string
113
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.
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”.
114
Industrial Protocols for the Wireless DataMan
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’ signal or an error
status return code. The new DMCC error return code ‘105’ has been established to signal that the reader is unavailable.
115
Industrial Protocols for the Wireless DataMan
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.
116
Industrial Protocols for the Wireless DataMan
117
Copyright © 2023
Cognex Corporation. All Rights Reserved.