LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

running an executable through system exec vi

Hi,

This is my first time using LabVIEW so this question might sound a little inane.

I am trying to run a MATLAB executable through the LabVIEW system exec vi. This MATLAB executable is responsible for plotting a graph. Now my issue is that I think the command is getting executed but there is no output i.e I can't see the graph at all.

Any help is much appreciated.

Best
Vipul

P.S: I have attached the relevant vi. The part I am talking about is the 4 system exec's for C:\Data\AnalyseThis.exe. If you need clarifications then please let me know.
0 Kudos
Message 1 of 7
(3,431 Views)
Also just as further clarification. I am using LabVIEW 8.2 on windows XP.
0 Kudos
Message 2 of 7
(3,429 Views)

Hi Vipul,

are the strings added to your cmd line command additional parameters? I recommend to use the "Format into String" function and to use quotation marks for your command.

Attached you will find a small example! Hope it helps.

Mike



Message Edited by MikeS81 on 04-08-2008 07:37 PM
0 Kudos
Message 3 of 7
(3,424 Views)
Using strings as file paths sometimes could included control characters such as: \r, \n, etc

to see if that's the case, you can right click on your string and select: '\' Codes Display
Van L
NI Applications Engineer
0 Kudos
Message 4 of 7
(3,392 Views)
Hey,

Thnaks guys. Much appreciated.

I still can't see the graphs though. The solution suggested by Mike S81 results in the same behaviour. The command prompt is called, then LabVIEW halts for sometime and then returns. On closer inspection I found this error. The standard error says that there is an " error using fscanf. Invalid file ifentifier. Use fopen to generate a valid file identifier" for the MATLAB executable. I am completely baffled by this. When I use command prompt directly and execute the same there are no errors but when I do it through LabVIEW it is throwing errors.

Any of you guys have any idea why it is so?

I really appreciate your help.

Thanks
0 Kudos
Message 5 of 7
(3,372 Views)
Can you try to do the same in a new vi, that only runs the peice of code that doesn't work. (Only running the exec vi)
We want to make sure other things aren't causing the problem.
Van L
NI Applications Engineer
0 Kudos
Message 6 of 7
(3,344 Views)
Hey,

Thanks guys. Actually I figured out what the problem is. My fellow worker got some code wrong. Anyways thanks for the help.
I really appreciate it.

Best
Vipul
0 Kudos
Message 7 of 7
(3,342 Views)