Example Code

Test Internet Connection in LabVIEW

Code and Documents

Attachment

Overview

This example VI demonstrates the use of System Exec to test the network connection of current PC.

 

Description

This VI uses System Exec.vi from Connectivity Library to ping the website yahoo.com. The returned value shows the internet connection availability on current PC. This VI shows an example of using System Exec.vi and further usage could be explored.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Download the attached folder to your computer
  2. Open the VI " Test Internet 2012 NIVerified.vi".
  3. Run the VI.

 

Additional Information or References
VI Snippet

Block Diagram.PNG

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

Regards
Prabhakant Patil

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Silver_Shaper
Active Participant
Active Participant
on

HI really its very good.

---
Silver_Shaper | CLD
Prabhakant_Patil
Member
Member
on

Please click on like if you like it.

Your valuable suggestions are always welcome for the improvement.

Regards,

Prabhakant

Regards
Prabhakant Patil
dany1
Member
Member
on

Nice, but how often can you ping a website before you get blacklisted? Let's say I need to check for internet connection every 30 seconds.

Also, delay is noticeable. Can we set to ping only once instead of the standard 4 times?

tusharjambhekar
Member
Member
on

change the command to ping yahoo.com -n 1.

now it will ping only once

GNDT
Member
Member
on

Very good idea!