LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI not finishing execution when called by an event structure

The event can perform multi-task in the sametimes.

You have to set the event if you want to wait the task to completed then start the new task.

 

Or you may set the propertis, all button to all grey until the task completed.

please set this as ANSWER or KUDO this post, if it help you.


0 Kudos
Message 11 of 16
(429 Views)

Hi GerdW,

thank you a lot, that totally makes sense. My only trouble left is, that if the measurement finishes and I start another measurement, the elapsed time from the timer in the SubVI still does not get reset to 0 and therefore the second measurement does not execute correctly. Can i reset the timer each time the subvi is called?

0 Kudos
Message 12 of 16
(427 Views)

Hi Sentec,

 


@SentecDE wrote:

Can i reset the timer each time the subvi is called?


Yes, sure.

Either reset the ElapsedTime ExpressVI in the first iteration of your subVI loop.

Or use your own ElapsedTime routine by using two GetTime functions and subtracting their values...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 16
(423 Views)

Example:

There should be a small wait inside the loop and some error checking like for counter number…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 14 of 16
(399 Views)

Dear GerdW,

thank you a lot for your suggestion, it works fine, apart from one problem: as the "High Resolution Relative Seconds" placed outside of the loop is (I suppose) executed with the start of the program the difference between the two "Relative Seconds"-VIs calculated in the loop includes the timespan between executing the SubVI and starting the actual measurement. And although this are only several ms, it actually makes a difference of several percent for short measuring times (The longer the measuring time, the more it evens out).

Is there any possibility to get the exact time when the loop is started?

Best regards
Sentec

0 Kudos
Message 15 of 16
(366 Views)

Hi Sentec,

 


@SentecDE wrote:

Is there any possibility to get the exact time when the loop is started?


Yes. All you need to do is to ensure proper DATAFLOW… 😄

 

In my user.library I have versions of those timing functions with additional error IO connectors, so I can easily enforce dataflow using the error wires. Then you read the HighRes timestamp right before the loop starts…

 

(Another option is to draw a flat sequence frame around that function and wire the error wire across that frame. When you do so: select the frame and create a subVI from it, then save the resulting VI to your user.lib…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 16
(360 Views)