12-08-2017 12:40 AM
I can get the Arguments when I use the CMD call exe(which is build by Labview). but I can't find any method to get a Arguments from EXE to CMD.
anybody can give some help?
Solved! Go to Solution.
12-08-2017 04:27 AM - edited 12-08-2017 04:33 AM
hi there,
your question is just a guessing game for me.
would you mind using LabVIEW terms/names?
what i may have gathered is, that you know how to use "System Exec.vi",
but you want to know how to get arguments for your own LabVIEW executable?
and then call "System Exec.vi" with the same arguments?
EDIT:
is this what you were looking for? https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P80FSAS
12-08-2017 09:27 AM
Have you read the Help for the Systemexec.vi?
Really I am not sure I understand your question.
Do you want to add arguments to a command line?
Do you want to know what arguments a command HAD BEEN ran with?
Do you want to capture the output of a command ran through the systemexec (cmd window)?
12-12-2017 05:04 AM
thank you for your reply.
I build a EXE with labview and I can get the Arguments when I use the property of Aplication Arguments. but when the EXE is finished the excution and I want return a value(successful or fail) to CMD(third party App).
I have asked to NI service and they tell me that I can't return a value to CMD
12-12-2017 05:08 AM
I want to capture the output of a command ran through the systemexec (cmd window) when I use CMD to start a EXE which is build by labview.
12-12-2017 05:25 AM
I believe it is possible, but that it is not easy.
Here are some resource that might help you:
http://digital.ni.com/public.nsf/allkb/E5CC7B2073D4FC1A8625742D006CE492
https://lavag.org/topic/11719-running-a-labview-exe-from-the-console/
https://lavag.org/topic/7488-how-to-creat-dos-based-programs-in-labview/
https://lavag.org/topic/20360-collecting-stdout-from-labview-when-run-from-jenkins/
https://lavag.org/topic/13873-how-do-i-set-lv-exit-code-or-write-to-stderr/
12-12-2017 05:27 AM - edited 12-12-2017 05:29 AM
so the System Exec VI returns you the stdout, stderr and the return code.
what is it that you are missing?
edit:
i think i start to get it, you want the labview executable to exit with a return code, or output to stdout/stderr,
that i don't konw
12-12-2017 05:29 AM
jwscs ha scritto:
so the System Exec VI returns you the stdout, stderr and the return code.
what is it that you are missing?
He wants to return a code to the OS when closing his own LabVIEW program.
12-12-2017 05:31 AM
an option would be to write the info you want to a file (e.g. return code),
and use this file from any other tool in your commandline chain
12-13-2017 07:14 AM
LabVIEW is not a command line application. It's possible, but much much much more difficult that you'd might expect.
Named pipes can help. You can create them from the command line, and LabVIEW can write to them (and then quit). That's not really "return argument to CMD", but it servers the same purpose.