From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display data in Command Prompt

Hi,

I am logging data in text file in parallel I would like to display the CMD prompt as console output.

Something like Printf function.

How to achieve this.

Thanks,

Visuman

0 Kudos
Message 1 of 8
(4,489 Views)

Can you made string indicator and update it?

Or you want write in win CMD?

0 Kudos
Message 2 of 8
(4,487 Views)

I want to write in windows command prompt.

0 Kudos
Message 3 of 8
(4,480 Views)

there is the "System Exec.vi".

and cmd /c echo "Hello World!" for the 'command line' input will print to the command line. but a new window will open and close immediately.

 

even if you start you VI.exe from the cmd window, output from the system exec vi will not be seen there.

 

the best solution would be to log to file, and you could use the windows equivalent of 'tail -f FILE'.

 

but i'd like to be corrected.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 4 of 8
(4,455 Views)

Yeah agree, I don't want to open each time separate CM window.

I do open the EXE with batch file and I would like to update the status of exe in the same CMD prompt.

 

Thanks Visuman

0 Kudos
Message 5 of 8
(4,450 Views)

a hackish solution:

 

save the following as "run.ps1"

Start-Process "BASEPATH\labview-cli-test.exe" -WindowStyle Hidden
Get-Content "BASEPATH2\test-logfile.txt" -Wait

then from a powershell run "run.ps1"

 

this will execute labview-cli-test.exe in the background, and then it will wait on changes to test-logfile.txt until you stop with CTRL+C.

 

note that the test-logfile.txt must exist when the command is executed


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 6 of 8
(4,441 Views)

Hi,

While executing showing error unknown parameter "run.ps1"

in CMD window.

0 Kudos
Message 7 of 8
(4,407 Views)

as i said in my post, this is a powershell script,

CMD prompt does not have the necessary tools.


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 8 of 8
(4,400 Views)