10-12-2009 09:55 AM
One of the fantastic things about LabVIEW is the instant help it gives you as you develop your VIs. The context help window (available via Ctrl-H) gives you quick help for the palette functions that you call. You can also set up the subVIs that you write to have custom context help by modifying the VI Description field of your VI. And if you hover over a wire, the context help shows you detailed information about its data type.
In LabVIEW 2009, MathScript features the exact same instantaneous feedback for the text within your MathScript Nodes. The analogy of a palette function in MathScript is a built-in function like ‘cos’, ‘fft’, or ‘size’. If you hover over the call to one of these functions, the context help will show you the proper syntax for calling the function, descriptions of all the inputs and outputs, and even example code snippets.
Just as you can document your own subVIs in LabVIEW, you can document your own functions in MathScript. The standard way to do this is to add some lines of comments, preceded by %percent signs, to your .m file after the function declaration. Now when you call the function in that .m file from a MathScript Node, the context help will show those comments, as well as the path of the file you’re calling.
Finally, wires in LabVIEW are represented as variables in the MathScript world. If you hover over a variable in the MathScript node you will see the variable’s data type in the context help window. This is the exact same type that LabVIEW would use if you output that variable from the MathScript node (see last week’s nugget for more info). MathScript is even smart enough to differentiate between two types of 1D arrays: row vectors and column vectors.
Once I started using this feature, I could no longer imagine how I possibly lived without it. I hope you give it a try and feel the same way!
jattas
LabVIEW MathScript R&D
ps Check out previous nuggets here.
10-13-2009 10:22 AM
jattas wrote:.
.
.
Once I started using this feature, I could no longer imagine how I possibly lived without it. I hope you give it a try and feel the same way!
jattas
LabVIEW MathScript R&D