06-05-2018 10:35 AM - edited 06-05-2018 10:40 AM
Hi, I am working on a project where I wanted a way that I could send a remote command to a computer to restart it. I found doing some research (system exec.vi), and that if a passed the command (shutdown -r -t 0) in the command line input. If I run the program as a VI in labview it works perfectly, but when I compile the vi into an .exe it does not restart or toss an err. The system has error handling that is set up to save any errors before restarting. Attached is how I have the case set up. What do I need to use to get this to work?
Solved! Go to Solution.
06-05-2018 10:41 AM
There is nothing attached.
06-05-2018 10:45 AM
sorry, failed to attach.
06-05-2018 10:57 AM - edited 06-05-2018 11:00 AM
What does the subVI lined up before it do? Since it seems to involve paths, maybe it throws an error (relative paths work differently in an exe).
Does it work if you run the exe as administrator?
06-05-2018 11:33 AM
It is a basic VI that takes an array of error's that is stored in a global verible and writes it to a file. Attached is the VI.
06-05-2018 12:18 PM
sometimes (often) I find that I have to prepend
"cmd /c" to a system exe to get the command line to work exactly as I want it in the runtime environment.
try cmd /c shutdown -r -t 0
(as well as clearing any errors on the input - wouldn't mind guessing you're getting error 8 or 7 out of that VI, but can't open it on my PC with the current version of LabVIEW.)
James
06-05-2018 12:35 PM
that worked, Thank you.
06-05-2018 12:38 PM
It is written in labview 2017, no error's have been tossed from it recently, just finished debugging it.
06-05-2018 12:44 PM
I have attached the savedata vi printout for you to view.
06-05-2018 12:54 PM
Glad your issue is solved
Have I missed something in your save VI???
Any reason for the Global "error array final" to update the "appended error array" - local in a race condition with the for Loop, and then the for loop to contain a complicated while loop doing indexing rather than just indexing the Global into the For loop?
(Harder to see the PDF rather than browse a LV2015 VI)
James