Accessing VisionPro Objects from Script

Users can access the VisionPro internal API classes through the $System.GetInternalObject() function, e.g. $System.GetInternalObject(string path). This allows interactions with objects such as the range and encoder modes for Cognex Displacement Sensor cameras.

The list of components currently implementing the interface:

Class Access Path Internal API Class Referenced DLLs
VisionProCamera $System.GetInternalObject("Devices.CameraName") ICogAcqFifo Cognex.VisionPro.Core
VisionProToolBlock $System.GetInternalObject("Tasks.Task.Task.ToolBlock") CogToolBlock Cognex.VisionPro.ToolBlock
ImageDisplay $System.GetInternalObject("Pages.Page.VisionProDisplay") CogRecordDisplay Cognex.VisionPro.Controls
ImageDisplay3D $System.GetInternalObject("Pages.Page.VisionProDisplay3D") ICog3DDisplayV2 Cognex.VisionPro3D.Display.Controls
CC24Device $System.GetInternalObject("Devices.CommCardName") CogCommCard Cognex.VisionPro.Comm
Note: When using $System.GetInternalObject(), ensure that the reference DLLs are added.
  1. Add Cognex.VisionPro and Cognex.VisionPro.Display to your Using statements.
  2. Add Cognex.VisionPro.Controls to your Project References.
  3. Use similar code:

    CogRecordDisplay internalObject = $System.GetInternalObject("Pages.Page.ImageDisplay") as CogRecordDisplay;