12-06-2022 04:55 AM
hello, i have an .exe file which i run by writing paraemeters in cmd, now i want to build a vi that allows me to write the parameters (which are strings, numeric and an enum) into the exe file and reads the output. How can i do that?
12-06-2022 06:31 AM
Hi corrado,
@domcorrado wrote:
hello, i have an .exe file which i run by writing paraemeters in cmd, now i want to build a vi that allows me to write the parameters (which are strings, numeric and an enum) into the exe file and reads the output.
Use the SysExec function…
12-06-2022 09:02 AM - edited 12-06-2022 09:09 AM
@domcorrado wrote:
hello, i have an .exe file which i run by writing paraemeters in cmd, now i want to build a vi that allows me to write the parameters (which are strings, numeric and an enum) into the exe file and reads the output. How can i do that?
Well you basically build your command line string and use the System Exec vi to launch it
Here's picture of a program that builds a command line for Iperf, also pipes Iperf output to the program mtee if desired
Then I save the command line to Temp.bat and use the System Exec to run the batch file.
12-06-2022 09:26 AM
Hello, im using the system exec block to write a cmd line to an .exe but it wont work.
Im specifying the path of the exe file in the command line )using cmd /c C:\ etc.) input and writing my line in the standard output input, but every time i try to run the program it gives me a standard error saying
[11904] Failed to execute script 'prova' due to unhandled exception!
Traceback (most recent call last):
File "prova.py", line 239, in <module>
AttributeError: 'NoneType' object has no attribute 'count'
anyone can help me understand whats wrong?
12-06-2022 09:58 AM - edited 12-06-2022 10:01 AM
Hi corrado,
@domcorrado wrote:
Hello, im using the system exec block to write a cmd line to an .exe but it wont work.
Im specifying the path of the exe file in the command line )using cmd /c C:\ etc.) input and writing my line in the standard output input, but every time i try to run the program it gives me a standard error saying
[11904] Failed to execute script 'prova' due to unhandled exception!
Traceback (most recent call last):
File "prova.py", line 239, in <module>
AttributeError: 'NoneType' object has no attribute 'count'
anyone can help me understand whats wrong?
"*.py" typically is not an executable…
Mind to share a minimal example code to demonstrate what you are doing?
12-06-2022 10:03 AM - edited 12-06-2022 10:07 AM
The Python script is most likely not the one to execute. The executable is supposed to run the script.
@domcorrado: The executable is putting out that error. It has nothing to do with LV, as it seems. Regarding your inital question: executing the software is easy, but reading console output isn't. You could redirect outputs in the console to a file and read that into LV. https://www.windowscentral.com/how-save-command-output-file-using-command-prompt-or-powershell