LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fit data in MathScript with user-defined function

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

0 Kudos
Message 1 of 2
(1,254 Views)

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

Developing Algorithms Using LabVIEW MathScript RT Module: Part 1 – The LabVIEW MathScript Node - Nat...

Developing Algorithms Using LabVIEW MathScript RT Module: Part 2- The LabVIEW MathScript Window - Na...

 

Hopefully this helps you move forward.

-joeorbob

0 Kudos
Message 2 of 2
(1,184 Views)