LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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
Message 1 of 5
(20,526 Views)
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
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 5
(20,520 Views)
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..
0 Kudos
Message 3 of 5
(20,514 Views)
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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(20,498 Views)

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

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

Message 5 of 5
(20,494 Views)