06-19-2007 11:29 PM
06-19-2007 11:45 PM
What do you mean that the tick count does not "update fast enough"?
Can you explain what you actually want to do, and we will try to help you find a solution. 🙂
What is you OS? Multipurpose or RT?
06-19-2007 11:46 PM
There's the Elapsed Time function. Simply set the target time to 2.5 and make sure auto-reset is checked.
Don't quite understand your comment about the fast update rate of the tick count. It will update as often as it is called (as will the Elapsed Time function).
06-20-2007 12:09 AM
06-20-2007 01:07 AM - edited 06-20-2007 01:07 AM
@TOetelaar wrote:
... is this any clearer?
Sorry, no. It's not clearer!
Could you attach some code for us to inspect?
What kind of cycle? What kind of external input? How fast would be quick enough?
Tick count is fast. For example, the following simple code stops the loop once the current tick count is 1ms higher than the initial tick count. Running it, it does several thousand iterations before stopping. This means that "tick count" can easily execute several thousand times per millisecond.

Do you need a resolution that is better than milliseconds?
What do you mean by "output speed". If your code updates an indicator, this will occur in the UI thread and will not be syncronous with the code (and it does not need to be). Of course you can force "synchronous display" for an indicator, but this usually slows down your code significantly.
Message Edited by altenbach on 06-19-2007 11:09 PM
06-20-2007 10:27 AM
06-20-2007 10:44 AM
06-20-2007 10:56 AM - edited 06-20-2007 10:56 AM
Your code makes no sense for this task (If I read it right).
Apparently, the pressure switch is taken in the upper DAQ train, which executes exactly once before the while loop starts, and then never again. So how can you possibly monitor an change in the switch??? And then meaure the time it took for the change???
From what I understand, both DAQ trains need to be inside the loop. Most likely, you can keep all the configuration outside the loop and only read the data from both tasks at each iteration.
Have you tried a simple tick count subtraction as in my above example image?
There are also many other very strange constructs that will most likely give incorrect and unexpected results. For example have a look at your FOR loop that uses an unititilized (!) shift register. The data you get will be completey unpredictable (e.g. if you run it with few iterations first and then with more iterations in a second run).

Message Edited by altenbach on 06-20-2007 08:58 AM
06-20-2007 12:58 PM
06-20-2007 07:34 PM
Hey! You won't be able to get better than millisecond resolution using Windows. However, one thing that you might try is using a counter to count the 100 kHz internal timebase of your card. You can start the task when you want to initialize and read your count when your event occurs. You know the timebase you are counting so you can easily convert the count to seconds. The KB below talks about how to count the 100 kHz timebase available on most of NI's cards.
http://digital.ni.com/public.nsf/allkb/6DEDFD730618DB0286256E6800761910?OpenDocument