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: 

Run executable program on labview

Hi,

I recently created an executable program that call my two setech cameras (name sentech-test.exe) and take multiple pictures. For simplicity, in Power Shell, I run the program by the command: cd C:/sentech-test.exe0 (0 and 1 basically specify which camera I am using). I try to call the program via  Labview using System Exec.vi by using the command: cmd\C dir C:\sentech-test.exe0 but the program was not executed. The command window turn on and off very quickly. Do you know how to fix this problem?

Also I am using window 10 computer

 

Toan

0 Kudos
Message 1 of 13
(4,796 Views)

Hello Tom,

 

Quick question: Are you running LabVIEW with administrator privileges? 

 

Have you checked this Knowledge Base article: How Do I Run an Executable or External File from within LabVIEW?

 

Screenshot_3.png

 

Randy @Rscd27@
0 Kudos
Message 2 of 13
(4,772 Views)

Hi 

I am not running LabVIEW with administrator privileges. Also thank you for the document link. I think it is right on my problem. Do you by chance how to create the .bat file to execute the .exe? 

 

 

0 Kudos
Message 3 of 13
(4,756 Views)

Hi Tom,

 

I believe this document could be useful: How to make a batch file

 

Regards,

Randy @Rscd27@
0 Kudos
Message 4 of 13
(4,752 Views)

Hello,

 

Thank you for the document about batch file. It is reaIly helpful. I was able to create the batch file. I tested the batch file and it run just file (it open the camera and take picture). However, when I try to call the batch file via labview using the command: cmd /c  dir C:\Users\toanle\Documents\sentech-test.bat but the batch file was not executed. do you have any suggestion on how to resolve this

0 Kudos
Message 5 of 13
(4,739 Views)

You don't actually have "dir" in that command do you?

0 Kudos
Message 6 of 13
(4,724 Views)

Hi,

 

I try to run both with dir and without dir. it still did not execute

0 Kudos
Message 7 of 13
(4,719 Views)

Hi,

 

I am not sure of the right syntaxis for calling options in the batch file, but I will like to know if you are doing it like this: 

 

C:\sentech-test.exe0

 

or

 

C:\sentech-test.exe -0

 

I am not sure if this would matter. 

Randy @Rscd27@
0 Kudos
Message 8 of 13
(4,716 Views)

Hi,

I used sentech-test.exe 0. I am pretty sure that is the correct syntax since if I try to use sentech-test.exe-0, the batch file will not run. You mentioned before about running labView with administrator privileges. Would it be matter? how can I do it?

0 Kudos
Message 9 of 13
(4,712 Views)

Also, I am kind of confused. If I specify my path in the command, I dont have to list anything in the working directory right?

0 Kudos
Message 10 of 13
(4,710 Views)