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: 

Question regarding "How to ping an IP Address from LabVIEW?", March 27, 2019.

In regards to the support title as referenced in the subject line above, I am having a problem implementing the example VI from that article. The referenced block diagram shows a .net symbol labelled IDisposable connected to the "To A More Specific Class" function target class input pin. My first question is, how do I instantiate that target class input? I've attached my rendering of the original. And my second question, does the implementation from that article actually function as designed?  I have to ask because my next step will be to test the full implementation after the community responds with the answer to my first question.

Looking forward to whomever replies.

 

0 Kudos
Message 1 of 13
(2,409 Views)

Hi drunkin_drum_er, 

To respond to the question How to ping an IP Address from LabVIEW, have you considered calling the console from LabVIEW and simply typing the Ping command as you would have done it in the console ? You can get back the console output by copying and pasting it from the clipboard and check if the ping has been successful. 

Best regards, 

Mourad FAKHFAKH, Certified LabVIEW Developer

0 Kudos
Message 2 of 13
(2,369 Views)

Okay, this response will be flippant because 1) I don't have time nor do I want to banter, and 2) I need someone to respond who can answer my question(s). Please don't reply if you can't even do that much and offering alternatives does not address the question at all. What is the purpose of having or even using LabVIEW if one cannot take full advantage of it's automated testing capabilities? I need the capability to automatically ping a dozen or more test instruments as part of an automated test system health check. I look forward to anyone else who can offer some meaningful help.

0 Kudos
Message 3 of 13
(2,360 Views)

@drunkin_drum_er wrote:

Okay, this response will be flippant because 1) I don't have time nor do I want to banter, and 2) I need someone to respond who can answer my question(s). Please don't reply if you can't even do that much and offering alternatives does not address the question at all. What is the purpose of having or even using LabVIEW if one cannot take full advantage of it's automated testing capabilities? I need the capability to automatically ping a dozen or more test instruments as part of an automated test system health check. I look forward to anyone else who can offer some meaningful help.


While inelegant, the solution offered above is pointing you in the right direction, if you cared to devote just a little time to what was actually said.  Call the System Exec with the ping command.  Between standard output, standard error, and return code, you can catch the errors, too.

 

Nobody is going to want to help you with an attitude like that.  We're all volunteers here, and it's really easy for us to just click on the next topic.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 13
(2,354 Views)

First off it's nice to post a link to the support doc you mentioned. I had to Google it:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z00000159SmSAI&l=en-US

 

Second, the code in that article is a VI Snippet. Save that image to your desktop, then drag and drop it into LabVIEW and poof, the code is there, and it works fine for me. There was a warning but it looks like the difference was between .net versions (original code was v2, I have v4, still works fine).

 

I poked around a little and while I can create a .net reference I didn't see IDisposable in the list of options, but I didn't look super hard because it was already available in the snippet.

 

I went ahead and saved it as a VI but just know it's also available on the support article itself.

0 Kudos
Message 5 of 13
(2,348 Views)

And to echo what Billko wrote, the other poster was right. This works too:

 

ping from cmd.png

 

(I will admit I'm not sure what he meant by copy/paste the result).

 

You can call cmd line values from within LabVIEW, just like he said. Maybe don't be quite so flippant 😉

0 Kudos
Message 6 of 13
(2,346 Views)

Bill,

 

Sometimes a series of events tend to bring one right to the edge. I've been working from home for the last two months as a novice LabVIEW user and it's been a struggle for me as a hardware design engineer. It's now in the 90's and our central AC died on Monday and we're waiting for the very busy HVAC guy to get back with us with a quote. My response is not my normal demeanor so I do apologize for my slip into arrogance. Thanks for calling me out on that. I'll take another look at that.

 

Thanks.

Message 7 of 13
(2,316 Views)

It was not obvious to me that it was a VI snippet. I'll have another look.

 

Thanks.

0 Kudos
Message 8 of 13
(2,311 Views)

@drunkin_drum_er wrote:

Bill,

 

Sometimes a series of events tend to bring one right to the edge. I've been working from home for the last two months as a novice LabVIEW user and it's been a struggle for me as a hardware design engineer. It's now in the 90's and our central AC died on Monday and we're waiting for the very busy HVAC guy to get back with us with a quote. My response is not my normal demeanor so I do apologize for my slip into arrogance. Thanks for calling me out on that. I'll take another look at that.

 

Thanks.


I understand what it's like to work in conditions like that.  Right now, our lab AC is overpowered by all the equipment we have in there and the ambient temperature in some of the equipment is in excess of 41 degrees C (that's what, 104 degrees F?).  Even if the temps outside the equipment is 10 or 20 degrees cooler, we're still looking at working in temperatures in excess of 80 degrees F.  It makes you irritable - and sleepy!  Ugh.

 

I'm sometimes guilty of same, and then someone has to call me on it and yank me back to center.

 

I think there might actually be some advantage to using the .NET version, but I can't remember why.  Maybe more options or something?  I remember a long time ago having someone explain to me why they used it instead of the standard cmd "ping" command, and it made perfect sense to me.  So, you might try to go further down the .NET path, too.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 13
(2,286 Views)

It's interesting because for me, that diagram only shows up as an image of a vi snippet and not the vi snippet itself.

Thank you for capturing and sending the vi. I think this fully addresses my questions in a manner of speaking.

0 Kudos
Message 10 of 13
(2,259 Views)