08-05-2020 04:16 AM
Hi all,
I am trying to implement some fits with a MathScript node with a user-defined function.
Something is obviously wrong, the code is greyed out in parts, although absolutely not clear to me what the issue is. I attached the vi, made in LV2018, 32bit. Not sure whether the syntax is up to date? The online help w.r.t function syntax directs one to a LV 2012 help page: https://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmathmain/mathscript_function_syntax/
Thanks in advance for helping!!
best,
Christian
08-06-2020 02:29 PM
Hi, @chrmwo,
So, if I understand correctly, what you're asking is:
Not sure whether the syntax is up to date?
I'm not sure either. But have you tried the syntax in the link you posted? It says that if you use a function, it needs to be defined and saved before being used.
Looking at your MathScript node, it looks like you're trying to define functions in-line with the "function" keyword. But based on the syntax in the link you posted, that's only used in the beginning of a function (or in a sub-function, which needs to be defined in a function, and then only used by that function).
Your node does not look like a function, so using the word "function" part-way through seems incorrect.
Have you tried defining your functions in separate .m files per the syntax in the link you posted?
If it helps, here are some other resources:
Using MathScript and Formula Nodes in NI LabVIEW - National Instruments
Hopefully this helps you move forward.
-joeorbob