05-10-2015 08:50 AM
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
Solved! Go to Solution.
05-10-2015 08:57 AM
05-10-2015 09:24 AM
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
05-10-2015 09:31 AM
05-10-2015 10:07 AM
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):
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
05-10-2015 08:45 PM
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
05-11-2015 01:28 AM
05-11-2015 08:18 AM
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.