03-22-2016 09:18 AM
Hello all,
I apologize in advance, if this is not the proper spot for this question. I am trying to implement a Matlab script into LabView. For test purposes only, I used a suggested calculator matlab script, from the Mathworks forum. I created a .NET assembly, and I am using the .NET palette controls (constructor node, invoke node and close ref. node) in LabView to call the script. However, the desired effect (the calculator in question) shortly flashes on the screen and disappears. All the terminals of the invoke node are in refnum type, and not the type defined in the matlab function. Anyone has an experience with .NET objects? At the moment, it is not possible for me to affort the MathScript. I am trying alternatives. With ActiveX LabVIEW doesn't even recognize the .dll file as a .NET assembly. Whatever help, thoughts and suggestions will be much appreciated! I am attaching also a zip file with the files associated with the synchronization project.
Thanks a lot in advance!
Solved! Go to Solution.
03-28-2016 08:53 AM
Hi,
I can cannot run this VI successfully (probably due to some missing dependency; MATLAB is necessary I suppose?!).
But as far as you describe it ("shortly flashes on the screen") it seems that you call the calculator successfully, but there is no mechanism in the external program that controls the runtime (suppose you call a VI without a loop, then it would also instantly close after the call). Can you look into that?
Do you really need that calulator? In LabVIEW you have the Mathscript node and the MATLAB script node available?!
Best regards,
Christoph
04-04-2016 08:56 AM
Dear Christoph,
Thanks for the suggestion and help. I used the calculator example, just to have a Matlab script for synchronization with LabView. The main idea is the synchronization, and to be able to do this with any kind of scripts. Just in this partiqular case I had this calculator under hand, and used it.
Anyway, using a while loop, the script is synchronized, and I am able to call the calculator in question from LabView. However, it doesn't work... I mean when I tried to press any numbers it's not working. I guess I have to use a bit more sophisticated LabView VIs in conjugation with the .NET VIs used for the interfacing.
Thanks again for the tip anyway! My ultimate goal, to clarify again, is to be able to use MatLab generated scripts through .NET with LabView (disregarding of what the script does) w/o the MatScript toolbox, which for the moment is just far out of my price range.