Sending Native Mode Commands Using EIP Explicit Messaging

In-Sight vision systems allow you to use EIP Explicit Messaging, specifically the CIP Generic Message type of the EEM or MSG instruction to send Native Mode commands. This allows server attribute access (get/set) and object specific service access (SendNativeCmd) to the Vision Object in the vision system. For more information, see Ethernet/IP Object Model.

How It Works

The SendNativeCmd (0x34) service sends Native Mode command strings to the In-Sight vision system. The request data for SendNativeCmd (for example, LFJobName.job) includes the Native Mode command string. If the command returns a string result, the reply data also contains the Native Mode command string.

Note: Different PLCs can have different methods of sending CIP Generic Messages.

Creating the Ladder Logic

The following steps describe how to create the ladder logic in the PLC using Rockwell Studio 5000, but the general procedure applies to all PLCs:

  1. Make sure that a Cognex module has been added to the PLC project.

  2. Create the necessary PLC tags:

    • nativeModeMessage - MESSAGE data type

    • command - contains the NativeMode command

    • response - contains the NativeMode response

    Note: Make sure that the command and response sizes are large enough to contain the data that you intend to send and receive.

  3. Add the MSG block to the ladder logic, and connect the nativeModeMessage tag.

  4. Open the Message Configuration dialog and set the following parameters:

    1. Service Type: Custom

    2. Service Code: 0x34 (SendNativeCmd)

    3. Class: 0x78 (Vision Object)

    4. Instance: 1

    5. Attribute: 0 (unused)

    6. Source Element: command

    7. Source Length: the length of the command tag in bytes

    8. Destination Element: response

  5. Switch to the Communication tab of the dialog, and add the device you want to send the message to:

  6. Download the project to the PLC.

  7. Enable the message tag by setting the EN bit to 1.

Result: the Native Mode message containing the command tag is sent to the device, and the response is copied to the response tag.