LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec.vi Block Diagram Password

Can someone tell me the password to open the block diagram of System Exec.vi?

Or, how that vi works, so that I can write my own?

I sometimes need the standard error to be inline with the standard output, not separated. 

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

You realize that having a password implies that the information is confidential (with NI), don't you?  Instead of trying to "crack" NI's intellectual property, why don't you just execute System Exec, get the strings you want, and format them as you want them to be?  You can call the VI "Corey System Exec" ...

 

Bob Schor

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

There is nothing in that VI that you could change. All it does is a Call Library Node that calls a LabVIEW internal C function. So there is absolutely zero things you can improve, every possible change you could make you can also make by massaging the input values properly before calling this function, or ignoring or altering certain return values from the function.

 

Creating your own System Exec "only" requires you to do some Windows API functions. The whole thing centers around the Windows CreateProcess() API and some extra glue code to install standard IO streams that you can redirect to your own strings. If you really really want to get your hands dirty, you can take a look at the OpenG Pipe IO library and the underlaying DLL source code here. But beware, bears and other dangerous animals are ahead.

 

Or you look for one of the several System Exec LabVIEW libraries that use the .Net API to do something similar. Definitely less of work and likely can do what you want as well.

Rolf Kalbermatter
My Blog
Message 3 of 13
(2,173 Views)

I have several different versions of System Exec... and they are all wrappers that simply "hide" some extra steps after calling NI System Exec.

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,144 Views)

Yup, not much to see here.

 

sysexec.png

Message 5 of 13
(2,115 Views)

Hi Darren,

 

once there was a recommendation to place controls/indicators outside of any structure when they are tied to the connector pane: maybe NI had to password-protect that VI because of (not obeying) that recommendation!? 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 13
(2,100 Views)

Yup, this VI is definitely violating more than one of our style guidelines. Check out how honest I was in posting that picture without habitually cleaning up the diagram first? 😉

 

And yes, for performance reasons, those terminals should definitely be on the top-level diagram. But I'm hoping there's not too many instances of people calling System Exec.vi in a tight loop...

 

If I were still in R&D I would have already submitted the cleaned-up VI.

0 Kudos
Message 7 of 13
(2,098 Views)

There is noway to call this in a tight loop. Process creation under Windows is a very costly operation that takes a rather long time (in terms of computer code execution). Linucx is more lightwaight, especially for cli’s.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 13
(2,076 Views)

Maybe at one point it could be upgraded to use PowerShell instead of cmd. (Not really sure what's under the hood now...)

0 Kudos
Message 9 of 13
(2,071 Views)

Unless you call cmd.exe yourself in the command to SysExec, no cmd is involved. This function directly calls CreateProcess() Windows API and closer to the kernel than that is not really possible without resolving to call semi private kernel APIs directly.

 

PowerShell ultimately has to call this function too or it may even call ShellExecute() which is even further away from the kernel (but has certain extra features such as allowing for elevation).

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 13
(2,036 Views)