NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Member
sivamit2002
Posts: 21

How to write functions in labview formula node?

Hi,
Im new to Labview. I want to know whether we can implement functions in Labview formula node...?
Also can we get array output from a formaula node..?
In my program input is an array..the output I calculate is also an array..?
How to solve this problem..
Please help me...
 
 
-Shiva
Trusted Enthusiast
Norbert_B
Posts: 4,789

Re: How to write functions in labview formula node?

[ Edited ]
Shiva,

the formula node does not support writing own functions to be called alter in the node. You can do this using the XMath- or the MathScript-node.
Nevertheless, the formula node is designed to incorporate algorithms which are quite complex in LabVIEW code, but a single line in C.
But do not forget: The code within the formula node is normally executed slower than LV-generic code!

hope this helps,
Norbert

[Edit]: For Arrays as input, just connect an array to the connector. For outputs, you have to name the terminal just like an array-variable in your formula...


Message Edited by Norbert B on 07-04-2008 03:19 AM
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Member
sivamit2002
Posts: 21
0 Kudos

Re: How to write functions in labview formula node?

Hi Norbert,
Thanks for your reply.
I tried to connect array variables used inside the formula to array labview object.It shows scalar type cannot be connected with 2-D array..
Trusted Enthusiast
Norbert_B
Posts: 4,789
0 Kudos

Re: How to write functions in labview formula node?

Shiva,

open the examplebrowser and search for "formula". Select the "quick sort.vi" in the list. This example contains an input and an output element for an array.

hope this helps,
Norbert

----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Active Participant
Andrey_Dmitriev
Posts: 1,540

Re: How to write functions in labview formula node?

For example (at least for 1-D array):

Andrey.
PS
As was describged above, Help->Find Examples... is a very useful point!