Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Edge Start Trigger with 6534

Hi,
 
I need to collect 22 bits of digital input whenever PFI2 goes low (at about 10kHz).  My code to set up the channel,
clock rate and buffer seems OK, see below:
 
' Create the DAQmx task.
DAQmxErrChk DAQmxCreateTask(" ", taskHandle)
' Add a digital input channel to the task. 
DAQmxErrChk DAQmxCreateDIChan(taskHandle, "Dev1/line0:21,Dev1/PFI2", "", DAQmx_Val_ChanForAllLines)
DAQmxErrChk DAQmxSetSampClkRate(taskHandle, 10000)
DAQmxErrChk DAQmxSetBufInputBufSize(taskHandle, &H10000)
 
The problems start when I add the Timing Type and Trigger Type, like this:
 
DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle, "Dev1/PFI2", 10000, DAQmx_Val_Falling, DAQmx_Val_AcquisitionType_FiniteSamps, 100)
DAQmxErrChk DAQmxCfgDigEdgeStartTrig(taskHandle, "Dev1/PFI2", DAQmx_Val_Edge1_Falling)
 
When I start the task I get the following error:

"Measurements: Task contains a physical channel not supported by this device, given the requested Sample Timing Type.

To keep the Sample Timing Type, use physical lines from port0/line0 through port3/line7. To access the requested channel, change the Sample Timing Type."

I have tried various other calls to configure the timing, including DAQmxCfgChangeDetectionTiming(), but nothing has worked.  Dang...
 
Any snippets that are known to work would be GREATLY appreciated.
 
-Beldar
0 Kudos
Message 1 of 2
(3,394 Views)


@Beldar wrote:
Hi,
 
I need to collect 22 bits of digital input whenever PFI2 goes low (at about 10kHz).  My code to set up the channel,
clock rate and buffer seems OK, see below:
 
' Create the DAQmx task.
DAQmxErrChk DAQmxCreateTask(" ", taskHandle)
' Add a digital input channel to the task. 
DAQmxErrChk DAQmxCreateDIChan(taskHandle, "Dev1/line0:21,Dev1/PFI2", "", DAQmx_Val_ChanForAllLines)
DAQmxErrChk DAQmxSetSampClkRate(taskHandle, 10000)
DAQmxErrChk DAQmxSetBufInputBufSize(taskHandle, &H10000)
 
The problems start when I add the Timing Type and Trigger Type, like this:
 
DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle, "Dev1/PFI2", 10000, DAQmx_Val_Falling, DAQmx_Val_AcquisitionType_FiniteSamps, 100)
DAQmxErrChk DAQmxCfgDigEdgeStartTrig(taskHandle, "Dev1/PFI2", DAQmx_Val_Edge1_Falling)
 
When I start the task I get the following error:

"Measurements: Task contains a physical channel not supported by this device, given the requested Sample Timing Type.

To keep the Sample Timing Type, use physical lines from port0/line0 through port3/line7. To access the requested channel, change the Sample Timing Type."

I have tried various other calls to configure the timing, including DAQmxCfgChangeDetectionTiming(), but nothing has worked.  Dang...
 
Any snippets that are known to work would be GREATLY appreciated.
 
-Beldar


Try removing "dev1/pfi2" from the daqmxcreatedichan function call.

Jeff
0 Kudos
Message 2 of 2
(3,387 Views)