LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mathscript node and mathlab

Hi guys
 
I need to convert some program from mathlab to LV.
 
However, I have little idea which to node to use.
 
So, i will have a few question for u guys
 
1) Because I m a lazy person, I dun wan to start to write the code from scratch in LV.
I heard about
0 Kudos
Message 1 of 8
(3,706 Views)
oops =.= lets continue here
 
basically, which one is more easier? whats the difference?
 
2)whats is the preparation i need to do
 
3) i have done some reading up on matlab script node; basically all function in matlab can b used there because of script server.
so, does that mean we need a matlab in the pc. Do i need to set any path while to connect or sth?
 
4)math script node. based on my understanding, we need to save the m file of that function in labviewdata. then we can call the function as usual. so m i right? tell me more.
 
if possible, can u guys sent me an example. just use a particular function from matlab in labview.
 
thank you
0 Kudos
Message 2 of 8
(3,705 Views)

Yes, to use the matlab script, you need matlab installed.

You can also chose scilab as a script server for a free alternative (see http://www.scilab.org/download/index_download.php?page=SLG.html), it is similar to matlab.

Open the example finder and e.g. search for mathscript. Maybe one of the examples will answer your questions. Have you tried?

What is your LabVIEW version?

 



Message Edited by altenbach on 05-22-2008 10:12 PM
0 Kudos
Message 3 of 8
(3,688 Views)
For more details, please continue in the mathscript forum:
 
0 Kudos
Message 4 of 8
(3,655 Views)
labvie 8.5. why? is there any problem?
0 Kudos
Message 5 of 8
(3,635 Views)

sean1985 wrote:
labvie 8.5. why? is there any problem?
No, but it is generally a good habit to always mention what version you are using.
 
Mathscript is a relatively recent addition to LabVIEW and has received increased functionality with every new release. Have a look at the LabVIEW 8.5 release notes to see all the newly added functions and features. Over six pages worth!! 😄
 
For this reason, the version information is important so we can be sure we are talking about the same thing. You have 8.5, so you're all set. 🙂
0 Kudos
Message 6 of 8
(3,623 Views)

Hello Sir Knight AltenBach:


Some comments on capabilities of MathScript versus Matlab and recently the new ScieLab 5.2. I started using it for LV8.2 for work involving quantum noise statistics in image sensors . Although it has increased more analysis functions and speed for each new LabVIEW release, there are serious limitations of this tool. So its probably only good as some small code insertions between codes for hardware calls for processing signals when they become available as arrays. First,  "not all functions is supported in LabVIEW Runtime" e.g. get (), set () etc. so scripts stays as long as LV Development environment stays with it to execute it. Second is - it still does not support "multi-dimensional arrays" - consider for example converting an RGB image to an array in LabVIEW and wiring the result as input node array here [nn,mm,nc] = size(array); can't work but [nn,mm] = size(array); don't receive a complain - in other words we can't go beyond 2D array math with MathScript. The third, is Mathlab will not work  entirely with calls to Matlab or Scielab toolkits (Scielab nodes only works on LV8.0 to 8.2 for lower than 5.2) . So m-scripts should be written carefully inside these nodes! Forget cell arrays {}, forget structs, forget multidimensional arrays. Fourth, is  that you can define m-functions and actually execute it but only on a MathScript Window, you need to actually wire in every text on the script inside a MathScript in  a new VI identifying all the entries and exit node variables to connect to. If your trying to save ~USD$5K for a Matlab license and felt you need to do it in "hybrid style programming" interfacing the IO instrumentation capability of LabVIEW with the efficient array processing in Matlab - you probably need to work with them together anyway because you need to cut and paste every command you did in Matlab to the command window of MathScript - type help for each keyword built-in function and observe how they behave if at all they do the same thing or not.  

Bernardino Jerez Buenaobra
Senior Test and Systems Development Engineer
Test and Systems Development Group
Integrated Microelectronics Inc.- Philippines
Telephone:+632772-4941-43
Fax/Data: +632772-4944
URL: http://www.imiphil.com/our_location.html
email: Bernardino.Buenaobra@ph.global-imi.com
0 Kudos
Message 7 of 8
(3,261 Views)

We have used the matlab script window heavily out of necessity.  Our lab equipment and some initial analysis was done in LabView.  The whizbang "algorithmists" did their work in matlab.  For us to meet some deadlines, it was necessary for us to make the things work together and still maintain their seperate maintenance envrionments.  What we did was to bring all the input variables into the matlab script window, make a directory definition line of code and then call the function in matlab, passing in all the variables defined at the input edge of the script window.  When the function call to matlab completed, it wrote the output variables to the output variables we had defined in the function call and then returned the MatLab directory to where it had been before the call.  (This is Texas, always close the gate after you go through or you get to go find the cows...).  By doing it this way, we allowed the matlab developers to work "independently" from the LabView developers....each using the latest version of their software.  MatLab has some powerful tools in its development environment. 

 

If you do it this way, you should be able to break down the functions within Matlab and convert / test them a little at a time.

 

 

 

Hope that helps

 

Hummer1

0 Kudos
Message 8 of 8
(3,197 Views)