LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

formula node

Solved!
Go to solution

Hi! I have two problems with the formula node. I want to realize a sine function and show it on the graph.
The first problem is that i'm not able to wire the output (x) with the Waveform graph, the second one is the error in the formula node but i think that it is written properly since i took it from one of my teacher's example.
I have attached the VI. can you give a look at it? Thank you in advance.
Salvatore

0 Kudos
Message 1 of 13
(3,740 Views)

Hi Salvatore,

 

your output x is just one single value, but a Graph accepts an array of values.

 

 

 

n is not defined in your formula node; just change the formula node's input "length" to "n" and delete the first row.

 

 

 

Regards,
Alex

 

 

 

 

 

0 Kudos
Message 2 of 13
(3,721 Views)

Hi Alex,

the first row is important to create the "time dimension", if I delete it i'll have as result a line with all 1 and not the cos function as I wish.
About the output I have understood that it is a single value but probably I haven't done the right question that is:why isn't it an array? and is it possible to switch it into an array?

Thank you

0 Kudos
Message 3 of 13
(3,718 Views)

First of all, your output will always be 1 (cos(2*pi*x) = 1).  Are you sure about your formula?  Secondly, just do it in LabVIEW.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 13
(3,697 Views)

first i want to learn the formula node 

second:

considering n=t that goes as it was written from 0 to length (lenght could be 100)  and a = 50Hz is it always 1? i think not... 🙂

0 Kudos
Message 5 of 13
(3,688 Views)

Like crossrulz said, if n is an integer, the output all always be 1:

 

Cosine.PNG


Data Science Automation

CTA, CLA, CLED
SHAZAM!
0 Kudos
Message 6 of 13
(3,673 Views)

mmm and what formula should I use? In matlab i used to do cos(2*pi*f*t) 

0 Kudos
Message 7 of 13
(3,665 Views)

@s.turino84 wrote:

mmm and what formula should I use? In matlab i used to do cos(2*pi*f*t) 


And also in Matlab you probably used fractional seconds.  Something like 0:0.1:1 (it has been awhile since I did Matlab, I think that's the correct formatting) would result in an array from 0 to 1 in 0.1 steps.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 13
(3,653 Views)

I don't see where you attempted to define a Loop within the formula node.

0 Kudos
Message 9 of 13
(3,647 Views)

I guess the formula is ok, but you need a loop to create an array.

Here's what I had in mind:

 

 

 

2013-07-17_waveform-formula.png

 

 

but remember crossrulz, if A is an integer, the result will always be one.

 

 

0 Kudos
Message 10 of 13
(3,639 Views)