LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plus fractions in LabVIEW

Solved!
Go to solution

Good morning!

 

I have on question, How can I plus some fractions in LabVIEW?

 

Example:

 

(40/100*s+1) + (50/200*s^2+102*s+1)

 

How can I make this operation in LabVIEW??

 

Thanks!

0 Kudos
Message 1 of 16
(5,915 Views)

Hey,

 

Think in dataflow!

And see attached jpg.

 

 

Christian

0 Kudos
Message 2 of 16
(5,898 Views)
They look like constants to me.  If that's the case use .4 and .25, instead of doing 40/100 and 50/200 every time.
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 3 of 16
(5,878 Views)

Hey Tim,

 

I just used the calculations to show the possible implementation in LV. Though you are right to use constants instead of the 40/100 and so on.

 

 

Christian

0 Kudos
Message 4 of 16
(5,866 Views)

Thanks for the help!

I thought have an easier way to make it.

 

and this isn't constant guys

it's because I only make an example to learn how do it

 

I will try here

0 Kudos
Message 5 of 16
(5,856 Views)

Christian_M wrote:

I just used the calculations to show the possible implementation in LV. Though you are right to use constants instead of the 40/100 and so on.


I figured as much.  I was saying it for the OP, because he seems to be new at LV.  I know I've wasted a lot of time starting to code the division before I realized it was just a constant.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 6 of 16
(5,849 Views)
Try using a formula node from the structures palette.  You'll quickly gain a sense of when it's best to use the operation VIs and when to formula nodes (usually for longer calculations - where using the operations VIs creates a mess).  The syntax is a little different than shown in your posting, but the help files will guide the way.
0 Kudos
Message 7 of 16
(5,840 Views)

Hi EduU,

 

I believe that the best way to implement your formula is using the "Expression Node" in the Numeric Palette since you have only one variable (s).

  

By the way, the Christian_M implementation has a little mistakeSmiley Sad, see the attached snapshot.

 

 

 

 Formula.JPG

 

 

 

Hecuba

 

Mfg. Test Engineer
Certified LabVIEW Associate Developer
0 Kudos
Message 8 of 16
(5,796 Views)
@Hecuba   Ups, I see, it was  s^2 and I did s*2, thank you!
0 Kudos
Message 9 of 16
(5,768 Views)

Edu,

 

It those equation are Transfer Function in the "s" domain, you should consider using the Control Design and Simulation Module. Once you created the transfer function, you can see the result and do other operations like obtaining the Frequency Response or simulate its result. Here is the code for adding the two transfer functions you described above

 

Fraction calc.pngfrontpanelresult.JPG

 

Let me know if this answer your question!

Message Edited by Barp on 10-27-2009 08:12 AM
Barp - Control, Simulation, RTT and HIL - National Instruments
Message 10 of 16
(5,750 Views)