Jump to content

Building exe with Scripting Nodes


RAJKU

Recommended Posts

QUOTE (Justin Goeres @ Mar 14 2009, 05:35 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.

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

Link to comment

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?

Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

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.

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.