LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling a vi in scilab script

Hello!

What I'm trying to do here is the following: I am developping a VI that uses a certain algorithm to function. I put the algorithm into a Scilab script structure, no problem here I already did that.

The problem is, during the execution of the script at many points I need to get additional data through a sub-VI. I want to avoid a structure that looks like Script=>sub-VI=>Script=>subVI=>etc...so my question is: how can I call a sub-VI from inside the Scilab script?

Thank you very much!

 

0 Kudos
Message 1 of 5
(3,010 Views)

Hi There,

I have had a look but I am unable to find any reference to this being possible. 

How about importing all the data from the subVI at the start of the script?

 

If your subvi is constantly acquiring data and your script is performing the same function on each piece of data then you could implement this functionality in a while loop or for loop. 

 

 Would you be able to show me a screen capture of what you currently have?

Cheers,

Tim, CLD, CTD
National Instruments (UK & Ireland)
________________________________________________
"No problem is insoluble in all conceivable circumstances"
0 Kudos
Message 2 of 5
(2,969 Views)

Hello, thanks for the quick answer.

I do not have a screen capture at hand, besides my VI a a bit too messy at the moment, but hopefully it can be explained quite clearly.

Basically, I am implementing a Nelder-Meads simplex method, where the input of the script is the coordinates of 3 points, and from it the coordinates of one or two other points are calculated. Problem is, from here the algorithm needs to go measure those new points physically, using another sub-VI. After which I need to input those measurements into another script so I can compare all the points and choose which ones are better.

Actually I decided to code it like I described, alternating scripts and sub-VIs (I kinda had a schedule to follow 😛 ), but I thought it would still be interesting to know if it is actually possible to do it with one big script.

During my search I found some interesting leads using matlab, namely using ActiveX (there) but I couldn't find corresponding commands in Scilab.

Any ideas about that? or any other ways to do it?

thanks!

 

0 Kudos
Message 3 of 5
(2,941 Views)

Hey,

sorry for the late response I have been away for a week. From the sounds of it you would be able to implement this within a while loop and use shift registers to pass the values through each iteration to the next. 

Each iteration of while loop would implement the scilab algorithm on the generated data. 

 

IF you did want to call a labview Vi you could build it into a dll and then call the dll. 

 

I htink this link will be useful for building the dll
http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/building_a_dll/

 

Thanks,

Tim, CLD, CTD
National Instruments (UK & Ireland)
________________________________________________
"No problem is insoluble in all conceivable circumstances"
0 Kudos
Message 4 of 5
(2,876 Views)

Thank you for your advice!

 

I haven't had time to implement it, unfortunately, that's why I answer so late.

 

I managed to build a dll file using the Labview functionality, however when I try to call it into Scilab (using the 'call' command) it doesn't work. I tried using the link command to link the dll with my session of Scilab first, but Scilab tell me that the dll is not compiled. I am not very knowledgeable on dlls and programming environments, do I actually need to have Visual Studio or another compiler installed on the same computer, or did I do something else wrong?

 

Aren't dlls already compiled and ready to be used by any program? I would reckon so...

 

Thanks again, cheers

 

Romain

0 Kudos
Message 5 of 5
(2,840 Views)