Skip to Main Content
Centre d’assistance Cognex
LogoLogo

In-Sight How to Change Acquisition Settings from The PLC

Send a new value of an acquisition setting like gain, exposure, focus...from the PLC and update it in the spreadsheet.

03/06/2025

Details

From the PLC side:

  1. write the new value to UserData
  2. set the SetUserData bit and keep it on TRUE until the camera responds with SetUsetDataAck
  3. clear the SetUserData bit
  4. set the ExternalEvent0 bit and keep it on TRUE until the camera responds with ExternalEventAck0
  5. clear the ExternalEvent0 bit
  6. when Trigger Ready bit is set by camera, set the Trigger bit and keep it on TRUE until the camera responds with Trigger Ack (Trigger Enable should be kept high continuously beforehand)
  7. clear the Trigger bit

From the camera Side, the Job should contain these 5 elements:

  1. FormatInputBuffer which is a container for the value sent from the PLC.

    in-sight-how-to-change-acquisition-settings-from-the-plc_Image-1
  2. ReadUserDataBuffer referencing the FormatInputBuffer in the Buffer Property (cell B2). The Event property should reference the cell containing an External Event Structure (here cell A2).

    in-sight-how-to-change-acquisition-settings-from-the-plc_Image-2
  3. An Event (External 0), that you will add in the ReadUserDataBuffer Event property.

    in-sight-how-to-change-acquisition-settings-from-the-plc_Image-3
  4. GetBufferData function to extract the data received in the formatInputBuffer.
  5. ApplyAcquisitonSettings function. The Focus Distance parameter should reference the cell containing the GetBufferData function (here A6).
in-sight-how-to-change-acquisition-settings-from-the-plc_Image-4

Important: Camera should be online and the option "Apply Immediately" has to be activated in the ApplyAcquisitionSettings.

The next trigger will take a photo with the updated focus parameter.

Loading component...

Ressources connexes

Loading component...