Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify gate and source using QAQmx on LabView 7.0

subject sais it all

thanks in advance

mushi
0 Kudos
Message 21 of 33
(2,561 Views)
Notice that when I use DAQmx stop task there is no problem. But this defeats the whole purpose. The funny thing is that if youre using AI and AO there is no problem calling one DAQmx start task for AO and right after it a DAQmx start task for AI. This problem seems to happen only to counters. am I missing somthing

mushi
0 Kudos
Message 22 of 33
(2,534 Views)
The problem is with your pulse train generation task. In order to create a finite pusle train, two counters are required. This means when you try to start the second task, you are likely seeing a -50103 error stating the specified resource is reserved. In this case, the reserved resource is the second counter. If you're using an M Series board, there are only two counters and there is really no way around this. You can try switching the finite pulse train to a continuous pulse train, but I'm not sure if that will work for your application. A continuous pulse train only requires one counter. Otherwise, you'll have to sequence the tasks so that one starts and stops before the other. However, it doesn't sound like this is feasible for your application. If you have a 660x board lying around, you should be able to use one of those since they have between 4 - 8 counters. For finite pulse trains, paired counters are always used (e.g. 0&1, 2&3, 4&5, etc.) so you will simply need to specify an unused counter for the event counting task. If you really need a finite pulse train and an event counting task for your application, I would suggest trying to use hardware timed digital task or an analog output task to create the pulse train with the correct frequency/duty cycle. It's a bit more work, but it should work.
Message 23 of 33
(2,554 Views)
Mushi-

reddog's answer is exactly what I believe is going on with your application. Your example uses ctr0 to generate a finite pulse train generation, which takes two counters, so it implicitly uses ctr1. If you are on a 660x device, you should count edges on one of the other counters ctr2-7 or on M Series (since you only have two counters) either use a counter on another device or try using analog output or timed digital output to generate your desired pulses.

gus....
Message 24 of 33
(2,551 Views)
RIGHT ON!!!

Unbelivable yep, when I change it to continous aquisition it worked perfectly. BTW I tried to search for this in the help files and in the ni.com but didnt find any link or information abou this. The funny thing is that my application dosnt need finate it can do the same with continues aquisition as this is a clock. Just out of curiosity did you find it in the help file or just experience makes the difference. Anyway thank you very much if I would have waited for the ni support team NIDAQ 8.9 would have come out :). Never mind thanks again really

mushi
0 Kudos
Message 25 of 33
(2,541 Views)
Thanks gus.

as allways right on.

mushi
0 Kudos
Message 26 of 33
(2,540 Views)
On Traditional DAQ there were two kind of Count Edges:

Single Event Counting and Buffered Event Counting. (look at the attached file - one picture is worth 1000 words)

Is there anyway to do buffered Event Counting in DAQmx becuse when you set up a DAQmx Create Channel(CI Count Edges) It only does simple counting. I realise that this is no biggie just it looks better ifs its done the propper way

thaknks in advance

mushi
0 Kudos
Message 27 of 33
(2,523 Views)
Gus;

Look at my question to reddog about doing simple evnt counting vs buffered even counting?

What say you? Possible on DAQmx?

thanks,

mushi

Message Edited by mushi on 03-23-2005 02:03 PM

Message Edited by mushi on 03-23-2005 02:03 PM

0 Kudos
Message 28 of 33
(2,523 Views)
mushi,

To perform a buffered measurement (whether edge counting or otherwise), simply add the DAQmx Timing vi into your config chain. It has inputs to select finite or continuous sampling, and for # of samples. When you do not include DAQmx Timing, the task defaults to simple edge counting with no buffering.

Note that for continuous sampling, DAQmx may choose to create a bigger buffer than the # of samples you ask for. You can override this behavior and get a specific buffer size with a lower-level DAQmx vi named Buffer Config, Buffer Property, something like that.

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 29 of 33
(2,516 Views)
As you can see on the image I connected the Timing Property node and connceted all the necessary inputs. I even set up a Input Buffer but still when It counts it counts as a simple event counting rather than Buffered counting. Am I missing somthing?

Thanks again for you prompt replay

mushi

Message Edited by mushi on 03-23-2005 02:56 PM

0 Kudos
Message 30 of 33
(2,512 Views)