PLC Workflow
  • 05 Aug 2024
  • 5 Minutes to read
  • Dark
    Light
  • PDF

PLC Workflow

  • Dark
    Light
  • PDF

Article summary

This article applies to these versions of LandingLens:

LandingLensLandingLens on Snowflake

You can use Programmable Logic Controllers (PLCs) to communicate with LandingEdge. For example, you can configure the system so that the PLC tells LandingEdge when to take a photo, and then LandingEdge tells the PLC what the results were.

Note:
If using an industrial camera, you can configure a PLC to trigger image capture. To learn how to set up industrial cameras in LandingEdge, go to GenICam and GigE Vision Cameras.

Supported Controllers

LandingEdge is compatible with the following PLCs:

  • Rockwell CompactLogix controllers
  • Rockwell ControlLogix controllers
  • Controllers that use the Open Platform Communications Unified Architecture (OPC UA) protocol

Set Up Inspection Points for PLCs

To set up Inspection Points when using a PLC with LandingEdge, follow the instructions below:

  1. Create an Inspection Point.
    Note:
    You can set up multiple configurations for each Inspection Point. For more information, go to Configurations.
  2. Select your Image Source.
    If you want the PLC to trigger the inspection start and you are capturing images with a connected industrial camera, select GigE Vision Camera or GenICam and then select your camera.
    Select Your Image Source
  3. Select your Inspection Start method.
    If using an industrial camera, select PLC. Make sure you configure your PLC to start inspections. This will vary based on your PLC device.
    Select Which Mechanism Should Trigger LandingEdge to Start Inspection
  4. Set up the Cloud Connection and Model settings.
    Connect to a Deployed Model from LandingLens
  5. Complete the following steps in the Communication section.
  6. Select your PLC Type.
    Select Your PLC Type
  7. Enter the IP address of the controller in the Address field.
    • For Rockwell controllers, use this format: [IP Address]/[Slot Number].
      Example: 192.168.1.5/0. (If there's no slot number, omit it.)
    • For OPC UA controllers, use this format: opc.tcp://[IP Address]:4840.
      Example: opc.tcp://192.168.1.10:4840.
      Enter the Address for Your Device
  8. Click Set and set up the Inputs and Outputs, which are the data points that LandingEdge and the PLC can share with each other.
    To enable a data point to be shared, enter the PLC Tag or Tag Address in the Tag/Address field for that data point. (For information about how to program your PLC, refer to the device's documentation from the manufacturer.)
    Select the Information You Want LandingLens and the PLC to Communicate
  9. (Optional) Set up Image Saving settings.
  10. (Optional) Set up Other Settings settings.
  11. (Optional) Set up Custom Processing.

Inputs

Use the Inputs settings to configure the signals that the PLC emits to LandingEdge.  

To enable a data point to be shared, enter the PLC Tag or Tag Address in the Tag/Address field for that data point. (For information about how to program your PLC, refer to the device's documentation from the manufacturer.)

The following table describes the configurable outputs.

InputDescriptionPaired OutputData Type
TriggerTakes images immediately when the Trigger goes from Low to High (False to True).Trigger ReadyBool
Results AckConfigure the PLC to set this setting to High (True) to indicate results and errors from LandingEdge have been received. When LandingEdge receives this signal, it resets the result signals and is ready to start the cycle again.
Results Ready, ErrorBool
Request Sub-Configuration IndexThe PLC can tell LandingEdge to change to a different Inspection Point configuration. Use the configuration Index, and not the configuration name.

If you're not using multiple configurations for an Inspection Point, leave this blank.

Available in LandingEdge v2.6.45 and later.
Current Sub-Configuration Index
DINT
Note:
Refer here to understand the signals emitted by LandingEdge and the PLC:
  • True/High: Indicates that the value is on.
  • False/Low: Indicates that the value is off.

Outputs

Use the Outputs settings to configure the signals that LandingEdge emits to the PLC.

To enable a data point to be shared, enter the PLC Tag or Tag Address in the Tag/Address field for that data point. (For information about how to program your PLC, refer to the device's documentation from the manufacturer.)

The following table describes the configurable outputs.

OutputDescriptionPaired InputData Type
Trigger ReadyIndicates LandingEdge is ready to receive the trigger to capture and process an image.Trigger
Bool
Results ReadyIndicates inference is complete and results are ready on the output signals to be read by the PLC.Results Ack
Bool
Results OKIndicates the image is good. This is the default result if you are running a Classification Model.N/ABool
Results NGIndicates that the image is not good. An Error output will also be present.N/A
Bool
ClassificationThis option is only for Classification Models. Indicates the predicted Class ID.

If there is no image, the value is -1.
N/A
DINT
ErrorIndicates an error occurred during acquisition or processing. Check the Error Code for more details. A Results NG output will also be present.

To clear the error, assert the Results Ack input.
Results Ack
Bool
Error CodeIndicates what kind of error occurred in the DINT data type. 
  • All 0 bits: No error
  • A 1 in bit 0: Non-specific error
  • A 1 in bit 1: Timeout during acquisition
  • Bits 2-31: Reserved for future use
N/A
DINT
Online/ReadyIndicates LandingEdge is running.N/A
Bool
HeartbeatLandingEdge toggles the value from True to False every 1 second. This allows the PLC to check if LandingEdge is still functioning and that the connection between the PLC and LandingEdge still exists.
N/A
Bool
BusyIndicates LandingEdge is processing.N/A
Bool
Current Sub-Configuration IndexLandingEdge tells the PLC the Index of the Inspection Point configuration that is currently running.

If you're not using multiple configurations for an Inspection Point, leave this blank.

Available in LandingEdge v2.6.45 and later.
Request Sub-Configuration Index
DINT
Note:
Refer here to understand the signals emitted by LandingEdge and the PLC:
  • True/High: Indicates that the value is on.
  • False/Low: Indicates that the value is off.

Example Setup of LandingEdge and a PLC

The following example workflow shows how setting up the Inputs and Outputs enable LandingEdge and the PLC to work together. 

The example assumes that these Inputs and Outputs are set up:

InputSet Up
Trigger
Results Ack
Request Sub-Configuration Index


OutputSet Up
Trigger Ready
Results Ready
Results OK
Results NG
Classification
(if using a Classification model)
Error
Error Code
Online/Ready
Heartbeat
Busy
Current Sub-Configuration Index

Example Workflow

  1. LandingEdge indicates that it is Online.
  2. LandingEdge is ready and asserts Trigger Ready (True).
  3. The PLC asserts Trigger (True) based on the set configurations. LandingEdge receives this signal and recognizes it is time to take an image.
  4. LandingEdge changes Trigger Ready to False. The PLC receives this signal and recognizes that LandingEdge acknowledged the Trigger.
  5. LandingEdge asserts Busy (True) to indicate that it cannot be triggered again. The PLC can monitor this signal.
  6. After LandingEdge has received and processed an image, Result OK is set to True and Result NG is set to False.
    • If using a Classification model, Classification is set to the predicted Class ID.
    • If an error occurs, Error is set to True.
  7. After the Results are set, LandingEdge asserts Results Ready (True) to indicate that results are available for the PLC to read.
  8. The PLC recognizes that Results Ready or Error is set to True.  It reads the appropriate values—like Results OK, Results NG, and Classification—to determine the final prediction from the model. 
  9. After the PLC reads the results, it asserts Results Ack. LandingEdge receives this signal and recognizes that the PLC has read the results and the cycle is complete.
  10. LandingEdge resets the result signals and is ready to initiate the cycle again (starting from step 2).

Was this article helpful?