Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2167

NI-DAQmx

$
0
0

Hi all,

I am trying to sample a 12bit input using sample clock and start sampling trigger. Here's how I configure the task:

DAQmxErrChk(DAQmxCreateTask("",&samplHandle));
DAQmxErrChk(DAQmxCreateDIChan(samplHandle,"Dev1/port0/line0:7","",DAQmx_Val_ChanForAllLines));
DAQmxErrChk(DAQmxCfgSampClkTiming(samplHandle,"/Dev1/PFI0",1000000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,length));
DAQmxErrChk(DAQmxCfgDigEdgeStartTrig(samplHandle,"/Dev1/PFI1",DAQmx_Val_Rising));
DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(samplHandle,DAQmx_Val_Acquired_Into_Buffer,length,0,Callback,this));
DAQmxErrChk(DAQmxTaskControl(samplHandle,DAQmx_Val_Task_Commit));

When I run it in QT Creator it gives me this error:

 

DAQmx Error: Specified property is not supported by the device or is not applicable to the task.

Property: DAQmx_StartTrig_Type

 

Task Name: _unnamedTask<0>

 

Status Code: -200452

DAQmx Error: Task specified is invalid or does not exist.

Status Code: -200088

 

Previously, when I used analog input instead of digital, I did not have any problems. Any one has a clue what's wrong with my channel configuration?

Also, I defined the channel as

"Dev1/port0/line0:7"

just for example. Can anyone tell me the syntax for defining PFI2:PFI13 for my 12bit digital input? It looks like I have to define it in lines/ports format which would probably look something like:

Dev1/port1/line2:7 through Dev1/port2/line0:5?


Viewing all articles
Browse latest Browse all 2167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>