11-15-2023 11:26 AM
When a third party software or application is opening, I can type in command/text to its prompt. Anyone knows how do I use LabVIEW to send in the command/text instead of key in?
I tried with "SendKeys.vi" (e.g., exit \C as shown), but the input to the prompt shows "59~" instead of "exit". (When I send "\C" the application will take the "Enter" and next prompt appears.) Can someone help me? Thank you in advance.
11-15-2023 02:22 PM
I found the solution after searching around. I can use Keycode to implement my request, see attached.
11-15-2023 09:35 PM
Using System Exec (Windows)
Inputs |
Effect |
After command finishes: |
Outputs |
Remarks |
|||
command line |
wait until completion |
standard output |
standard error |
return code |
|||
internal_command | TRUE | Error 2 | blank | blank | 0 | ||
FALSE | Error 2 | blank | blank | 0 | |||
external_command | TRUE | runs OK | Window closes | output (if any) from command | error message (if any) from command | valid | |
FALSE | runs OK | Window closes | blank | blank | 0 | ||
cmd /C any_command | TRUE | runs OK | Window closes | output (if any) from command | error message (if any) from command | valid | |
FALSE | runs OK | Window closes | blank | blank | 0 | ||
cmd /K any_command | TRUE | runs OK | Window closes | output (if any) from command plus command prompt |
error message (if any) from command | 0 | |
FALSE | runs OK | Window remains open | blank | blank | 0 | ||
external_command >out.txt or cmd /C any_command>out.txt |
TRUE | runs OK | Window closes | blank | error message (if any) from command | valid | |
FALSE | runs OK | Window closes | blank | blank | 0 | ||
external_command 2>err.txt or cmd /C any_command2>err.txt |
TRUE | runs OK | Window closes | output (if any) from command | blank | valid | |
FALSE | runs OK | Window closes | blank | blank | 0 | ||
external_command >out.txt 2>err.txt or cmd /C any_command>out.txt 2>err.txt |
TRUE | runs OK | Window closes | blank | blank | valid | |
FALSE | runs OK | Window closes | blank | blank | 0 | ||
cmd /K any_command>out.txt | TRUE | runs OK | Window closes | command prompt | error message (if any) from command | 0 | Files "out.txt" and "err.txt" aren't written until user closes window. |
FALSE | runs OK | Window remains open | blank | blank | 0 | ||
cmd /K any_command2>err.txt | TRUE | runs OK | Window closes | output (if any) from command plus command prompt |
blank | 0 | |
FALSE | runs OK | Window remains open | blank | blank | 0 | ||
cmd /K any_command>out.txt 2>err.txt | TRUE | runs OK | Window closes | command prompt | blank | 0 | |
FALSE | runs OK | Window remains open | blank | blank | 0 |