PROFINET 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.

General Fault Indicator

When a communication related fault occurs the “GeneralFault” bit will change from 0 -> 1. Currently the only fault conditions supported are SoftEvent operations. If a SoftEvent operation fails, the fault bit will be set. The fault bit will remain set until the next SoftEvent operation or until triggering is disabled and again re-enabled.

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.

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.

Decode / Result Sequence

After an image is acquired, it is decoded. When the decoding is complete and a result is ready to be delivered, the reader toggles the DecodeComplete bit of the DecodeStatusRegister.

Decode results are reported asynchronously to the Result Status module. If BufferResultsEnable is set to False, then the decode results are immediately placed into DecodeResults, and the Results Available bit is set to True.

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 value of the Decoding bit is always the same as the Acquiring bit. Set when acquiring and decoding an image. The value of the Decoding bit is always the same as the Acquiring bit.
1 Decode Complete Toggled on completion of an image decode. Toggled on completion of an image decode.
2

Results Buffer

Overflow

Remains set to zero. Set when decode results could not be queued because the client failed to acknowledge a previous result. Cleared when the decode result is successfully queued.
3 Results Available Set when new results are placed in the Results Module. Stays set until the results are acknowledged by setting Results Ack to true. Set when new results are placed in the Results Module. Stays set until the results are acknowledged by setting Results Ack to true.

Results Buffering

The Results Buffering feature allows a queue for decode results. When enabled, the feature queues a finite number of result data sets until the PLC (client) has time to read them. This smooths out data flow if the PLC slows down for short periods or if there are surges in read activity.

If the feature is enabled, the reader overlaps acquisition and decode operations. This can lead to faster over all trigger rates. When reads occur faster than results can be sent out (the queue is full), the most recent results are discarded until space becomes available in the results queue.

If the feature is disabled, the more recent results overwrite the earlier results. The most recent results are kept. Earlier results are discarded if the PLC does not read them fast enough.

If the queue overflows while the feature is disabled:

  • The difference between the TriggerID and ResultID values becomes greater than 1. This difference represents the number of reads that occurred but could not be queued because the queue was full.

  • The number of lost reads equals TriggerID - ResultID - 1.

  • After the next read, the ResultID value returns to the typical operating value of TriggerID - 1.

Result Fragmentation

The Result Fragmentation feature splits decode result strings into fragments if the strings are too large for the Results Data field. The fragments are then pushed to the buffer like normal results. Then, the PLC reads the fragments one by one.

Result Fragmentation depends on Result Buffering. This means that results are only fragmented if Result Buffering is enabled.

Note: For PROFINET, the Result Fragmentation feature is automatically enabled when you enable Results Buffering.

Enabling Results Buffering and Result Fragmentation for PROFINET

To enable Results Buffering and Result Fragmentation, you have the following options:

  • Use the FFP.RESULT-FRAG DMCC.

  • Use SoftEvent 6 to enable the features from the PLC.

To enable results buffering, set the Results Buffer Enable bit in the Results Control Module to 1. When the ResultsAvailable bit in the Results Status Module is set to 1, follow the instructions below depending on the length of the Result Length.

Result Length Larger Than Result Data Module Size

If the Result Length is larger than the Result Data Module size set in the PLC, then there are additional fragments of the decode string to be sent to the PLC. Proceed with the following steps:

  1. Read the initial data, which is the first fragment of the decode string equal to the Result Data Module size set in the PLC.

  2. Set the ResultsAck bit in the Results Control Module to 1 to acknowledge reading. As a result, the ResultsAvailable bit in the Results Status Module goes to 0.

  3. Set the ResultsAck bit in the control object to 0 again. As a result:

    • The ResultAvailable bit in the Results Status Module goes back to 1.

    • The Result Length decreases to show the remaining bytes to be read.

    • The ResultID in the Inspection Result Data Module stays the same because the fragments are all part of the same decode string.

  4. Repeat the steps above until the Result Length is smaller than the size of the Decode Results Module.

Result Length Smaller Than Result Data Module Size

If the Result Length is smaller than the Result Data Module size set in the PLC, proceed with the following steps:

  1. Read the data, which is the first set of buffered results.

  2. Set the ResultsAck bit in the Control Module to 1 to acknowledge reading. As a result, the ResultsAvailable bit in the Status Module goes to 0.

  3. Set the ResultsAck bit in the Results Control Module to 0 again. As a result:

    • The ResultAvailable bit in the Results Status Module goes back to 1.

    • The ResultID in the Inspection Result Data Module increments, indicating that a new decode string has been sent to the PLC.

    • The Result Length now contains the length of the remaining data of the full code: last length - the Result Data Module size set in the PLC.

  4. Read the remaining data.

  5. If not finished, repeat the handshaking between ResultsAvailable and ResultsAck to acknowledge the remaining results, until all results have been read.

Operation of Result Fragmentation

The PLC does not automatically reassemble the result string. Once the PLC reads a result fragment, you have to copy the fragment to a new user-defined variable. After this, you have to set and clear the ResultAck bit, which updates the Decode Results with the next fragment. This process continues until all fragments have been sent to the PLC.

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.

Identifying Decode Result Chunks

Decode result fragments look like normal results. To identify result fragments, look at the Result ID:

  • The Result ID of the result fragments are the same.

  • The Result ID of the last result fragment is different from the Result ID of the next result.

The Result Length of the result fragments represents the amount of data left to be sent.

  • The Result Length of the result fragment is lower or equal to the Result Buffer Size.

  • When the Result Length equals 0, there are no more fragments left for that decode result.

Maximum Result Data Length

Without results fragmentation, result data is truncated to fit into the results data buffer size. Depending on the protocol, the result buffer size can be fixed or configurable.

The Result Fragmentation feature allows processing of up to 50 times longer results, depending on the results buffering queue size, with an absolute limit of 65535 characters.

The maximum number of result characters for PROFINET is 246 bytes(using the largest result data module).

DMCC Result Feedback from PLC

The DMCC Result Feedback feature allows the reader to send DMCC responses back to the PLC.

By default, this feature is off. If enabled, the reader sends DMCC responses to the PLC using the same mechanism as for read results. To distinguish DMCC results from read results, bit 6 is flagged in the ResultCode field.

To enable the feature, use the FFP.DMCC-RESULTS command. Changing this configuration does not require you to reboot or reconnect reader.

You can use DMCC Result Feedback in combination with Results Fragmentation.