LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Standard input/output in CVI 5.5

Hi,

A silly question :
I use printf function in my program and as soon as the program ended I can't find the standard input/output window.

thanks

ArnO
0 Kudos
Message 1 of 3
(3,120 Views)
This is true.... If you want to use TestStand the window will be around until the sequence editor or RTOI is closed. If a log is necessary of printf statements I would suggest using fprintf and at the end of your program use LaunchExecutable to fire up notepad with the file you wrote to.

I just don't know of any way to keep that stdio window around after the process dies. The other option is to create a loop in which you process system events until it is deemed necessary to end the process.

For example:

void main(void)
{
int i, visible = 11;

printf("ffdfdfd");
while(visible)
{
ProcessSystemEvents();
GetStdioWindowVisibility (&visible);

Delay(1);
}

}

This will loop until you minim
ize the window. You could also process keyboard input for lets say a "Q" to be pressed.

Good Luck!
0 Kudos
Message 2 of 3
(3,120 Views)
If you place a call to getchar() immediately before the return statement in your main function it will force the user to press enter in order for getchar() to return making your program wait until they do so and thus keeping the stdio window open as well.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 3 of 3
(3,120 Views)