Using GigE Commands with a Camera Device
You can also utilize the GigE commands to get, set and execute different features of GigE cameras. These commands can be used, for example, on startup to prepare the camera for acquisitions, on a Button to save changes to the camera, or in a command that needs to be run in a Task.
WARNING: Do not use these commands while a camera is acquiring; doing so may lead the camera to stop acquiring and require a system restart.
Note: Before using these commands, add Cognex.VisionPro to the Using statements.
var fifo = (ICogAcqFifo)$System.GetInternalObject("Devices.Camera0"); ICogGigEAccess gige = fifo.FrameGrabber.OwnedGigEAccess; gige.ExecuteCommand ("SaveUserSet"); gige.SetIntegerFeature("Integer_Feature_Name", 53); gige.SetDoubleFeature("Double_Feature_Name", 12.005); gige.SetFeature("Feature_Name", "Some value as a string"); uint intValue = gige.GetIntegerFeature("Integer_Feature_Name"); double doubleValue = gige.GetDoubleFeature("Double_Feature_Name"); string stringValue = gige.GetFeature("Feature_Name");