06-04-2009 06:24 AM
Hi,
I`ve been trying to incorporate mathscript function calls in LabVIEW .
However am denied the functions and throws "unexpected token: function" error.
Even the basic examples with function calls refuse to work .
Would like to know if there are any work arounds for this or has NI removed the
support to function calls in mathscript.
I am currently using LabVIEW 8.6.
This is the script I have been trying to execute :
function ave=compute_average(x,y)
%compute_average determine the average
ave=(x+y)/2;
Regards,
Sundar.
06-04-2009 07:23 AM
Have you followed the steps mentioned here:
Be sure to try the DevZone linked mentioned at the bottom of that page.
06-05-2009 12:14 AM
Yes , I have followed the standard mathScript Syntax.
Not sure if am missing out any critical settings..
The sample code stated above is very much adhered to the specified syntax.
Sundar.
06-05-2009 12:41 PM
06-05-2009 12:45 PM - edited 06-05-2009 12:46 PM
GrantM is correct.
Pre-existing scripts must be called, you do not need to write the entire script in the node.
Just call it, and include the parameters as inputs.
If you would like to run code the way you listed above, you can use the formula node to calulate things in place.