LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitor value change?

Solved!
Go to solution

Hi ,

 

Someone  can pls advise me?

Attached vi work basically but there is a loophole in one case..

Those share variable from network signal express Thermocouples.. If user close signal express in other pc... in this program value remain as last reading. 

If the user forgot to make write to share variable in signal express the value remain as last reading..

So how to program this vi if the value remain unchanged for certain timing and prompt user to check respective shared variable..

 

Pls help..

 

Thanks and Regards,

Brian

Download All
0 Kudos
Message 1 of 8
(4,286 Views)
Shared variables can have timestamps, only process the data as "new" if the timestamp changes.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(4,277 Views)

Hi Mike,

 

Those shared variable from network.. Signal express continuous reading Thermocouple.

In this vi i gather all share variable form signal express  program.

just noticed that if someone close/stop the signal express program , the labview program always read the last data. 

Unlike in the signal express if manuall Uncheck write to share variable the value read as 0 in labview.

 

My concern is if someone close signal express and re open signal express but forgot to check/tick write to share variable in signal express then my labview program stilll read as old value.

Sometime the signal express pc hang my labview program also read as old data..

 

So how to prevent if any of shared variable remain unchanged for more than 5 to 10 min.. how can i programatically prompt user to check any shared variable is not reading..

 

Thanks and Regards,

Brian

0 Kudos
Message 3 of 8
(4,264 Views)
That's why I mentioned the timestamps. The timestamp updates whenever the shared variable is written to. Modify your LabVIEW code so it only processes the shared variable data if the timestamp changes.

In terms of putting up a dialog box in Signal Express, sorry can't help you there.

Mike.

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 8
(4,257 Views)

When you have a Shared Variable, you are "sharing" the variable with someone (or something).  You are correct that because there are two (or more!) independent processes reading and writing the variable, initialization of it becomes a bit tricky.

 

When Shared Variables first came out, I was very excited and thought they were the solutions to all of my communication problems.  Well, they were the problems of (most of) my Communication issues.  I've largely abandoned them as not being worth the effort to get them to work reliably.

 

However, I do remember (but cannot tell you where to find it) that there was a discussion of initializing Shared Variables.  The idea went something like this (but the details might not be 100% correct):

  1. Read the Shared Variable (so you know what it has now).
  2. Write something else to the Shared Variable.
  3. Keep reading the Shared Variable until it gives you the value you stored there (suggesting that it is now saved in the Shared Variable Engine).
  4. Write the Initialzation Value you want to the Shared Variable, and wait again for it to propagate.

You do this when you start your program.  It takes a second or two, but now you know the State of the Shared Variable when you start your program.

 

Bob Schor

0 Kudos
Message 5 of 8
(4,235 Views)

Hi Bob,

 

Those shared variable from network i am only allow to read. Collect data every 1 min and continuous collect long history of data for back tracking if need. The problem is if someone just close the signal express at other computer in the network my labview program keep reading last data reading.. value unchanged.. My labview program need to work real time temperature from those Signal Express and need to use those real time temp value in other web application. i had toggle write to share variable in signal express. My labview program front pannel will shown signal down. .the triangle turn red.

So how should i know when there is problem in signal express

For example someone has shutdown signal express or close it. later on forgot to click write to share variable. Another case is the signal express pc hang or no responding.. then my labview program keep reading old data...

 

Pls kindly advise?

 

Thank you very much!

 

Brian

0 Kudos
Message 6 of 8
(4,202 Views)
AGAIN, when you create shared variables you can specify a timestamp to be associated with the value. This timestamp is updated whenever the variable is written to. In your LabVIEW code only update the inputs if this timestamp has changed.

This is the 3rd time I have given you the same answer. Why not give it a try before asking the exact same question a 4th time?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 8
(4,180 Views)
Solution
Accepted by topic author shwemyatmann

You are using data binding and reading the control.  If you should only be able to read from the shared variable, that really should be an Indicator.

 

Use the actual Shared Variable node.  You can just drag the variable from the project onto your VI.  You can right-click on that node to show the timestamp.  You can then just use a feedback node to hold the previous timestamp and compare it to the current timestamp from the sharded variable.  When it changes, you can run your process.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 8
(4,153 Views)