Go to Post Indianagineers! (n.: In-di-ae-nah-jih-nir: any resident of Gary, Indiana, or it's suburbs, who is trained in the use or design of machines or engines, or in other areas such as electrical or chemical technology) - dlavery [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 17-02-2013, 07:50
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: How to program a button this way?

In the text language, the Boolean variable would need to be static or global in order to keep its value from call to call. That serves the same purpose as the feedback node. It remembers state data in a scope that is longer lived than the function call.

In a text language, the local variables, and in LV, the wires, have a short-lived scope that is cleared each time the function is called. They are temporaries.

FYI, you can actually make global variables in LV too, so if you don't get the hang of the feedback node, try with globals. But the feedback node or shift registers are a somewhat safer and more controlled language feature, like static local variables are in C, etc. So it is good to learn how to use them.

Greg McKaskle

Last edited by Greg McKaskle : 17-02-2013 at 07:51. Reason: commas
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 04:41.

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