LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help creating a customized control in a function panel that will display DIO Line Selection information.

Need help creating a customized control in a function panel  that will display DIO Line Selection information.

 

I have manage to create the dll code below that gets called by a function panel string control I want to use to choose a DAQ channels such as "Dev3/port9/line2"....  The NIDAQmx_NewPhysChanDOLineCtrl () function worked great in a GUI run under an executable. But does not change the control in to a Line Selection Control and then returns an error " The attribute passed is invalid". When called via customized control that points to the dll containing the SelectLines() function shown below.

 

 

int DLLEXPORT CVICALLBACK SelectLines (FPCustomInfo *info)
{
    int panel;
    int cancelled;
    char buf[64] ="";
    
    panel = LoadPanelEx (0, "c:\\Beckwith\\M-7679 Final - 2012\\LabWindowsCVI\\DIO\\lines.uir", PANEL, __CVIUserHInst);
    
    if (panel < 0) return 0;
    
    CenterDialog (info, panel);

    InstallPopup (panel);
        
    NIDAQmx_NewPhysChanDOLineCtrl (panel, PANEL_STRING, 0);  // Turns Panel String Control into a Line Selection Control

    cancelled = RunUserInterface ();

    if (!cancelled)   // return of 0 "OK"
    {
        GetCtrlVal (panel, PANEL_STRING, buf);
        FPCustom_SetParamValue (info, 0, buf);
    }

    DiscardPanel (panel);
    
    return 0;
}

0 Kudos
Message 1 of 1
(2,978 Views)