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

system exec.vi labview application

已解决!
转到解答

Hi everyone,

I'm having a problem with system exec.vi. I simply want to open another program using labview. This works whenever I try to access it using the VI. However, when I turn the VI into an executable, the system exec.vi doesn't do anything. I'm running a windows xp machine. I have tried it with a windows 7 machine and still nothing. any help would be appreciated. Thanks.

0 项奖励
1 条消息(共 10 条)
6,102 次查看

Are you using a relative path to the EXE? If so, LabVIEW may report a different path when a VI is compiled into an executable, so a path relative to a VI's path may be wrong.

0 项奖励
2 条消息(共 10 条)
6,087 次查看

Hey nathand,

I'm not really sure what you mean. The only thing I have connected to the system exec VI is the path to the program. It's also installed at the same place in both the windows 7 machine and the windows xp machine.

0 项奖励
3 条消息(共 10 条)
6,085 次查看
解答
已被主题作者 jachy25 接受

Did you put the "cmd /c" before the program to run?



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
4 条消息(共 10 条)
6,072 次查看

crossrulz,

Thank you! That did the trick. Is there any way to close the cmd right after it launches the program?

0 项奖励
5 条消息(共 10 条)
6,068 次查看
There are options on the SystemExec.vi for that. You should really read the hep file on it.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 项奖励
6 条消息(共 10 条)
6,043 次查看

@jachy25 wrote:

Hey nathand,

I'm not really sure what you mean. The only thing I have connected to the system exec VI is the path to the program. It's also installed at the same place in both the windows 7 machine and the windows xp machine.


Obviously this wasn't the issue, but to clarify: a relative path means you're providing a path relative to some other item. For example, if you were generating the path to the EXE by using the "Current VI's Path" function and then using Strip Path/Build Path, that would be a relative path. The "Current VI's Path" function may return a different path inside an executable than in the development environment, so that could cause the issue you describe.

 

If you're referencing the external program with an absolute path (ie "C:\Program Files\Vendor\program.exe") then this isn't an issue, of course.

0 项奖励
7 条消息(共 10 条)
6,022 次查看

Thanks for the help and great explanations guys 🙂

0 项奖励
8 条消息(共 10 条)
5,972 次查看

Hi,

 

I'm not quite sure what you mean - will you mind explaining in a bit more detail. I have the same problem.

0 项奖励
9 条消息(共 10 条)
5,757 次查看

Which part isn't clear? The accepted solution says to prepend "cmd /c " to the command line string input to System Exec. For example if you wanted to execute notepad.exe, the command line would be "cmd /c notepad.exe".

0 项奖励
10 条消息(共 10 条)
5,743 次查看