Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQmx

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?

0 Kudos
Message 1 of 3
(5,467 Views)

Forgot to mention that I am using PCI6259 and one BNC2110 programming in QT Creator.

0 Kudos
Message 2 of 3
(5,461 Views)

Duplicate Post. I answered some of your questions on the other post.

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 3 of 3
(5,447 Views)