08-31-2012 09:25 AM
I will admit, it has been a while since I wrote code for Labview. I got help earlier with the tick count and creating a 0-1 second timer with it. Now I have a problem with that code within a While loop that has data passed to it from a DAQmx vi.
When I run the code (while it is connected to my CompactDAQ) the tick count operates at the same speed as the sample clock. This makes sense to me.
My question is, is there any way in the sample code that I have posted to get it to run at a faster pace than the sample clock through either another loop or any other solutions. I do need the Elapsed time elsewhere in the while loop where it is currently located as well.
Thank you for any help
08-31-2012 10:11 AM
Each loop can only run at 1 cycle per cycle due to the DAQ read. Since you are capturing at 1kS/s and reading 1000 samples, your read will take at least 1 second. You have to wait for the data to come in, after all.
08-31-2012 10:11 AM
Please post in 2009 version.
08-31-2012 10:23 AM
With that in mind, is there any way to do what I would like to do through either the use of multiple loops or another way to get a 0-1 second clock that continuously runs?
08-31-2012 10:25 AM
Hope I did this correctly and I apologize if I didn't.
08-31-2012 10:50 AM - edited 08-31-2012 10:51 AM
@P Anand wrote:
Please post in 2009 version.
Here's the important part.
08-31-2012 10:54 AM
I don't see where your timer is of any use. You are trying to get the elaspsed time's ms only when the loop is taking a second.
08-31-2012 11:01 AM
I only posted what was important for my question. I am using the timer to be able to control a set of external relays on a % of time on basis.
I am trying right now to rebuild the program with 2 separate while loops that only need to pass information to each other periodically. Thus far this appears to be working and I will post my solution if I am successful.
08-31-2012 11:46 AM
@crossrulz wrote:
@P Anand wrote:
Please post in 2009 version.
Here's the important part.
Thanks crossrulz for translating. 🙂 (crossrulz - your name?)
08-31-2012 04:20 PM
Here was my eventual Solution.