02-02-2017 08:15 AM
Hi every one,
i have a VI, where i have to calculate something. For my calculation i need also the server time. now to my problem.
i have to ask the server every x sek. ( could be also hour or min.) the server time, but once a while the server could be offline there for I get time out and my hole VI give me an error. now I will to bypass it. For example when the server is off the programm should take a random Nr. and move on. I had some ideas but non of them worked. I thought maybe u guys know it better.
there is also a simplified VI wich could show what I mean.
Solved! Go to Solution.
02-02-2017 08:20 AM
02-02-2017 09:29 AM
Thx GerdW,
hmmm to be honest i tried once the case structure but i have allready 5 different big case structure in my VI and you know it each CS means a longer calculating time. i need this time as short as possible. any other Ideas?
Thx
02-02-2017 09:31 AM
@Eidin wrote:
Thx GerdW,
hmmm to be honest i tried once the case structure but i have allready 5 different big case structure in my VI and you know it each CS means a longer calculating time. i need this time as short as possible. any other Ideas?
Thx
Why do you think that?
02-02-2017 02:36 PM
At a minimum, you need to know if an Error occurred or not, and to do something different in the two cases (presumably including clearing the Error if present). So you need a Decision and two alternate paths. In every programming Language that I know (and probably all the remaining ones, as well), this comes down to what LabVIEW calls a Case Structure. Alternatively, you could "do nothing and ignore the entire thing".
Bob Schor
02-02-2017 03:47 PM
We are still comparing software reply from the server and delay to execute additional code to generate random number?
We are still polling server once "every x sek. ( could be also hour or min.)" and talking about delay to decide if we need to generate random number?
WIll you be able to ping the server in a parallel loop once a minute and keep its status in separate process? Then no need to ask for time if it is dead and your main program will not freeze while waiting for dead server....
02-03-2017 03:10 AM
Hi Eidin,
I totally agree with GerdW (trust him, I cant remember reading something incorrect from him ever ). This is a standard example on where to use a (error) case structure to keep a application responsive. Define a small timeout and try again every time until you want to stop the application or a critical error occurs.
Best regards,
Christoph
02-09-2017 05:10 AM
thx everyone,
well i used GerdW tipps.
thx again for the response and Help