IC Imaging Control ActiveX

Controlling DV Devices

Controlling DV Devices

This sample shows you how to control the external transport features of your DV device from IC Imaging Control. External Transport means starting, stopping, winding etc. of the tape in the DV device.

Setting up the Project

The source code for this sample program can be found in the samples\VB6\Controlling DV Devices sample source directory.

image

Create a new project and add IC Imaging Control to the form. Before you run the program, select the video device, input and video format as shown in the First Steps in Visual Basic 6 chapter. Alternatively, run the program without selecting a device. In this case, the program shows the device selection dialog provided by IC Imaging Control. If you close this dialog without having made a selection, the program will display an error message and terminate.

Now, add 2 buttons to the form and label them Start and Stop. Name the buttons cmdStart and cmdStop respectively.

Add calls to IC Imaging Control's LiveStart and LiveStop methods:

Private Sub cmdStart_Click()
    ICImagingControl1.LiveStart
    If ICImagingControl1.ExternalTransportAvailable = True Then
        cmdETPlay_Click
    End If
End Sub
Private Sub cmdStop_Click()
    ICImagingControl1.LiveStop
End Sub

The sub cmdStart_Click contains additional code to advise the DV device to start playing after the Start button has been clicked. If this additional code is missing, you could click the start button, but IC Imaging Control would stay empty, until the external transport mode has been set to "play".

Now, add four new buttons to the form and label them Play, Stop, Rewind and FF. Name the buttons cmdETPlay, cmdETStop, cmdETRewind and cmdETFastForward respectively. These four new buttons are used to set the external transport mode.

Add the click events for the new buttons. Each of the four new buttons sets an external transport mode for IC Imaging Control.

Private Sub cmdETPlay_Click()
    ICImagingControl1.ExternalTransportMode = ET_MODE_PLAY
End Sub
Private Sub cmdETStop_Click()
    ICImagingControl1.ExternalTransportMode = ET_MODE_STOP
End Sub
Private Sub cmdEtRewind_Click()
    ICImagingControl1.ExternalTransportMode = ET_MODE_REWIND
End Sub
Private Sub cmdETFastForward_Click()
    ICImagingControl1.ExternalTransportMode = ET_MODE_FASTFORWARD
End Sub

At least, the Form_Load event should check, whether the current video capture device supports external transport. If the device supports external transport, the four buttons, that are used to set the external transport mode, should be enabled.

Private Sub Form_Load()
    cmdETPlay.Enabled = False
    cmdETStop.Enabled = False
    cmdETFastForward.Enabled = False
    cmdETRewind.Enabled = False
    cmdStart.Enabled = False
    cmdStop.Enabled = False

    If Not ICImagingControl1.DeviceValid Then
        ICImagingControl1.ShowDeviceSettingsDialog

        If Not ICImagingControl1.DeviceValid Then
            MsgBox "No device was selected"
            Unload Me
            Exit Sub
        End If
    End If

    cmdStart.Enabled = True
    cmdStop.Enabled = True

    ' Check whether external transport is available.
    If ICImagingControl1.ExternalTransportAvailable = True Then
        cmdETPlay.Enabled = True
        cmdETStop.Enabled = True
        cmdETFastForward.Enabled = True
        cmdETRewind.Enabled = True
    End If
End Sub

Calling IC Imaging Control's LiveStart method starts the image stream to capture images from the DV device. If the DV device has not got the "Play" command, no images are delivered from the DV device to IC Imaging Control. Thus, in order to get a live image from a DV device, LiveStart has to be called and then the transport mode has to be set to "Play":

ICImagingControl1.LiveStart
ICImagingControl1.ExternalTransportMode = ET_MODE_PLAY

<< Programmer's Guide

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

Automated Imaging Association ISO 9001:2015 certified

Contact us