LabVIEW Idea Exchange

Showing results for 
Search instead for 
Did you mean: 

LabVIEW access to stdout and stderr

Status: New

When using LabVIEW in combination with other languages, it would be really nice for LabVIEW to be able to read from and write to the stdout and stderr streams. For example, when writing a dll in C that is to be used by LabVIEW, it would be really nice to be able to see the output and error streams from within LabVIEW. As it stands you have to jump through hoops in another IDE or create a log file or some other workaround if you want to see what might have happened inside the dll to cause it to crash.


@Dlauria wrote:

read from... the stdout and stderr streams

Interesting idea, but.. eww, no? You're asking for LabVIEW to, like, replace the existing stdout and stderr with pipes, and manually tee writes to those fds to the real stdout/stderr? (Or something equally if not more heinous on Windows?) That strikes me as the sort of thing that most people would want to keep LabVIEW away from. 😀


AFAIK, on Windows, there is already an appropriate and optimal solution for this problem and that is ETW. On Linux/MacOS, you already had trivial access to the console. (And on all operating systems, Write to System already writes to something which for medium-volume logging is possibly also appropriate for your uses — either the Windows Event Log, or syslog.)


If you are trying to integrate literally a (Win32) DLL which demands literally a console, I'm not sure there is anything LabVIEW can do about that. It's not particularly a thing for GUI Win32 apps.

Knight of NI

And the other way around: if you use a LabVIEW dll in another language, you should be able to pass the stdin\stdout\stderr reference to the dll, and call the stdin\stdout\stderr from the LabVIEW dll.


I think most would prefer a wrapper application that routes the command line to named pipes, and then read\write to those pipes. TCP\IP or even memory mapped files could be used in stead of pipes.