Beldar
2007-09-24 22:10:10 UTC
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
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