LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executable functioning incorrectly when called by VI

Hi,

 

I'm doing some hardware control and subsequent data analysis for a control loop. I have a main VI which controls various pieces of equipment (it's fairly messy but works just fine), and I'm taking regular measurements using some separate equipment, the output of which can be read by a subVI and then fed back into the main VI. The whole thing is a bit convoluted since half the equipment uses its own proprietary interface and software, but this is what I'm doing:

 

- Equipment takes measurement using proprietary software and outputs data as a text file

- Sub VI uses System Exec VI to execute a VB.NET program (written by me), which does some maths, archives the text file and outputs the relevant, formatted data as a new text file

- Sub VI then reads the new text file, feeds to main VI and waits for next measurement

 

I know it's an awful way of passing data back and forth but trust me... it's just easier if it happens this way. (the data spacing is something like 5 minutes apart so time's aplenty, and the proprietary software only runs on XP, hence virtual machines in the background etc. etc.). Everything works fine when I test it without the sub VI.

 

So, my VB.NET program runs great when I click on it - data extraction into new file, old file gone. The problem I'm having is that if I call the VB.NET program using System Exec VI, it runs, but it doesn't create the new text file or move the old one. OK... so I tried running a using the System Exec VI to run a .bat file with a START command and a "Hello world!" message. The batch file runs, the VB.NET file runs without error, but again the VB.NET program doesn't move or create any files. But, frustratingly, when I just click on the .bat file... it all runs great and moves/creates the files.

 

This is frustrating, since it's such a simple part of the code! I've tried running LV as an administrator, turning off the antivirus... assuming it was a permissions thing but no luck.

 

Does anyone have any ideas? Suggestions?!

 

Details: running everything on 32-bit LabVIEW 2016 on Windows 7 (64 bit).

 

Thanks!!

0 Kudos
Message 1 of 3
(2,301 Views)

Could be permission issue. try running as administrator (even if you have admin privileges, the app may not).

 

(see also)

0 Kudos
Message 2 of 3
(2,280 Views)

Does your VB.NET app use relative or absolute paths internally? It might help to set the working directory input of System Exec to the directory containing the VB.NET application.

 

You might also return some stdout / stderr info from the VB.NET app to trace the program's execution (or just attach a debugger), and verify it is actually doing what you think it's doing when called via System Exec.

 

Good luck!




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 3 of 3
(2,251 Views)