キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

formula node

I need a formula node with one input and one output.
For input > 20;
output = 5;
else
output = 0;
 
How do I write this in the formula node?
0 件の賞賛
メッセージ1/9
3,902件の閲覧回数
スマイリー 平静 I am not sure that a formula node is the best tool to do that...

What about this :


Message Edité par TiTou le 07-07-2006 11:37 AM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

メッセージ2/9
3,899件の閲覧回数

You have simpler options for doing this sort of operation

you dont need no formula node for that!

On block diagram First use  'greater than' function ( look in  comparison tools), to find if input > 20. Next wire the boolean output to 's' input in  'select' function ( found in comparisons tools)

Wire  a numeric constant '5' to input teminal named 't' in 'select' function

Wire  a numeric constant '0' to input teminal named 'f' in 'select' function

If input 's' is true, select shall pass '5' in its output,If input 's' is false, select shall pass 'o' in its output

hope this helps.

How I wish that presently LabVIEW was installed on my system, so that i could have posted a snapshot of the block diagram スマイリー 悲しい

メッセージ3/9
3,894件の閲覧回数

Ha!

TiTou beats me to that while I am typing the script!スマイリー 舌

Thats what I was trying to explain in words!

In LabVIEW, functions speak louder than mere words! スマイリー とてもハッピー

 

0 件の賞賛
メッセージ4/9
3,894件の閲覧回数
Hi Dev,
I beat you on the finished line because LabVIEW lets you draw code faster than you speak ! スマイリー 舌
In other words : LABVIEW ROCKS !

Save the word, show the code スマイリー とてもハッピー


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

メッセージ5/9
3,890件の閲覧回数

Aye to that!

cheers!

on the rocks!

0 件の賞賛
メッセージ6/9
3,882件の閲覧回数
I would use operator primitives as well, but the original question was how to do it with the formula node.

Here is one formula that would work:
(input > 20)?(output=5):(output=0);

I like it because it is all in one single statement.

An easier to understand formula would also work:
if (input>20)
(output=5);
else(output=0);

Hope that this helps,
Bob Young


0 件の賞賛
メッセージ7/9
3,867件の閲覧回数
Hmmm, I don't really know what language it is (C or C++ スマイリー びっくりした ) .. I've completely forgotten how to spell C now that I develop with LabVIEW スマイリー とてもハッピー

I understood you wanted a formula node, but I did not understood WHY...
If you are developping soft with LabVIEW, why not using LabVIEW functions ? As time goes by I think there are less and less things that can be done in C and not in LabVIEW.

Moreover, I think your line of C code should work in a formula node... スマイリー 平静

Write in G
Check this out スマイリー とてもハッピー !

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 件の賞賛
メッセージ8/9
3,862件の閲覧回数
Hi,
Thanks for good answers, I think LV functions is the easiest way to solve this, but I just explained it simple to get to know how to use a "FOR" function in the formula node....
 
-Christian 😉
0 件の賞賛
メッセージ9/9
3,833件の閲覧回数