MultiCam Boards Documentation > MultiCam Documentation > MultiCam User Guide > MultiCam Basics > Acquisition > Acquisition Code Sample

Acquisition Code Sample

The following sample code manages the acquisition of two channels with a Domino Alpha 2 frame grabber. The Status variable can be used for error checking.

[C]

//Connecting to driver

MCSTATUS Status = McOpenDriver(NULL);

//Instantiating first channel

MCHANDLE MyChannel1;
Status = McCreateNm("ALPHA_X", &MyChannel1);

//Assign grabber and camera to first channel
//Configure first channel including triggering mode

//Instantiating second channel

MCHANDLE MyChannel2;
Status = McCreateNm("ALPHA_Y", &MyChannel2);

//Assign grabber and camera channel
//Configure second channel including triggering mode

//Activating acquisition sequence for first channel

Status = McSetParamInt(MyChannel1, MC_ChannelState, MC_ChannelState_ACTIVE);

//Acquisition sequence for first channel is now active
//...

//Application code
//...

//Acquisition sequence usually terminates naturally

//Activating acquisition sequence for second channel

Status = McSetParamInt(MyChannel2, MC_ChannelState, MC_ChannelState_ACTIVE);

//Acquisition sequence for second channel is now active
//...

//Application code
//...

//Acquisition sequence usually terminates naturally

//Deleting the channels

Status = McDelete(MyChannel1);
Status = McDelete(MyChannel2);

//Disconnecting from driver

Status = McCloseDriver();