LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

assciate file

    How to detect if a new assocaited data file has been double-clicked and load it in?    A LabView application has been lunched by double-clikcing an associated file.    While it is running, a new assocaite file has been doulbe-clikced, how to detect the new file info and load the new file?
0 Kudos
Message 1 of 19
(4,287 Views)

Hi detted,

      Your post is a bit confusing (to me.)  In the phrase "A LabVIEW application has been launched", the term "LabVIEW application" might refer to a "VI" (Virtual Instrument), an EXEcutable built using the LabVIEW Application Builder, or the LabVIEW development environment (LabVIEW.EXE.)  Do you mean a VI has been launched?  Do you want to detect when a another VI is launched?  Normally, a VI will load even if another is already running, so I still don't understand why you need to know "how to [snip] load the new file". Smiley Sad

Are you referring to .VI files or .EXE files?  What does your program do? Smiley Happy

Cheers.

Message Edited by tbd on 02-08-2007 12:46 AM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 19
(4,270 Views)
My appology for the confusion.    It is an .exe built with LabView apllicaiton builder.   The program is a data file viewer.  We have a folder with many data files.   Instead of opening them one by one, we would like to simply double-click to view.   The commnad-line arguments (CLA)only wirk for the first time, when the program is not running.   When the program is running, the file assocation doesn't work.   There is no new info coming from the CLA properties.  
0 Kudos
Message 3 of 19
(4,258 Views)

Hello:

  Could you please give us more information on what data file types these are? Can you post snapshots of what you are trying to do. Do you have a third party data viewer application that you are trying to access the two LabVIEW applications on or are you have file associations like what is listed in the link below?  You can run multiple EXE's on the same system just by doubleclicking the executables. The following link might be useful -

http://digital.ni.com/public.nsf/websearch/B7AD651DEDE2EDFC86256B36000B80C9?OpenDocument

http://forums.ni.com/ni/board/message?board.id=170&message.id=116925&requireLogin=False

http://forums.ni.com/ni/board/message?board.id=170&message.id=46355&requireLogin=False

Thanks and hope this helps.
Avi Harjani




0 Kudos
Message 4 of 19
(4,240 Views)

Hi detted,

     No need to apologize - your post was more precise than I gave you credit for, I apologize for my prejudice! Smiley Wink

I haven't been able to verify this idea (yet ) but the OS (Windows) is probably sending an "Open" message to the LabVIEW run-time environment.  It might be possible to catch this message.  Another idea - call it a "brute-force" approach, might be to have a seperate LabVIEW application open temporarily - just long enough to inhale the command-line params and send them to the main application (which can then open the target-file).

Cheers.

Message Edited by tbd on 02-08-2007 08:29 PM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 5 of 19
(4,238 Views)

    Thank you all for all the help.  I didn't expect so much enthusiasm here.  I tried a few times talking to NI supports.   It goes way back to LabView 6.i.  The last one I contacted Ni Support was this week.  I was really disappointed.  They had no idea what I was talking about.    This time I explained to the support over half-hour.  He couldn't understand what I want to do.   It is something so common and yet feeling so remote.  

    All I want to do is like the "Notepad.exe" in Windows.  If the extension txt is associated to it, a double click on the "text1.txt".  The Notepad will be launched and displays the "text1.txt".   Another double-click on "text2.txt" while the Notepad is still running, the Notepad will load the new "text2.txt" and display it.   Believe or not, I failed to convey the concept to NI Support.   I was told that was not the way to open a file.  You should use "File open".  

    Using the "Command_Line" properties, a LabView built application can auto-open the first associated file, but I don't know how to get it open the 2nd file.  

Avi:   The OpenG looks interesting.   However I am not ready for it yet.  

P.J   The OS is sending something the application, for it gets the focus.    Just I don't know how to catch it.

    Since we are on it, I would like to mention one more thing.    I held off upgrading from Lab view 6.1 for a long time and just recently upgrade to 8.2.  It looks so unfamiliar.  I haven't used it or build any application with at all, mainly due the size of run-time library.   The run-time library size in 6.1 is around 7-8 meg without compression.   However, the run-time size for the 8.2 is astronomical.    

0 Kudos
Message 6 of 19
(4,225 Views)

If you are using something like the "System Exec.VI" (this vi is used for command line functions) you need to set the wait until compleation to FALSE. If it is true the VI will wait until Notepad is closed before continuing to run Labview code. I do not have LV 6.1 but I think this VI is available in that version.

Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 7 of 19
(4,217 Views)
The notepad.exe is just an example.    I need to write an applicaiotn that works in the similar way.
0 Kudos
Message 8 of 19
(4,210 Views)
Hey detted,
    If I understand correctly, you have created a program with LabVIEW.  You want this program to be the default program for certain file extensions, meaning if I click xxx.me, your LabVIEW program (associated with the extension .me) will open up and run that file.
    The best way that I can think to accomplish this would be to create your LabVIEW program into an executable, then an installer.  Install the program on your PC.  Now, right-click on a file with the desired extension (*.me, in my case), and select Open With. Navigate to your program, and also make sure to set it as the default program for opening those file extensions.

Brian B
Account Manager
National Instruments
0 Kudos
Message 9 of 19
(4,206 Views)

Brain,

    Thanks for the reply.   The program is an exe , built with LV application builder.    The association works well when the program is not running, but it doesn't work when the program is already running.  

det
0 Kudos
Message 10 of 19
(4,205 Views)