LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Standard I/O window

Hi,

 

When my programs terminates, the standard I/O window, which has the standard output my program produced using printf, is destroyed.

How do I get access to this information after my program exits? I would like to introduce a pause instruction to read the infiormations before the window closes.

 

Thanks for your help

0 Kudos
Message 1 of 4
(2,989 Views)

You can use getchar () at the end of your program to pause the execution waiting for the user to press a key to proceed. In this moment the user can examine the Standard I/O window data; see standardio.cws example program that exhibits this behaviour.

I'm not aware of any means to programmatically retrieve the content of the Standard I/O Window: its content will be lost at program end.

 

Some alternatives are available to keep those data available.

First of all, if you are running in the IDE DebugPrintf () command will output text to the Debug Output window which is retained at program end and whose content can be interactively saved to file.

Even if you are running a compiled executable, DebugPrintf can be of help provided you use some utility like DebugView to get the debug messages. Even in this case the window of DebugView is not lost at program end.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(2,965 Views)

There's another posibility if you debug your program from CVI:

Options->Environment-> check "Copy standard I/O to Debug Output window" checkbox. When this option is on the stadard I/O contents is copied in debug output window(Window>>Debug Output) and you can view it after the program finishes.

But for your needs probably getchar() is good enough.

0 Kudos
Message 3 of 4
(2,953 Views)

Thank you for your answers.
It is a good idea, and rather than to use the instruction Getchar () I use GetKey() who allows the user to knock any key of the keyboard.

 

The debug mode is not a problem, I have already configure Options->Environment...

 

Thanks again

0 Kudos
Message 4 of 4
(2,941 Views)