LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Holding (Not Freezing) Case for certain amount of time

Solved!
Go to solution

So I received 2 analog input through NiMyrio and i did a true/false case for if both signals together bigger than the trigger point as i set it will go into the true case .

The problem because both signals are matched with the comparison for very quick time it means the true case will happen according to that time which is too fast . After that time it will change to false case cuz the signals not matched the comparison anymore.

So the case doesnt give me enough time to perform the function inside the case. (example i want to number 5 decrements to number 1 in 5 sec but it couldnt be done cause the case will turn to false case as the true case happening very fast)

There is nothing to do with the signals , their charesteristics behave that way so

I wonder is there anyway i can hold the case for enough time to perform the function inside as the true case happening too fast according to the signal.

I have tried ''Time delay'' and ''Wait until next multiple" .They can hold but simultaneously freeze the program as well which is meaningless cuz it also freeze the function inside that i want to perform.

TO summary  i want to hold (not freeze) the true case and do the function inside at that holding time as described in the pics

 

Thank for your help

ff.png

0 Kudos
Message 1 of 7
(3,121 Views)

Labview is dataflow based.

-There's no point in telling True case executes fast or slow. It depends on code inside that case how much time it takes to execute.

-If the code inside your TRUE case is executing and you want to delay it, using time delay is the option.

-It's freezing because something else.

-How much did you give delay?

-If possible post vi/snippet not image. If you don't know how to create snippets : http://www.ni.com/tutorial/9330/en/

Thanks
uday
0 Kudos
Message 2 of 7
(3,116 Views)

Thanks for your quick reply 

So i have question : During the delay time , the code inside the case will work ? Or during the delay time , the case will be holding and the code inside not working ?

0 Kudos
Message 3 of 7
(3,104 Views)
Solution
Accepted by topic author mrspaceman

Here's what happens:

-Once the case entered, the delay time let's say you keep for 100ms

-If the remaining part of code executes in scenario1:50ms and scenario2: 150ms

-In scenario 1:Because of delay time, the case will hold for 100ms-50ms=50ms

-In scenario 2, the code will move after completing it's code.

-So what the delay time ensures is the case will hold minimum of 100ms.

-Delay time is just pointer to clock and during this time also code executes.

Thanks
uday
Message 4 of 7
(3,100 Views)

'' Delay time is just pointer to clock and during this time also code executes.''

This is what i want to hear , thank you so much for help u jz help me advance further step for my project . 

0 Kudos
Message 5 of 7
(3,097 Views)

Hi Spaceman,

 

please don't AND two floating point values, the result might not be the one you expect…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,090 Views)

thanks for your concern . As i need to trigger both values so i did AND for them . Gladly it worked somehow for my application. anw thank you again

0 Kudos
Message 7 of 7
(3,080 Views)