Go to Post Striving to build the "best robot" is a fine goal -- don't hate on it. - 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 19-02-2011, 17:59
Left Justified Left Justified is offline
Registered User
AKA: Calvin Norman
FRC #2647
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Phoenix
Posts: 6
Left Justified is an unknown quantity at this point
Creating Variables in LV

Is there a way to create variables in LabView?
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2011, 18:01
Wicked Wicked is offline
Registered User
FRC #0354 (G-House Pirates)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2008
Location: New York
Posts: 46
Wicked is an unknown quantity at this point
Re: Creating Variables in LV

Read through the 2011 Training Material to find the answer.
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2011, 18:24
MotorHead's Avatar
MotorHead MotorHead is offline
Programming Mentor
AKA: Jeff Beltramo
FRC #1922 (OZ-Ram)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Concord, NH
Posts: 68
MotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to behold
Re: Creating Variables in LV

You can local variables that only exist within a single vi and you can have global variables that all vi's within a project can have access to. Search LV help on local and global variables to see how to define.
__________________
Jeff Beltramo
Team #1922
Concord, New Hampshire

Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2011, 19:01
iblis432 iblis432 is offline
Co Captain/Chief Programmer
AKA: Bobby
FRC #2106 (Junkyard Dogs)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Virginia
Posts: 146
iblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to beholdiblis432 is a splendid one to behold
Re: Creating Variables in LV

to expand on Motorhead's explanation,
every control and indicator is actually a 'local variable'. In the functions pallete, go to Programming> structures and you will see the local and global variable 'vi' (though they are technically not VIs). You can right click these and change them between read and write.

For variables that go between VIs, you can create a global variable in your project. For the robot, I suggest passing data through the premade Global Robot Data file. To add data to this variable, just open it from the project explorer and add the controls that you want.
__________________
"Don't worry, programming can fix it"
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2011, 21:15
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: Creating Variables in LV

You don't mention why you need a variable.

One of the things that programmers are often tripped up by in LV is overuse of variables. They do have their purpose, but in reality are very rarely used in LV. Unless you are pretty careful to avoid parallel code, it is best to learn how to use wires instead.

Greg McKaskle
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 08:10.

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