Redirecting Standard Input/Output in the LabWindows™/CVI™ Development Environment

Updated May 11, 2018

Reported In


  • LabWindows/CVI

Issue Details

I am using standard Input/Output (I/O) commands like printf() in LabWindows/CVI.
Is it possible to change the console that the commands are directed to?


Yes, you can change the destination console that the standard I/O commands are sent to in LabWindows/CVI. LabWindows/CVI contains the function SetStdioPort() that sets the destination for data written to the standard output and the source of data read from standard input. You can specify either the LabWindows/CVI Standard Input/Output window or a console window. The function accepts one integer parameter which is either:
  • CVI_STDIO_WINDOW (0) - LabWindows/CVI Standard Input/Output window
  • HOST_SYSTEM_STDIO (1) - A system console window

The default parameter value is CVI_STDIO_WINDOW for a nonconsole application and HOST_SYSTEM_STDIO for a console application. 

This function must be called before you call any I/O functions that will need to open the console window