02-07-2007 02:26 PM
02-08-2007 12:45 AM - edited 02-08-2007 12:45 AM
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".
Are you referring to .VI files or .EXE files? What does your program do?
Cheers.
Message Edited by tbd on 02-08-2007 12:46 AM
02-08-2007 07:55 AM
02-08-2007 06:39 PM
02-08-2007 08:28 PM - edited 02-08-2007 08:28 PM
Hi detted,
No need to apologize - your post was more precise than I gave you credit for, I apologize for my prejudice!
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
02-09-2007 09:59 AM
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.
02-09-2007 10:17 AM
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.
02-09-2007 10:22 AM
02-09-2007 10:57 AM
02-09-2007 11:00 AM
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.