From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

comparing timestamps using shift registers

Solved!
Go to solution

Hi,

I would like to compare two variables x & y in a real time VI for three consecutive timestamps and turn on a boolean if that is true. Please note that the timestamp updates randomly.

I want to retain the count until the timestamp changes again, and reset only if the values are the same after the second or third count.The problem I have is the time delay in the while loop resets the count.

Attached The problem I have is the time delay in the while loop resets the count. is what I have accomplished so far.

Thank you for your help.

 

 

 

0 Kudos
Message 1 of 21
(3,683 Views)

By the way, I am using LabVIEW 2013.

 

Thanks,

0 Kudos
Message 2 of 21
(3,679 Views)

Any help?

0 Kudos
Message 3 of 21
(3,624 Views)

I'm not sure what you're trying to accomplish here exactly, but at first glance I can tell you that the "Time Stamp" controls you have will always be all zeroes because you never set them to anything else.

 

Time stamps are accurate to within less than one millisecond of each other, so you almost never want to use the equals operator to compare them.  At a guess you actually want to use a different variable type here.

0 Kudos
Message 4 of 21
(3,604 Views)

Turn highlight execution on. All you are doing is comparing two time stamp constants, running the true case, and setting the counter to zero.

 

Maybe it's best if you try to tell us in non-LabVIEW words what you want to do, and we will point you in the right direction.

0 Kudos
Message 5 of 21
(3,594 Views)

So here is what I am trying to do:

If variables x and y are different for three consecutive timestamps, set the boolean to be true.

 

 

0 Kudos
Message 6 of 21
(3,578 Views)

And by timestamp are you talking about 1 second intervals?

0 Kudos
Message 7 of 21
(3,571 Views)

The timestamp updates randomly from another while loop. It could be 12:01:00.000 PM 12/11/2014 at time 0, 1:01:00.000 AM 12/11/2014 at time 1, etc.

So for three consecutive times, I want to compare variables x and y.

0 Kudos
Message 8 of 21
(3,566 Views)

I see. So if you want to check your variables at 2pm, 2:23pm, and 2:30pm, then you want this VI to run for 30 mins and tell if you if the x=y at those 3 times?

0 Kudos
Message 9 of 21
(3,555 Views)

I am sorry that I am not being clear. The VI runs indefinitely.

Variables x and y should ALWAYS be the same, at any timestamp update. It is ok for them to be different but not for three consecutive timestamp updates.

In other words, if they are different at timestamp0, that's OK. If they are different again when the timestamp updates at timestamp1, that's OK. If they are again different the next time the timestamp updates, at timestamp2, the boolean should be ON. So the count increases only for consecutive differences and the count should reset if the pattern is broken.

Thanks,

0 Kudos
Message 10 of 21
(3,551 Views)