LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i capture the time a loop runs

Hello people,

im an absolute labview beginner, im trying to build a VI wich mesureres an RC circuit (final result is calculating C and exporting this to a spreadsheet) using a K8055 USB experiment board , for a non electrician this is quite a task. with a lot of time invested ive built a VI wich uses while loops wich runs after eachother. Inside the loop where i compare UC_calculated to UC measured i get stuck. i need to time how long this loop runs twice , once for 1RC and once for 5RC, ive tried in many ways but no satisfying result. I've added what i got sofar, hopefully someone can push me in the right direction on this

thnx Pepijn
0 Kudos
Message 1 of 3
(3,111 Views)
Hello Pepijn,

Take a look at "Timing Template (data dep).vi" under "\LabVIEW 7.1\examples\general\structs.llb\Timing Template (data dep).vi". This should guide you in the direction of how to capture the time a loop runs. I am attaching a copy of the vi.
Hope this helps.

-poswal
Message 2 of 3
(3,100 Views)
I think your VI needs a serious redesign. I don't think it will ever work like that.

There is no data dependency between the last two while loops and the construct of 5 while loops on the left so they'll all run in parallel. Most likely, the USB port will be closed by the last loop while it is still being used inside the loops on the left. A "wait(ms)" and a "wait until next ms multiple" next to each other in the same loop also seems quite odd (third loop).

The first loop spins millions of times a second just to see if a button is pressed. You could use an event structure instead or at least place a small wait in that loop. Right no it spins so fast that it consumes all CPU, starving all other running processes.

Could you also point out in which loop you want to measure the time?
0 Kudos
Message 3 of 3
(3,099 Views)