Go to Post Continuous improvement isn't rocket science. - JVN [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-02-2012, 23:39
ChiefDJ ChiefDJ is offline
Registered User
FRC #1325
 
Join Date: Feb 2012
Location: Ontario
Posts: 2
ChiefDJ is an unknown quantity at this point
Thumbs up Simple Calculation

I was wondering how to make simple calculations in labview. For example, have 5+5 run continuously until it reaches a certain number such as 40. I tried a while loop but it doesn't run continuously. Any suggestions?
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2012, 00:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Simple Calculation

No matter how many times you compute 5+5, the answer will never be 40.

While loops can be configured to run either as long as the "continue" condition is true, or until the "stop" condition is true.

Can you describe what you're trying to accomplish? The way you're asking the question doesn't seem to lend itself to a useful answer.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2012, 09:29
live4321's Avatar
live4321 live4321 is offline
Registered User
AKA: DJ W
FRC #2221 (Robodawgs)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Gallifrey
Posts: 12
live4321 is an unknown quantity at this point
Re: Simple Calculation

Do you mean something like having X+5=X in a loop?
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2012, 12:57
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Simple Calculation

The trick is that you don't want to add 5 and 5 together repeatedly, becasue the answer is always 10. You want to add 5 to the result of the previous calculation. To do this you need to remember the previous calculation. In LabVIEW, there are two structures that remember a value from a previous loop, they are a feedback node and a shift register.

If you use one of those, you should be able to get it to count to 40.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:30.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi