RAJKU Posted March 15, 2009 Report Share Posted March 15, 2009 Can anyone tell me if we can build a exe with Scrpiting Nodes. I tried to open a VI Block diagram reference in a exe. VI server threw me an error saying access denied. Please help me Quote Link to comment
Justin Goeres Posted March 15, 2009 Report Share Posted March 15, 2009 The reason you can't get a block diagram reference in a built EXE is because VIs in built EXEs have their block diagrams removed during the build process. There's literally no block diagram to get a reference to. Quote Link to comment
Yair Posted March 15, 2009 Report Share Posted March 15, 2009 Additionally, this won't work even if you use a VI which does have a block diagram, as the run-time engine doesn't support most (if not all) of the scripting properties and methods at all. Quote Link to comment
RAJKU Posted March 16, 2009 Author Report Share Posted March 16, 2009 QUOTE (Justin Goeres @ Mar 14 2009, 05:35 PM) The reason you can't get a block diagram reference in a built EXE is because VIs in built EXEs have their block diagrams removed during the build process. There's literally no block diagram to get a reference to. Ya you are right. But i am not trying to access a VI that is built into exe. I am trying to access a VI that has no connection with the exe. I am using Open Application refnum and then pass the refnum to open VI refnum and then trying to open the block diagram reference. This is same as opening a VI in LabVIEW right. Please correct me if I am wrong. QUOTE (Yair @ Mar 14 2009, 06:41 PM) Additionally, this won't work even if you use a VI which does have a block diagram, as the run-time engine doesn't support most (if not all) of the scripting properties and methods at all. If that is the case. I want to understand how LabVIEW Vision Assistant or Vision Builder exports the script file into labVIEW VI. I need to do something Like that. Does anyone have an Idea of how to do it. Thanks in advance Quote Link to comment
jgcode Posted March 16, 2009 Report Share Posted March 16, 2009 QUOTE (RAJKU @ Mar 15 2009, 03:02 PM) Ya you are right. But i am not trying to access a VI that is built into exe. I am trying to access a VI that has no connection with the exe. I am using Open Application refnum and then pass the refnum to open VI refnum and then trying to open the block diagram reference. This is same as opening a VI in LabVIEW right. Please correct me if I am wrong. Without looking at any code - Make sure you are specifying the correct LabVIEW application instance. In the development environment you may not have a problem but... By leaving the name empty when creating the app reference - the exe will be referring to itself. But in the exe you want the reference to refer to an instance of the LabVIEW dev environment (so LabVIEW dev environment can open the VI/BD via VI server - as the Run Time does not have this functionality). Could this be a source of error for you? Quote Link to comment
crelf Posted March 16, 2009 Report Share Posted March 16, 2009 QUOTE (jgcode @ Mar 15 2009, 04:38 AM) Without looking at any code... jgcode's right - show us your code. Quote Link to comment
Yair Posted March 16, 2009 Report Share Posted March 16, 2009 QUOTE (RAJKU @ Mar 15 2009, 08:02 AM) I want to understand how LabVIEW Vision Assistant or Vision Builder exports the script file into labVIEW VI. No idea. I only used them once or twice and that was a while ago, but I would guess they either specifically include parts of the LabVIEW compiler needed to do this or that they call into the IDE using VI server as suggested by jgcode or using another trick. To do this, you need to specify that VI server allows external connections on a specific port (preferably not the default 3363, as that might conflict with your EXE) and then open a reference using "localhost" as the machine name and the selected port. I have no idea if this will work, but it probably will. Quote Link to comment
RAJKU Posted March 17, 2009 Author Report Share Posted March 17, 2009 Please find the attached Image of the code. This was quickly developed so forgive me if it is not as per standards. Please tell me if I am wrong at part of the code. Thanks in advance I also tried with a different Port Number also it dint work. Has anyone tried to build an exe like this before. Thanks Rajkumar B Quote Link to comment
LAVA 1.0 Content Posted March 17, 2009 Report Share Posted March 17, 2009 I think that scripting nodes are removed from the RTE. PS you don't need the 'Open Application' code for 'This Application', just the default App as found on the palette. Ton Quote Link to comment
RAJKU Posted March 17, 2009 Author Report Share Posted March 17, 2009 QUOTE (Ton @ Mar 16 2009, 08:15 AM) PS you don't need the 'Open Application' code for 'This Application', just the default App as found on the palette.Ton This application would return the reference of the exe but I am asking my exe to open the VI in the labVIEW application. So we cannot use this application here. Quote Link to comment
LAVA 1.0 Content Posted March 17, 2009 Report Share Posted March 17, 2009 Okay I understand, however the BD you showed will run on the Executable and not in the IDE. So you need the 'scripting' part to be executed in the IDE. Put those parts in a seperate VI, load those into the IDE and let that VI run the 'Get GObjects' function on the VI you want to diagnose. Ton Quote Link to comment
RAJKU Posted March 17, 2009 Author Report Share Posted March 17, 2009 QUOTE (crelf @ Mar 15 2009, 04:50 PM) jgcode's right - show us your code. any idea how to solve this issue. Please help me Quote Link to comment
Yair Posted March 17, 2009 Report Share Posted March 17, 2009 I believe the block diagram property is set up so that you can't use from outside the current instance, which is why you're getting the access denied error. You can check this by opening the context help window and hovering over the property. This means that you CAN'T do what you want. Instead, you may need to do what Ton suggested, which is to open a reference to a VI which will run in LabVIEW and that VI will be the one which runs the scripting code. Quote Link to comment
Rolf Kalbermatter Posted March 23, 2009 Report Share Posted March 23, 2009 QUOTE (Yair @ Mar 16 2009, 01:52 PM) I believe the block diagram property is set up so that you can't use from outside the current instance, which is why you're getting the access denied error. You can check this by opening the context help window and hovering over the property. This means that you CAN'T do what you want.Instead, you may need to do what Ton suggested, which is to open a reference to a VI which will run in LabVIEW and that VI will be the one which runs the scripting code. Yair is quite right. Most of the scripting properties are NOT accessible remotely for a good reason. Think about security! And about how they build VIs in Vision Builder and Co: Quite simple by executing LabVIEW VIs that run in a special runtime environment that is part of the tool that has the scripting feature not removed. Can you create a VI executable that could make use of that runtime environment? No, not really, both because of technical limits (no tool to create a LabVIEW executable that would call this special runtime instead of the standard lvrt.dll) as well as legal (that runtime only comes with those tools and is part of their license). Even if you would have installed and licensed that tool on the target machine it would be legally questionable if you have the right to execute your own code using that runtime engine enclosed in there. Rolf Kalbermatter Quote Link to comment
RAJKU Posted March 23, 2009 Author Report Share Posted March 23, 2009 Thanks to All. I Finally built an executable which will dynamically launch the VI in labVIEW development envi and execute the scripting part. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.