# Detecting Multi-function Card

For all operations related to the multi-function card, detecting the card is the first step. You can know the number and information of the multi-function card after successful detection. Before detecting the multi-function card, you must detect the sender successfully.

# The following steps are required for detecting the multi-function card and obtaining its information

Step 1. Detect the video controller.
Step 2. Detect the multi-function card.
Step 3. Get multi-function card information.

Below is an example of obtaining information of the first multi-function card connected to the first Ethernet port of the first video controller:

    // detect device info
    CLTSearchAllDevice();

    // get device counts
    int deviceCount = CLTGetDeviceCounts();
    if (deviceCount <= 0) {
        return;
    }

    int scIndex = 0;                // device index
    int portIndex = 0;              // port index
    int multiFuncCardIndex = 0;     // multi-function card index

    // detect multi-function card
    CLTFuncCardDetectAll(-1, -1);

    int funCardAllCount = CLTFuncCardGetCount();
    if(funCardAllCount <= 0){
        return;
    }

    BYTE majorVersion = 0;
    BYTE minorVersion = 0;
    std::string strVersion;
    char cVersion[16] = {0};

    //get function card version information
    SNewFuncCardInfo* pSNewFuncCardInfo = nullptr;
    for (int i=0; i<funCardAllCount; i++)
    {
        pSNewFuncCardInfo = CLTFuncCardGetInfo(i);
        if(pSNewFuncCardInfo)
        {
            majorVersion = (BYTE)pSNewFuncCardInfo->GetMajorVersion();
            minorVersion = (BYTE)pSNewFuncCardInfo->GetMinorVerSion();
            sprintf(cVersion, "%d.%d", majorVersion, minorVersion);
            strVersion = cVersion;
        }
    }