LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathscript node access to class data

I am trying to implement some code which I developed in Matlab in Labview. The code uses functions from the Control and Optimization toolboxes, and looks like it will port easily to Mathscript. I need to parameterize a state-space model of several drugs from several parameter (age, height,weight, gender). I can see how to create an lvclass Patient with a control which uses these four parameters in the private data. I'd like to be able to duplicate the Matlab-style syntax of Patient.Age, etc, by just wiring the Patient object to a Mathscript node.  There doesn't seem to be a way to do this without unbundling first. This seems inelegant, as it requires me to hard-code the names of the private data fields in the mathscript node interface. Is there a simple way to define lvclass data in a class VI's mathscript node?

 

Matlab 2008a, Labview 8.6, MacPro OSX 10.5. 

 

0 Kudos
Message 1 of 3
(6,667 Views)
Hello,

The MathScript syntactical element you are referring to is a structure.  Unfortunately, we do not have support for structures or cell arrays in MathScript at this time.  It is a limitation we are aware of and investigating for a future release.    You have discovered the workaround.  You will need to unbundle your class data and create separate variables for each member variable in the MathScript node.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 3
(6,661 Views)

Thanks. I would suggest that the more the implementation resembles Matlab cell arrays, the easier it will be to adapt code.

 

0 Kudos
Message 3 of 3
(6,656 Views)