LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call a text file from Labview program

Hi,
Is it possible to open a txt file(or pdf file) in labview? I mean the program can still run when a text file or pdf file pops up.
I tried to use "file dialog"--"open file", but the file never pops up. Can you help me on this?
 
thanks,
 
bj
0 Kudos
Message 1 of 26
(5,154 Views)

Search the palettes for System Exec.vi.  This allows you to run any executable by making a command line call.  I'm guessing that Adobe Reader and Notepad have a simple command line interface to specify which file you wish to open.  In fact, it may be as simple as "c:\windows\notepad.exe c:\temp\blah.txt", where c:\temp\blah.txt is the file you wish to open in Notepad.  Note that I'm guessing on the path to notepad.exe there, I'm not sure where it resides, exactly.

-D

0 Kudos
Message 2 of 26
(5,141 Views)

Darren schreef:

> Search the palettes for System Exec.vi.  This allows you to run any executable by making a command line call.  I'm guessing that Adobe Reader and Notepad have a simple command line interface to specify which file you wish to open.  In fact, it may be as simple as "c:\windows\notepad.exe c:\temp\blah.txt", where c:\temp\blah.txt is the file you wish to open in Notepad.  Note that I'm guessing on the path to notepad.exe there, I'm not sure where it resides, exactly.
> -D

Hi,

I'm looking also to open a PDF file.
Darren thnx it works 🙂 🙂 🙂

Best regards,

Veldmous

0 Kudos
Message 3 of 26
(5,132 Views)
Darren schreef:

> Search the palettes for System Exec.vi.  This allows you to run any executable by making a command line call.  I'm guessing that Adobe Reader and Notepad have a simple command line interface to specify which file you wish to open.  In fact, it may be as simple as "c:\windows\notepad.exe c:\temp\blah.txt", where c:\temp\blah.txt is the file you wish to open in Notepad.  Note that I'm guessing on the path to notepad.exe there, I'm not sure where it resides, exactly.
> -D

Thanks, nice solution!
Just one thing... the program and file sources is static. So when I
have created a link to an external program and auto-open a specified
file, it only works on my own system. When I run my application, in
which this function is integrated, on another system (with other drive
arrangements due to network etc.) I get an error because the (fixed)
specified file paths can't be found!

0 Kudos
Message 4 of 26
(5,132 Views)

Darren schreef:

> Search the palettes for System Exec.vi.  This allows you to run any executable by making a command line call.  I'm guessing that Adobe Reader and Notepad have a simple command line interface to specify which file you wish to open.  In fact, it may be as simple as "c:\windows\notepad.exe c:\temp\blah.txt", where c:\temp\blah.txt is the file you wish to open in Notepad.  Note that I'm guessing on the path to notepad.exe there, I'm not sure where it resides, exactly.
> -D

Thanks, nice solution!
Just one thing... the program and file sources are static. So when I
have created a link to an external program and auto-open a specified
file, it only works on my own system. When I run my application, in
which this function is integrated, on another system (with other drive
arrangements due to network etc.) I get an error because the (fixed)
specified file paths can't be found!

0 Kudos
Message 5 of 26
(5,132 Views)
Hi,
 
The problem with opening a file with the command line, is that you have to now the location of the program that opens it. It does score points for simplicity.
 
Another (more complex) way to open any file with it's accociated program it to use ShellExecute.
 
Regards,
 
Wiebe.
 
 
0 Kudos
Message 6 of 26
(5,125 Views)

wiebe@CARYA schreef:

> Hi,
>  
> The problem with opening a file with the command line, is that you have to now the location of the program that opens it. It does score points for simplicity.
>  
> Another (more complex) way to open any file with it's accociated program it to use ShellExecute.
>  
> Regards,
>  
> Wiebe.
>  
>  
>
>
> ShellExecute.vi:
> http://forums.ni.com/attachments/ni/170/169706/1/ShellExecute.vi

Thanks,
will try this option too ...if I find some time...

0 Kudos
Message 7 of 26
(5,124 Views)
There is a VI called Open Acrobat Manual in the \help\_browser.llb.
Message 8 of 26
(5,119 Views)

Thanks Dennis.  I knew that VI existed, but when I was answering the post late last night I didn't feel like looking for it, and I figured somebody else would point it out by the time I got to work this morning.  🙂

-D

Message 9 of 26
(5,112 Views)
Here is a vi I created to do this sort of thing. Hope it helps.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 10 of 26
(5,104 Views)