All The Imaging Source cameras come with the SDK IC Imaging Control®, which simplifies programming by providing ready-to-use basic functions. Below are brief Visual Basic examples demonstrating how to control triggers and digital I/Os using IC Imaging Control®. For more details, visit www.imagingcontrol.com or contact support@imagingcontrol.com for additional resources.

Using the Trigger

This example shows how to trigger a camera and capture an image. The program starts by assigning a video device (e.g., FireWire camera DMK 21BF04), defines a video format, sets the operation mode to DeviceTrigger, and begins live streaming with LiveStart. Then, it captures an image using MemorySnapImage and saves it as Triggered.bmp.

Private Sub Form_Load()
    ICImagingControl1.Device = "DMK 21BF04"
    ICImagingControl1.VideoFormat = "Y800 (640x480)"
    ICImagingControl1.DeviceTrigger = True
    ICImagingControl1.LiveStart
    ICImagingControl1.MemorySnapImage ' Captures the next image due to trigger pulse
    ' Save the captured image: 
    ICImagingControl1.MemorySaveImage "Triggered.bmp"
End Sub

Activating the Strobe Output

This example activates a strobe output on a FireWire camera. It defines the device and video format, retrieves property container using GetSimplePropertyContainer, switches the strobe to True, and starts live streaming.

Private Sub Form_Load()
    Dim VCDProp As VCDSimpleProperty
    ICImagingControl1.Device = "DMK 21BF04"
    ICImagingControl1.VideoFormat = "Y800 (640x480)"
    Set VCDProp = GetSimplePropertyContainer(ICImagingControl1.VCDPropertyItems)
    VCDProp.Switch(VCDID_Strobe) = True
    ICImagingControl1.LiveStart ' Starts the camera, strobe output activates pin 6
End Sub

Reading the Digital Input

This example reads the state of a digital input. It retrieves properties via GetSimplePropertyContainer, sends a one-push command to read the GPIO input, and displays the result in debug mode.

Private Sub Form_Load()
    Dim VCDProp As VCDSimpleProperty
    ICImagingControl1.Device = "DMK 21BF04"
    Set VCDProp = GetSimplePropertyContainer(ICImagingControl1.VCDPropertyItems)
    VCDProp.OnePush VCDElement_GPIORead ' Reads the digital input state
    Debug.Print VCDProp.RangeValue(VCDElement_GPIOIn) ' Outputs the state for debugging
End Sub

Setting the Digital Output

This example sets a digital output value. It retrieves properties, assigns a value to VCDElement_GPIOOut, and sends a one-push command to write it to the GPIO.

Private Sub Form_Load()
    Dim VCDProp As VCDSimpleProperty
    ICImagingControl1.Device = "DMK 21BF04"
    Set VCDProp = GetSimplePropertyContainer(ICImagingControl1.VCDPropertyItems)
    VCDProp.RangeValue(VCDElement_GPIOOut) = 0 ' Sets the output value to 0
    VCDProp.OnePush VCDElement_GPIOWrite ' Writes the value to the digital output
End Sub

These examples demonstrate basic operations for working with IC Imaging Control®’ functionality. Each example uses VCDSimpleProperty to manage camera properties and methods like GetSimplePropertyContainer, OnePush, RangeValue, or Switch enable control over triggers, GPIOs, and other device features.

Last Updated: 2025-09-05 02:11:36