LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a VI write to standard output

Hello
 
I am trying to create standalone application that would write some text to the "standard output" upon execution. I am using WindowsXP and a rather old version of LabView (5.1), because this has the application builder. I tried executing a batch file with echo commands inside my application, but this opens a new DOS window and the application itself does not output anything (If I run "myapp.exe > out.txt", I don't get anything in the text file)
 
Thanks for any reply!
 
Dan
0 Kudos
Message 1 of 9
(6,239 Views)


@Dan M. wrote:
Hello
 
I am trying to create standalone application that would write some text to the "standard output" upon execution. I am using WindowsXP and a rather old version of LabView (5.1), because this has the application builder. I tried executing a batch file with echo commands inside my application, but this opens a new DOS window and the application itself does not output anything (If I run "myapp.exe > out.txt", I don't get anything in the text file)
 
Thanks for any reply!
 
Dan


LabVIEW is a GUI Windows application and those do normally not have any standard IO or should we rather say the standard IO for such an application is the window system. Windows has a specific distinction between command line programs with standard IO and GUI programs that use the windowing system. Making a GUI application have standard IO in the same way as a command line application is something you only can achieve by some specific low level programming in the application itself in its C source code. Since you don't have the C code of LabVIEW avialiable (and really don't want to deal on that level anyhow) I'm afraid you will either have to resort to batch files or maybe writing some small command line application yourself to do what you want.

But if it is just about generating an output file of some kind (your example "myapp.exe > out.txt") this is done in LabVIEW by simply creating that file and writing to it through the File IO functions instead. Newer versions of LabVIEW do support retrieving command line parameters through an application property node, so you could create an application that does look for a filename in its command line parameters, open that file and write whatever you think you want to have in that file into it.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 9
(6,223 Views)
Hello Dan,
I don't think you can do it. A LV application is not a console one therefore has no standard output.
If you are satisfied with writing to a file, why not to use the LV function for file I/O?
You may also show the messages on screen with a multiline text box.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 9
(6,220 Views)
I hoped there would be a simple code interface node for what I wanted. In my command line example I used the ">" operator just to check if my application writes something to the console output. Normally, the application would have been launched by another program with different arguments on the command line for different tasks. I already have the CIN for reading the arguments... Well, I wanted to use LabView because it is very easy for me to write a program, compared to other programming environments
0 Kudos
Message 4 of 9
(6,215 Views)


@Dan M. wrote:
I hoped there would be a simple code interface node for what I wanted. In my command line example I used the ">" operator just to check if my application writes something to the console output. Normally, the application would have been launched by another program with different arguments on the command line for different tasks. I already have the CIN for reading the arguments... Well, I wanted to use LabView because it is very easy for me to write a program, compared to other programming environments

What is the problem about writing to a file and use that as input to whatever you need? What do you want to do anyhow? Maybe other forms of interapplciation communication would be possible.

In general standard IO for Windows GUI applications is simply a NO NO. The most you could get from only a few GUI apps is is some form of panic dump on standard error when something bad happens. For the rest almost all Windows GUI apps are absolutely silent on standard IO.

Rolf Kalbermatter

Message Edited by rolfk on 04-04-2006 11:44 AM

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 9
(6,207 Views)

The parent application wants my application to write to standard output, not a file. I have the source code, but is written in C (foreign language for me), and trying to modify it would complicate too much what I wanted initially to be a "quick and dirty" solution.

Thanks

Dan

0 Kudos
Message 6 of 9
(6,199 Views)
Don't know if these Windows API functions will even work with LabVIEW 5.1, which is what you said you had.
0 Kudos
Message 7 of 9
(6,178 Views)

You could try using the .net console namespace and write methods.  I can provide more later.........

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 9
(6,177 Views)

oops just occured to me that you said LV 5.1 no dotnet back then sorry ignore my last post.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 9 of 9
(6,175 Views)