MultiCam Boards Documentation > MultiCam Documentation > MultiCam User Guide > The Channel Class > Configuring a Channel > Code Example to Configure a Channel

Code Example to Configure a Channel

The following code fully creates and configures a channel for a Domino Alpha 2 board that is designated by DriverIndex=1.

The channel creation model specifies the Y connector, which is consistent with the chosen topology "2_2".

The Status variable can be used for error checking.

[C]

//Connecting to driver

MCSTATUS Status = McOpenDriver(NULL);

//Declaring the topology

Status = McSetParamStr(MC_BOARD + 1, MC_BoardTopology, "2_2");

//Creating a channel

MCHANDLE MyAlphaChannel;
Status = McCreate(MC_CHANNEL_ALPHA_Y, &MyAlphaChannel);

//Assigning the board to the channel

Status = McSetParamInt(MyAlphaChannel, MC_DriverIndex, 1);

//Playing the CAM file

Status = McSetParamStr(MyAlphaChannel, MC_CamFile, "XC-HR300_P100RA");

//... Application code ...

//Deleting the channel

Status = McDelete(MyAlphaChannel);

//Disconnecting from driver

Status = McCloseDriver();