Discussion:
Digital Edge Start Trigger with 6534
(too old to reply)
Beldar
2007-09-24 22:10:10 UTC
Permalink
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
jcarbonell
2007-09-25 12:40:07 UTC
Permalink
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.
 
-BeldarTry removing "dev1/pfi2" from the daqmxcreatedichan function call.Jeff
Loading...