Explicit Messages - In-Sight 4.x.x Firmware

Unlike implicit messages, explicit messages are sent to a specific device and that device always responds with a reply to that message. As a result, explicit messages are better suited for operations that occur less frequently. Explicit messages can be used to read and write the Attributes in the EtherNet/IP Vision Object of the In-Sight Vision System, which may be used for changing jobs, acquiring images, sending Native Mode commands and retrieving result data. For more information, see Native Mode Communications.

Example: Change a Job

The most common explicit message sent to an In-Sight vision system from a ControlLogix PLC is an instruction to change a job. Explicit messages are sent from a ControlLogix PLC using MSG instructions. The following steps show how to add a MSG instruction in RSLogix to change a job on an In-Sight vision system:

  1. Add the following tags to the ControlLogix Controller Tags dialog:

    Note: This example assumes a maximum length of 30 characters for the job name. If your job's name is longer, then you will need to extend the SetJobData buffer to include a number of SINT structures equal to the number of characters in your longest job name plus two.
  2. Create the following rung in your RSLogix 5000 project:

    Note: This snippet is copying the length of the job name into the first two bytes of the SetJobData buffer, the string data into the same buffer starting at the third byte, and then sends that buffer to the JobName attribute of the vision system. Make sure to add the ".job" file extension onto the end of the job name.

    This rung uses the Set Offline bit in the implicit connection to force the In-Sight vision system Offline, because the JobName attribute of the Vision Object requires the In-Sight vision system to be Offline before it will change the job. The Set Offline bit waits for the In-Sight vision system to bring the Online bit low, then sets up the data containing the new job name and sends the MSG instruction to the In-Sight vision system. After the job change is completed, the falling edge of the TriggerSetJob tag will cause the In-Sight vision system to go back Online.

  3. To setup the MSG instruction, click the InSight_SetJobMsg … button. This will cause the Message Configuration dialog to appear:

    Note: This example assumes a maximum length of 30 characters for the job name. If your job's name is longer, then you will need to input a Source Length equal to the number of characters in your longest job name plus two.

    The following fields need to be configured:

    • Message Type: This is the type of message that will be sent; choose CIP Generic to send a message to vendor specific objects like the Vision Object.
    • Service Type: This is the service code that will be sent to the object; select Set Attribute Single to change a single attribute of the Vision Object.
    • Service Code: This field allows any type of service to the object; this field is disabled if a predefined service type is selected.
    • Class: This is the identifier of the class that the message will be sent to; the ID of the Vision Object is Hex 78.
    • Instance: This field specifies the instance number of the object that the message will be sent to; for In-Sight vision systems, the Vision Object only has one instance, so this field should be set to 1.
    • Attribute: The attribute number that the message will be sent to; in this case, the JobName attribute has the ID of 14 Hex.
    • Source Element: This field indicates the source for the data that is being sent with the message. For the JobName attribute, a String with a 2 byte length header needs to be sent. This string was formatted earlier using the COP and MOV instructions in the run that was created in the previous steps. This field should be set to InSight_SetJobData to send the new job name to the JobName attribute.
    • Source Length: This field indicates the number of bytes of the source element that will be sent to the object. In this instance, because all of the data in the source element needs to be sent, the bytes should be set to 32.
  4. The MSG instruction now needs to be told which device should have the explicit message sent to it. Click on the Communication tab of the Message Configuration dialog and press the Browse... button. Choose the In-Sight vision system from the I/O configuration as shown below:

  5. After downloading the program to the ControlLogix PLC, the current job should be able to be changed with RSLogix by using the InSight_JobName and the InSight_TriggerSetJob controller tags:

    Note: Make sure to add the ".job" extension at the end of the job name.
  1. The Job Loading, Job Load Complete, and Job Load Failed bits can be used to determine if the job loaded successfully.