LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

example code for activeX control of Advantech PCL-818L card, using Advantech drivers.

So far:-

CVI 5.5.0, Win '98.

switch (event)
{
case EVENT_COMMIT:

if(0>(error = DAQAILib_New_DDAQAI (NULL, 0, LOCALE_NEUTRAL, 0, &geniecard))){ //define handle
CA_GetAutomationErrorString (error, errorStr, 1023);
MessagePopup("Error",errorStr);
}

if(0>(error=DAQAILib__DDAQAIOpenDevice (geniecard, NULL, &opendeviceerr))){ //open device
CA_GetAutomationErrorString (error, errorStr, 1023);
MessagePopup("Error",errorStr);
}

if(0>(error=DAQAILib__DDAQAIRealInput (geniecard, NULL, 0, &voltage))){ //read an input
CA_GetAutomationErrorString (error, errorStr, 1023);
MessagePopup("Error",errorStr);
}


SetCtrlVal (mainpanel, MAINPANEL_NUMERIC1, voltage); //display value

printf("%f\r\n",voltage);
printf("%d\r\n",opendeviceerr);

break;
}
return 0;
0 Kudos
Message 1 of 1
(2,995 Views)