02-29-2016 06:14 AM
Hi all,
My test software uses an internal web service to obtain product information for testing purposes. If this web service fails to respond I want to check if the network is available. At the moment several of our test systems don't have access to the CLI for security purposes so I can`t use the PING command and `System Exec.vi`. My next idea is to use the .NET Ping function which seems to work (although it seems to have a few pitfalls)
Can I have your thoughts on how to check the network status? Do you have a simple preferred method ?
Thanks in advance,
Nick
02-29-2016 08:18 AM
Hi Nick
Can you not access the database that is driving the webservice (thinking outside the box here)?
I've always used the System Exec command method.
Steve
Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop
02-29-2016 08:25 AM
Hi Steve,
Unfortunately I`ve not been given permission by IT, partly because its an old system which they are in the process of upgrading,
hence the webservice.
I guess I could keep running the `Open Web Service` vi and wait for that to repond( as a network check), I just feel more comfortable with a Ping command.
02-29-2016 08:32 AM
Yep I've used ping for the same thing pretty much and it just feels as if you're doing things properly.
In truth banging the Open Web Service.vi is probably just as effective!
Steve
Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop
02-29-2016 08:34 AM
Hmm, I`ll give it a go, thanks Steve !
02-29-2016 08:40 AM
Is there a simple web page on that server that you can check for? Then you can see if the network is there, or manually do a Ping, but with a twist. Try sending a request to port 13 as this is the Simple Network Time Protocol port and should respond with the date/time. Mike
02-29-2016 08:58 AM
Thanks Mike, I`ll have a look into that. I`m sure IT will have a page somewhere, could be a useful option.
02-29-2016 09:05 AM
Not sure if this helps in your case but to monitor networks adapters on a windows system I have used a modified version of Get Network Card Information https://decibel.ni.com/content/docs/DOC-1267 which uses win 32 kernel32 and IP Helper API Iphlpapi.dll.
Cheers
Stephen
02-29-2016 10:10 AM
Bit of a hacky way if you wanted something quick. Is this an internet connection as well?
If so put www.google.co.uk or similar into the string to IP function. Technically this checks whether there is DNS (rather than just network) but if it returns a number everythings looking good.
03-01-2016 02:37 AM
Thank you for all the great ideas, i`ll go and have a tinker and see what happens!