DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with calling a VI using DIADEM script

Solved!
Go to solution

I am getting the "LabVIEW: The VI is not executable..." error message when trying to load a VI using DIAdem Scripting. However, the VI loads and executes just fine when running it from labview. I have isolated the problem to a sub VI called "3D Cartesian Coordinate Rotation (Direction) VI". This VI is packaged with labview and is in the "geometry VIs palette".  If I remove this sub VI, then the VI I want to call does load within Diadem. Any insight into getting this working properly would be appreciated.

Thanks.

0 Kudos
Message 1 of 10
(5,925 Views)

It sounds like there is an issue when running the VI from the RunTime Engine. Try mass compiling the VI (this will open all the subVI's and dependencies and resave them) to fix any corruption issues within the VI's. In addition, this KnowledgeBase article (-18002 Errors in TestStand) may be helpful. It is for this same error but with TestStand, however many of the steps it gives to fix this problem can be applicable for other programs as well.

 

Regards,

 

Steven Zittrower

Applications Engineer

National Instruments

http://www.ni.com/support

0 Kudos
Message 2 of 10
(5,908 Views)

Steven,

Mass compiling did not solve the problem. The problem seems to ocurr whenever a VI from the VI.lib is used. (I tried several others) Creating a source distribution of the VI also did not help. In fact, if I try to directly call a VI within VI.lib using scripting, it gives me the same message. I'm running labview 8.6 and diadem 11. Here is the script calling a VI contained in the labview supplied Vi.lib.  

 

Dim sgRunTimeVersionT : sgRunTimeVersionT = ""
LVRuntime.Init sgRunTimeVersionT

Dim objVI

Set objVI = LVRuntime.LoadVI("C:\Program Files (x86)\National Instruments\LabVIEW 8.6\vi.lib\Analysis\coordinate.llb\3D Cartesian Coordinate Rotation (Direction) (Array).vi") 

 

Error message: "Labview: the VI is not executable..."

 

 

 

 

0 Kudos
Message 3 of 10
(5,900 Views)
Solution
Accepted by topic author PRinOR

Hi PRinOR,

 

You have to do 2 things just right.  You need to create a source distribution that includes all the SubVIs, even the ones in vi.lib, and you have to match the LVRuntime.Init version exactly with the LV version of the VI you are loading.  I noticed in your posted VBScript that you are not specifically setting the LV version but are taking the default.  Have you succeeded in calling a simple VI from DIAdem that has no SubVIs, such as a VI that adds 2 numbers together?

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 10
(5,888 Views)

Brad,

Yes, I can successfully call a simple VI that has no sub Vis using DIAdem scripting.

 

As for the source distribution, when I uncheck the box that says "exclude Vi.lib" when using the build specifications dialogue in labview it adds a lot more Vis than are needed to the destination folder. As in a lot more. Perhaps, I am doing something wrong here. I mean it seems like there should be a cleaner solution for having DIAdem execute the VI using the run-time engine if that VI is executable in the run time engine.

-PRinOR

0 Kudos
Message 5 of 10
(5,879 Views)

A follow up on the last comment. Bulding a source distribution that includes VI.lib (unchecking the "exclude files from vi.lib" box) in the "my source distibution properties" dialog within labview does solve the problem. I am now able to access the VI using scripting. Also, I got rid of the extra files in the build by checking the box "remove unused members of project libraries" in this same dialog.

 

The bottom line seems to be: if your VI contains sub VIs (including those that come with labview in Vi.lib) one needs to build a source distribution of the VI to get it to run using DIAdem scripting.

 

I'd recomend to NI to perhaps make this aspect more clear in the "launching and configuring labview Vis from DIAdem" help info. Also, it would be extemely useful if the scripting labview access were on par with the ease in which sub Vis can be used within labview. I suspect this is the intent. 

-PRinOR

0 Kudos
Message 6 of 10
(5,872 Views)

Hi,

 

I am facing the same issue. I am tring to run a labview vi by sending few control values through diadem script. When I run the script I get an error saying " The VI is not executable. Most likely the VI is broken or one of its subVIs cannot be located. Select <b>File>>Open</b> to open the VI and then verify that you are able to run it."

But when I open the VI in LabVIEW and run- it it works just fine. I also tried the solution suggested above- I built a source distribution and there were no errors while doing this, but I do not know the further course of action...

 

I am using LV 12 and am able to run other simpler VI's through DIADEM script

 

Need help!

0 Kudos
Message 7 of 10
(4,346 Views)

Are you also matching the LVRuntime.Init version with your VI version as Brad mentioned?

Michael Keane
National Instruments
0 Kudos
Message 8 of 10
(4,318 Views)

Yes I did .. I have mentioned my LabVIEW version in my script

0 Kudos
Message 9 of 10
(4,303 Views)

Was the VI of interest "Always Included" as a source file and did you pick the correct path that you specified for the source distribution when specifying the VI to load?  Since this forum is technically marked as "resolved" with that green checkmark, it also might be causing it to get less visibility.  You might get more visibility from creating a new post in case others have other ideas as well.

Michael Keane
National Instruments
0 Kudos
Message 10 of 10
(4,276 Views)