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: 

System Exec reentrant execution or Non-reentrant


@rolfk wrote:

Wait until completion = FALSE

 

launch the process and forget about it, return immediately to LabVIEW to do whatever else the diagram needs to do. LabVIEW has no control about that process anymore after that, it may run a second, an hour or forever. LabVIEW therefore also can NOT collect the standard output and standard error information from the process. The only error that can occur is when Windows tells LabVIEW that the process could not be created for some reason. Anything else is impossible, as by the time the process terminates, LabVIEW has long returned from the System Exec call and likely done a million other things already.

 

 

Wait until completion = TRUE

 

launch the process and wait until it completes. LabVIEW monitors the process through an event and sits there waiting until that event is triggered by the Windows kernel, indicating that the process has terminated. It then collects the error return code, the standard output and standard error information and passes it to the relevant indicators of the System Exec VI.

 

 

Reminder deleted because of Cloudflare protection claiming I was using prohibited language or something similar and preventing me to post.


Is that what kept blocking me?

 

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 11 of 25
(2,718 Views)

@billko wrote:


Is that what kept blocking me?

 


Not sure. I wrote the first part, then decided to edit it and add some more explanations, then got a huge big red cross pushed in my face telling me that Cloudflare protection has detected some unallowed content and to go back and remedy it. I tried several times to edit it by removing some words that I suspected might be the problem, but no joy. So I just posted the original content with the additional message about Cloudflare.

 

I suspect to much specifics about process creation under Windows is dangerous knowledge nowadays. 😀

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 25
(2,713 Views)

Isn't the whole issue here been missed???

you don't need to use System Exec at all!!!

 

If you are using Putty. You are using a telnet service.

Open a VISA connection instead and monitor the R port and respond with the appropriate writes as required.

(I've got caught with Putty like that before myself)

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 13 of 25
(2,704 Views)

Yesterday I was directed to a page with a captcha to prove I am not a robot (or a very smart one 🤔).

 

I don't recall I ever had to do that in the past 20 years.

 

Maybe there have been updates?

 

Is repeating "wait for completion" suspicious 🙄?

0 Kudos
Message 14 of 25
(2,702 Views)

@James_W wrote:

Isn't the whole issue here been missed???

you don't need to use System Exec at all!!!

 

If you are using Putty. You are using a telnet service.

Open a VISA connection instead and monitor the R port and respond with the appropriate writes as required.


Putty is way more than just telnet alone. It can do SSH with about 20+ suboptions, raw TCP/IP, serial, terminal emulation, telnet, rlogin, and SUPDUP to name a few. It also can do transparent, configurable proxying.

 

If it is an unencrypted Telnet or serial port connection then you are right. The VISA and/or native TCP nodes will work just fine and with less hassle after having dug into the used protocol a bit.

 

All the other options use different kind of encryption, authentication and specific (sometimes rather arcane such as in terminal emulation) features. To implement them on top of other existing LabVIEW APIs isn't always trivial and in the case of SSH for instance not really feasible. But there are options for SSH out there in the form of LabVIEW libraries (based on .Net and also libSSH2) and 2022 is probably going to have them built in, most likely by "abducting" the libSSH2 library as they did with the libCurl library for the HTTP Client.

Rolf Kalbermatter
My Blog
0 Kudos
Message 15 of 25
(2,696 Views)

I think I understand your problem now.  A PuTTY session was meant to be either totally interactive, like a terminal, where you have to close it out yourself, or with scripting, totally non-interactive.  You can script the user input if it's the same all the time.  You can also script your PuTTY session to send all output through stdout if you need to grab something from the session.

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 16 of 25
(2,666 Views)

After more testing, I noticed the Test Exec (cmd.exe) Window doesn't always pop-up and persist.  It's like the OS is closing the window, as if it has errored.  This is my problem, initially I thought the reentrant setting of "System Exec.vi" is the issue.  Since it is set and forget, looks like I don't have a way of consistently showing the PuTTY response to the user.

 

Wrapping "System Exec.vi" in a non-reentrant VI makes no difference, its been my original setup (non-reentrant). 

 

Rolf, your Boolean explanation (Wait until completion) is on point. 

 

Furthermore, I'm attempting to have the user re-establish a PuTTY SSH key when PuTTY responds with (text) "Warning Potential Security Breach" message then waits for the user to hit key "y" or "n", then Enter key to accept new SSH.  I need to use the "Wait until completion" = False since that option give the user the ability to re-establish a key.

 

I'm starting to think there is no way to have control of this.  I'm thinking starting PuTTY GUI (from LV or TS) as a work-around instead of the cmd.exe.

0 Kudos
Message 17 of 25
(2,629 Views)

Cloudfare "Performance and Security" is a hindrance.  Its blocking ALL edits.  It requiring MULTIPLE entries of pick train, bus, boat bridge etc...

0 Kudos
Message 18 of 25
(2,624 Views)

@richjoh wrote:

Cloudfare "Performance and Security" is a hindrance.  Its blocking ALL edits.  It requiring MULTIPLE entries of pick train, bus, boat bridge etc...


A fix for something that wasn't broken, AFAIC. There's some spam, but really not that much.

 

I had to pick boats once over the past few weeks, but I haven't seen it since.

0 Kudos
Message 19 of 25
(2,616 Views)

wiebe@CARYA wrote:

@richjoh wrote:

Cloudfare "Performance and Security" is a hindrance.  Its blocking ALL edits.  It requiring MULTIPLE entries of pick train, bus, boat bridge etc...


A fix for something that wasn't broken, AFAIC. There's some spam, but really not that much.

 

I had to pick boats once over the past few weeks, but I haven't seen it since.


It's definitely annoying and when it decides to hit, it's an ugly and hard face slap. I get it randomly and except the one time in this thread where it simply felt I was trying to publish a b*mb manufacturing manual or something like that, it is always this very "entertaining" pick the boat, truck, train, motorcycle or something from these lovely images. It definitely increases the annoyance level substantially and if that continues like that I can guarantee that it will have an inverse proportional effect on users willing to help with answers.

 

As to the spam problem, yes it exists but this solution feels like the proverbial medication that is worse than the disease. I always report them and since I received the Knight of NI level I even discovered that I now can simply remove them myself.

Rolf Kalbermatter
My Blog
0 Kudos
Message 20 of 25
(2,578 Views)