Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't find the #include files...

Dear all, Hi! I am very new in programming and i am assigned by the university to create a programm for the DAQ-Card NI6024E (in C++).I've been reading some example codes from the forum but in some cases i can't find the #include files that are included in the code. For instance in the following code where can i find the cvirte.h and DAQmxIOctrl.h? Should i have and .lib files too if there are any? : /********************************************************************* * * CVI Example program: * ContAcq-IntClk.c * * Example Category: * AI * * Description: * This example demonstrates how to acquire a continuous amount of * data using the DAQ device's internal clock. * * Instructions for Running: * 1. Select the physical channel to correspond to where your * signal is input on the DAQ device. * 2. Enter the minimum and maximum voltage range. * Note: For better accuracy try to match the input range to the * expected voltage level of the measured signal. * 3. Set the rate of the acquisition. Also set the Samples per * Channel control. This will determine how many samples are * read each time the while loop iterates. This also determines * how many points are plotted on the graph each iteration. * Note: The rate should be at least twice as fast as the maximum * frequency component of the signal being acquired. * * Steps: * 1. Create a task. * 2. Create an analog input voltage channel. * 3. Set the rate for the sample clock. Additionally, define the * sample mode to be continuous. * 4. Call the Start function to start the acquistion. * 5. Read the data in a loop until the stop button is pressed or * an error occurs. * 6. Call the Clear Task function to clear the task. * 7. Display an error if any. * * I/O Connections Overview: * Make sure your signal input terminal matches the Physical * Channel I/O control. For further connection information, refer * to your hardware reference manual. * *********************************************************************/ #include #include #include #include #include #include #include "ContAcq-IntClk.h" #define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else static int gRunning=0; static int panelHandle; int main(int argc, char *argv[]) { if( InitCVIRTE(0,argv,0)==0 ) return -1; /* out of memory */ if( (panelHandle=LoadPanel(0,"ContAcq-IntClk.uir",PANEL))<0 ) return -1; SetCtrlAttribute(panelHandle,PANEL_DECORATION_BLUE,ATTR_FRAME_COLOR,VAL_BLUE); SetCtrlAttribute(panelHandle,PANEL_DECORATION_GREEN,ATTR_FRAME_COLOR,VAL_GREEN); NIDAQmx_NewPhysChanAICtrl(panelHandle,PANEL_CHANNEL,1); DisplayPanel(panelHandle); RunUserInterface(); DiscardPanel(panelHandle); return 0; } int CVICALLBACK PanelCallback(int panel, int event, void *callbackData, int eventData1, int eventData2) { if( event==EVENT_CLOSE ) { gRunning = 0; QuitUserInterface(0); } return 0; } int CVICALLBACK RangeCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { if( event==EVENT_COMMIT ) { double min,max; GetCtrlVal(panel,PANEL_MINVAL,&min); GetCtrlVal(panel,PANEL_MAXVAL,&max); if( min0 ) PlotStripChart(panel,PANEL_STRIPCHART,data,numRead*numChannels,0,0,VAL_DOUBLE); ProcessSystemEvents(); } } Error: if( DAQmxFailed(error) ) DAQmxGetExtendedErrorInfo(errBuff,2048); if( taskHandle!=0 ) { /*********************************************/ // DAQmx Stop Code /*********************************************/ DAQmxStopTask(taskHandle); DAQmxClearTask(taskHandle); SetCtrlAttribute(panel,PANEL_START,ATTR_DIMMED,0); } if( data ) free(data); if( DAQmxFailed(error) ) MessagePopup("DAQmx Error",errBuff); return 0; } int CVICALLBACK StopCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { if( event==EVENT_COMMIT ) gRunning = 0; return 0; } Finally, in the code there is a CVICALLBACK type of functions...Where can i find more about this? Any help would be appreciated to the most.. CKary
0 Kudos
Message 1 of 2
(2,824 Views)
0 Kudos
Message 2 of 2
(2,811 Views)