From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delay value

Solved!
Go to solution

I want to compare the value of a variable with the value of the same variable 10 seconds before.

What is the best way to obtain the value of that variable 10 seconds before without any waiting time?

0 Kudos
Message 1 of 16
(3,890 Views)

Previous values are not stored in LabVIEW automatically. You have to tell it to store the value and recover it yourself when you need it.

 

Rob

0 Kudos
Message 2 of 16
(3,875 Views)

How often does the value change?

You need to keep track of 10s worth of data. This could be a single point if you record at 0.1Hz or millions of points if you record very fast. Can you tell us a little more about your application?

Typically you would maintain the history in a shift register.

I don't understand what you mean by waiting time? Please explain. 

0 Kudos
Message 3 of 16
(3,863 Views)

The easy way to do this is get the value from the variable then put a Wait and then get the value from the variable again but in this case the comparation have a waiting time (from the Wait funtion) so is not done imediatly...

Note that the 10s. is also a variable and can be any value...

0 Kudos
Message 4 of 16
(3,841 Views)

Hi,

 

can you post the vi? This would make it way easier to see what you are talking about.

 

Regards

Florian

0 Kudos
Message 5 of 16
(3,830 Views)

Hi IDILIO,

 

"so is not done imediatly"

When you get the variable's value the second time you can compare immediatly - as you compare with a already stored older value...

 

It seems you're using local variables to reach your goal. You should know LabVIEW uses wires to store values!

Best regards,
GerdW


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

Hi,

 

Attached VI is an imagination of what is understood by me on comparison of delay value.

 

Hope it helps.

 

Regards.

0 Kudos
Message 7 of 16
(3,811 Views)

See attached Example.vi

 

What I want is compare the value actually in the screen (on indicator "Value") with the value that was on that indicator 10s. (delay control) before.

With this vi I cannot show the result for every values in the Value (the comparation is done only for one value every 10s.) and the result is showed 10s. after I want.

0 Kudos
Message 8 of 16
(3,809 Views)

NaruF1,

 

Can you please post this .vi compatible with version 8.20?

 

Thanks

0 Kudos
Message 9 of 16
(3,808 Views)

Hi IDILIO,

 

when you want to compare the current value with a value in the past and with a variable delay you have to create a history of your values.

 

As shown in your example I would create an array of values (like a ringbuffer). Now you would be able to compare the current value with each value in that buffer...

Best regards,
GerdW


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