09-27-2006 06:12 AM
09-27-2006 09:35 AM
Hi David-
Those functions are provided by the LabWindows/CVI API and are not documented in the standard DAQmx C Reference Help. They only provide wrappers for CVI function panels around the various DAQmx Read Properties and do not add any additional functionality beyond what is available in the standard C API. Which example are you referring to? I may be able to suggest an equivalent standard C example.
Thanks-
09-27-2006
07:47 PM
- last edited on
10-06-2025
04:06 PM
by
Content Cleaner
Hi, Tom,
I am referring to the sample code 200308 at https://forums.ni.com/t5/Example-Code/Archived-NI-DAQmx-Continuous-Analog-Input-with-Both-Start-and/... I also checked the 200307 in that page and it is a Labwindow/CVI project. It seems none of those codes are in standard C API. Would you please check it and provide the alternative standard C API for 200308?
Thank you very much!
David
09-28-2006
09:37 AM
- last edited on
10-06-2025
04:06 PM
by
Content Cleaner
Good afternoon David_Lin,
Thanks for contacting National Instruments with your issue, we'll try our best to resolve it for you as quickly and efficiently as possible.
If you've installed the NI-DAQ driver software onto your computer, and included the ANSI C support, you should have a folder similiar to this on your hard drive:
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Cont Acq-Int Clk-Anlg Start
DAQmxErrChk (DAQmxCfgAnlgEdgeStartTrig(taskHandle,"APFI0",DAQmx_Val_Rising,0.0));
DAQmxErrChk (DAQmxSetAnlgEdgeStartTrigHyst(taskHandle, 1.0));
And replace them with:
DAQmxErrChk (DAQmxCfgDigEdgeStartTrig (taskHandle, const char triggerSource[], DAQmx_Val_Rising ));
DAQmxErrChk (DAQmxCfgDigEdgeRefTrig (taskHandle, const char triggerSource[], DAQmx_Val_Rising , uInt32 pretriggerSamples));
Of course you'll want to replace the input parameters with valid ones that meet your requirements for the triggerSource, rising/falling edge and how many pre-trigger samples you wish. To get an explanation for these functions, in Windows go to Start > Programs > National Instruments > NI-DAQ > NI-DAQmx C Reference Help.
Once the help file is open, in the Contents tab, navigate to NI-DAQmx C Functions > Triggering > Start Trigger and Reference Trigger, to view the various triggering functions available to you in the ANSI C DAQmx API.
Best of luck with your project.
Regards,
Minh Tran
Applications Engineering
National Instruments
09-28-2006 08:00 PM
Hi, Minh,
I am not quite clear which code you referred to. In the file ContAcq-IntClk-DigStart&Ref_Fn.c of the shipped code 200308, there are two functions
// Starts the task.
int32 Start_ContAcqIntClkDigStartRef(TaskHandle taskHandle)
{
int32 error=0;
DAQmxErrChk (DAQmxStartTask(taskHandle));
DAQmxErrChk (DAQmxSetReadAttribute (taskHandle, DAQmx_Read_RelativeTo, DAQmx_Val_CurrReadPos));
Error:
return error;
}
// Reads the samples left
int32 ReadSampLeft_ContAcqIntClkDigStartRef(TaskHandle taskHandle, float64 data[], uInt32 numChannels, int32 *read)
{
int32 error=0;
DAQmxErrChk (DAQmxGetReadAttribute (taskHandle, DAQmx_Read_AvailSampPerChan, read, 0));
if (*read >0)
{
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,-1,10.0,0,data,(*read)*numChannels,read,NULL));
}
Error:
return error;
}
And I couldn't find the help of the two APIs DAQmxGetReadAttribute and DAQmxSetReadAttribute. Then Tom told me it is CVI, not standard C API. So are there counterparts of these two CVI functions in the standard C API?
Thank you.
David
09-29-2006 07:19 AM
Good morning David,
The code I was referring to were examples that get installed with NI-DAQ driver when you install it. As long as you selected C-support when installing NI-DAQ, you should have the examples I mentioned, in the locations I mentioned. It will be a lot easier trying to modify those examples to get them to what you want them to do, then to modify the code on the web. There are no direct counterparts of these two CVI functions in C.
Regards,
Minh Tran
Applications Engineering
National Instruments