LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inputs (buttons) on USB interface board /event case

I see what you mean, but now it measures the time how long it takes to complete the for-loop. But I need the time how long it takes to come up till 3,14322 volt. That time is 1 tau, and I need it to measure the capacity of the capacitor. 

0 Kudos
Message 21 of 26
(426 Views)

Hi Matt,

 

the principle of taking time measure is always the same:

- get start time

- do work

- get end time and take difference

All that is put into 3 frames of a sequence. I'm sure you're able to apply that scheme for the parts inside the FOR loop on your own...

 

Still I suspect the main part of "execution time" is hidden in the "Wait for next multiple".

Also you have to remember: Windows will give you a big jitter on time measurements!

 

Next point:

You don't have any relation/data dependency between AnalogOutput and AnalogInput. When you want to measure some reaction on your AnalogOutput signal you clearly have a race condition in your code...

 

One more point:

Putting a (graph) indicator into your tightly timed measurement loop is contraproductive: Updating the graph may take much more time (due to CPU requirements) than doing all those measurements alone...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 22 of 26
(412 Views)

Hi Gerd,

 

I tryed it, and put it in 3 frames of a sequence, like your screenshot but it did not work. The time measured was the time of the For loop executing, so that is 6 seconds. And that is also the reason why I have the "Wait for next multiple" is in the for loop, so the 600 iterations take 6 seconds.

I don't exactly know what you mean with the analog output and input... I have changed my VI, I will sent it as attachment..

 

Maybe it's not all correct, but it is working the way I want.. Accept for the time calculation.. What do you suggest about the Graph? Put it out of the loop?

Thanks anyway for your answer, I can use all support haha...

0 Kudos
Message 23 of 26
(404 Views)

This is how it looks (front panel) when working.

Opladen en ontladen.jpg

0 Kudos
Message 24 of 26
(400 Views)

Hi Matt,

 

see comments in block diagram...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 25 of 26
(390 Views)

Thanks a lot GerdW! I did it slightly different, but it's working now! We continue till the next problem occurs Smiley LOL

If you're curious how I did it, see attachment.

 

Best regards,

Matt

0 Kudos
Message 26 of 26
(386 Views)