LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine if a path to another computer is active??

I have an application where I want to determine if a path over a network to a folder (directory) on another computer is available. If it is I want to write a file to it.. But, and here is the important part, if it is not available I don't want any long time outs to occur or any errors to result. Instead, I just want my main code to go on and not write the file I would have otherwise have written... And it is really about pinging the computer to see if it is up and running... If it is, the folder (directory) will be there because I control that part... So I want to ping, and if I see it, I want to write a file... If, after a brief time I don't see the computer, I just want to go on and continue with the other tasks of my code. Everything I have looked at so far generates errors if the path isn't active... That I don't want because I want my main code to run unattended, meaning no one is there to answer error messages...

Any help would be appreciated...

thanks... bob...
0 Kudos
Message 1 of 3
(2,666 Views)
I suppose it all depends on your OS. Can't you use "File/Directory Info " to see if the directory is there? If that does not have the behavior you are looking for you might try a shell script and run it from the sysexec.
Message 2 of 3
(2,663 Views)

"Volume info" works OK, except there is a long timeout if the share does not exist. Maybe you can place it in a parallel loop so it does not interfere with the rest of your code, then store the state.

If you want to use ping, you also have a few options:

(1) You can ping using system exec, then parse the output, see:

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CBA25111EE034080020E74861

 

(2) You can ping using raw sockets, see the following example:

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=D29F1FCA37F94FE5E034080020E74861

Message 3 of 3
(2,654 Views)