06-24-2008 09:29 AM
06-25-2008 01:12 AM
Hi Humm,
instead of using shared variables you could also use TCP/IP functions. Program the communication by yourself. Use the "TCP Read" function and connect your timeout to it. I think thats all you need. If the timeout execute, you can react on it.
Hope it helps.
Mike
06-25-2008 07:49 AM
I usually don't use shared variables but I'll share what I know.
You can right click on shared variable nodes and select the option to return an error. I think the erro code will return an erro code if there was a timeout.
If you are using LabVIEW DSC, you can register an event that fires when the value changes.
Just trying to help,
Ben
06-25-2008 09:06 AM
Thanks Ben and Mike for your help.
I am using DSC and will look for a value change to generate an event. Mike, I think I would like to try to let LabView handle the variable sharing just to see if it is as simple as it seems. I'm trying to stay as abstracted as possible from the systems, just for fun.
I have to gather several of these from different computers, so what I am wondering about is a good strategy for (read "diagram approach") sending out all the "take image" flags, and then making sure that I have all the "here is your image" flags come in in a reasonable time. My thought was that I would use some arrangement in a timed event loop with one of the events being a timeout...Here I start scratching my head...do I do things like increase a "gee ... you missed your deadline again...counter" until it reaches "I'm fed up with this, so skip it..."...or what. I have looked at the examples for using the mode of the timer to skip or process the data that comes in after the deadline...but those don't inspire me to a direct solution.
Send the flags.
Get some of the flags back...then...(wait forever for the rest of the flags to show up...? or Send an error to the operator to check on why the images arn't arriving...?which stops the whole show...or just publish that set of data without the missing information and wait for the data next time?)
06-25-2008 09:28 AM
As I indicated in my previous reply I don't use shared varibles. The reason is that I have very little control over when and how they are updated and syncronizing multiple data structures (is the new data really on my machine before I find that the flag is true? ) is hit an miss.
Using the DSC value change event may eliminate the need for the flag (but in at least one case the "new value" was always stale) which forced mt then turna around and do a data socket read to get the actual new data.
Ben
06-25-2008 09:31 AM
Ahhhh....I see !
Does it make any difference that I can do this rather slowly...? Is there some way to ASSURE that the new image is "NEW".
06-25-2008 09:47 AM
06-25-2008 09:50 AM
Excellent suggestion Milas!
They are also known as Action Engines. I wrote a Nugget about them which can be found here.
Ben