From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

How to bypass time out Error?

Solved!
Go to solution

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.

 

 

0 Kudos
Message 1 of 8
(3,051 Views)
Solution
Accepted by topic author Eidin

Hi Eidin,

 

implement some simple error handling:

IF error THEN
   generate random number
ELSE
  parse received string
ENDIF

All you need is a case structure…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(3,048 Views)

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

0 Kudos
Message 3 of 8
(3,021 Views)

@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?

0 Kudos
Message 4 of 8
(3,019 Views)

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

0 Kudos
Message 5 of 8
(2,979 Views)

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....

0 Kudos
Message 6 of 8
(2,968 Views)
Solution
Accepted by topic author Eidin

Hi Eidin,

 

I totally agree with GerdW (trust him, I cant remember reading something incorrect from him ever Smiley Happy). 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

Staff Applications Engineer
National Instruments
Certified LabVIEW Developer (CLD), Certified LabVIEW Embedded Systems Developer (CLED)


Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved
Message 7 of 8
(2,946 Views)

thx everyone,

well i used GerdW tipps.

thx again for the response and Help

 

0 Kudos
Message 8 of 8
(2,918 Views)