Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger setup

Hello
 
I tried to use Start trigger function to set up a dig edge trigger but getting message as task not supported. Have attached my code for the reference. Any help would be appreciated.
 
Hardware used: PCI 6602
Programming Language: Visual Basic 6.0
Driver: DAQmx 8.1
counter/timer application
 
Thanks

Message Edited by Support on 07-13-2007 01:28 PM

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

Hi,

Using a digital start trigger with this function call as you have in your code is not supported for a counter operation. For counter triggering you will need to use an Arm Start trigger instead. To do this you will need to set some trigger properties for the task you have - not just call one function.

So for a trigger on a rising digital edge from a PFI line, as you've tried to set up in your code using the DAQmxCfgDigEdgeStartTrig function, you will instead need to call the following:

DAQmxSetArmStartTrigType(TaskHandle taskHandle, int32 data) - where the data value will be one of two constants; either 'DAQmx_Val_DigEdge' or 'DAQmx_Val_None'

DAQmxSetDigEdgeArmStartTrigSrc(TaskHandle taskHandle, const char *data) - where the data value is the terminal for your trigger source.

DAQmxSetDigEdgeArmStartTrigEdge(TaskHandle taskHandle, int32 data) - where the data value will be one of two constants; either 'DAQmx_Val_Rising' or 'DAQmx_Val_Falling'

I hope this helps, let me know if you have any questions

Regards
Hannah
NIUK & Ireland

0 Kudos
Message 2 of 5
(3,835 Views)
Hello Hannah,
 
Thanks for your response. I tried to use Arm start trigger function and also start trigger function for pulse generation operation, but when i m trying to read the available samples it gives a constant result of zero using the function DAQmxGetReadAvailSampPerChan. When I am not using any trigger I am getting some samples in lavailable samples, what does make the difference in using trigger and DAQmxGetReadAvailSampPerChan. I have attched both using trigger and without trigger function.
 
Thanks

Message Edited by Support on 07-13-2007 01:29 PM

0 Kudos
Message 3 of 5
(3,830 Views)
Hi
 
I have sorted out the issue, the problem was I have used two trigger source for the same task and hence the output of counter 0 becomes zero. If anything, i will give you a shout.
 
Thanks
 
0 Kudos
Message 4 of 5
(3,821 Views)
Hello
 
I am getting an error with regard to DMA, Error is:
 
"Data was written before it could be read by the system. If Data transfer mechanism is interrupts, try using DMA otherwise divide input signal before taking the measurement."
 
What could cause this error, I m getting this error at high external frequency and is there any way to work around this problem?
 
Thanks
 

Message Edited by Support on 07-13-2007 01:29 PM

0 Kudos
Message 5 of 5
(3,803 Views)