From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-04-2007 10:05 PM
First I CREATE CHANNEL (CI Count Edges, Dev1/Ctr0); I set that channel's CI.COUNTEDGES.TERM property to Dev1/10MHzRefClock. I start that task.
Then I CREATE CHANNEL (CI Count Edges, Dev1/Ctr1); I set that channel's CI.COUNTEDGES.TERM property to Dev1/Ctr0InternalOutput. I start that task.
So, when I want to read them, I call DAQmx READ for task one, and DAQmx READ for task two.
I then JOIN NUMBERS to combine the HI and LO parts into a single U64.
That all seems to work, except it seems vulnerable to the old 12:59 problem.
(If a clock is sitting at time 12:59, and you read the hi part and low part SEPARATELY, then it just might tick over in between your reads, and you get either 12:00 or 1:59, depending on which side you read first).
I MUST use two tasks, it seems, because the rules say I cannot use two counters on one task.
The HELP for CREATE VIRTUAL CHANNEL, CI CNT EDGES says: To read from multiple counters simultaneously, use a separate task for each counter.
But how can I READ two tasks simultaneously?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-06-2007 09:12 AM
02-06-2007 09:30 AM
No.
I am trying to make a stopwatch for timing various parts of my (RT) program.
I want to set up a task, and call my timer VI's START function.
Some time later, I want to call its SAMPLE function, and have it return to me the number of clock ticks (or uSec) between the START and the SAMPLE calls.
I want a wide dynamic range, so I can use it on anything from uSec to sec, without having to guess.
I have it working, except that it seems like it would be susceptible to the 12:59 problem.
The example you cite, as far as I can tell, only works with frequency measurements, because the "high frequency with two counters" option is only available with the CI FREQ variants.
I am using the COUNT EDGES variant, and I see no such option available.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-06-2007 10:00 AM
Still, I'm curious as to how to implement the help's suggestion (to read two counters simultaneously, use separate tasks).
Blog for (mostly LabVIEW) programmers: Tips And Tricks