02-10-2007 11:07 AM
wiebe@CARYA wrote:
In windows, typing the vi's name on the command line starts the vi in the runtime engine.
I didn't know that the RTE could register the VI type in Windows (although I know LV itself does). Are you sure that it was the RTE and not the Windows executable?
Anyway, as suggested, you can simply write a small application which will accept the VI path as a command line parameter (or, if no parameter was entered, using a file dialog) and will simply use VI server to run the VI. Then, all you will need to do is find someone who can build the app for you and save each VI you want to use in your Linux copy.
Giving the user the option of choosing whether to use the RTE or have a stand-alone app is probably not a very viable solution at this point, because it probably has a lot of dependencies by now. Before 8.2, you could run your code without installing the RTE (if it didn't require stuff like VISA or DAQmx) by placing the executable in the same place as the RTE DLLs. In 8.2, I think that was changed.
In any case, the way to get proper platform independence is probably not to allow the RTE to compile the VIs, but to use a VM like Java or .net (at least if my understanding of the CLR is correct) and I suppose it's not impossible that NI is considering this as Linux and Mac are becoming more popular.
02-12-2007 03:40 AM
02-12-2007 09:10 AM
02-12-2007 09:31 AM
02-12-2007 11:20 AM
I'm hoping there is no serious security risk in this (e.g. since you called the mainvi.exe, the main.vi hierarchy is loaded even though it is not run and then the writer of the other VI can play around with it), even though that would be of little importance in my systems.
wiebe@CARYA wrote:
So if you create an exe with a vi in it, and start the exe from the command line with a second vi as command line option, the original main vi is not even started!
02-13-2007 03:40 AM
02-13-2007 04:48 AM
02-13-2007 05:10 AM
If I understand this correctly (and I've only done one quick test) when you run your executable with a path to a VI as a command argument, the RTE will simply load that VI instead of your top-level VI, not along side it, so the hierarchy is not loaded at all. My suggestion that the VI will be in the same application space was only to provide one example of how this could potentially be a security risk.
Wiebe@CARYA wrote:
By default the diagrams are removed from the vi's in the executable, so there is no risk there.
As mentioned, the risk would not be in someone being able to access your code, but with someone being able to use other VIs. In any case, as I said, the discussion on this point is rather academic, at least for me, since it is of little importance in our current applications.
02-13-2007 06:22 AM
02-13-2007 07:00 AM
@shoneill wrote:
Does this mean that a built EXE can actually load other VIs at startup into the SAME application space?
If you would build two applications <builds>\AppA.exe and <builds>\AppB.exe you have two ways to load additional VIs into the running application.
<builds>\AppA.exe will contain a VI AppA_viA.vi which is not in the hirarchy of the already loaded VIs (top level or dynamic) then <builds>\AppB.exe will have two ways to start this VI.
You can open a reference to AppA.exe with "Open Application Reference" and use <builds>\AppA.exe\AppA_viA.vi as path in "Open VI Reference" together with the reference of AppA.exe. This will load the VI into the application space of AppA.
You can use <builds>\AppA.exe\AppA_viA.vi as path in "Open VI Reference" and not connecting the Application reference input (meaning your local application). This will load the VI from AppA.exe into the application space of AppB.