取消
显示结果 
搜索替代 
您的意思是: 

Labview run time engine system exec restart command

已解决!
转到解答

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?

0 项奖励
1 条消息(共 14 条)
4,235 次查看

There is nothing attached.

0 项奖励
2 条消息(共 14 条)
4,229 次查看

sorry, failed to attach.

0 项奖励
3 条消息(共 14 条)
4,227 次查看

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?

0 项奖励
4 条消息(共 14 条)
4,219 次查看

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.

0 项奖励
5 条消息(共 14 条)
4,196 次查看
解答
接受人 pwrobot

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

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 项奖励
6 条消息(共 14 条)
4,175 次查看

that worked, Thank you.

0 项奖励
7 条消息(共 14 条)
4,166 次查看

It is written in labview 2017, no error's have been tossed from it recently, just finished debugging it.

0 项奖励
8 条消息(共 14 条)
4,162 次查看

I have attached the savedata vi printout for you to view.

0 项奖励
9 条消息(共 14 条)
4,159 次查看

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

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 项奖励
10 条消息(共 14 条)
4,152 次查看