Go to Post Keep in mind that words can be harsh and people do not forget what is said against them. Please, for your teammates sake, keep your egos in check and try to use some tact and consideration. - Andy Baker [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-01-2009, 17:02
Chris11246 Chris11246 is offline
Registered User
FRC #1647
 
Join Date: Jan 2009
Location: Southampton
Posts: 14
Chris11246 is an unknown quantity at this point
How do i find a variable and use it on Labview

Im trying to get a variable on Labview that has an input and an output but i cant find one. Ive found local and global variables but then how do i use them.
Reply With Quote
  #2   Spotlight this post!  
Unread 19-01-2009, 17:10
Booksy Booksy is offline
Registered User
FRC #1244 (Viking Robotics)
Team Role: Programmer
 
Join Date: Apr 2008
Rookie Year: 2007
Location: Great White North
Posts: 97
Booksy will become famous soon enoughBooksy will become famous soon enough
Re: How do i find a variable and use it on Labview

I seem to be in the same predicament as you... I get the variables, but wiring anything to them gives broken wires. I think I have only found input variables.

FYI, the variables that I am talking about are in the programming menu.

EDIT: http://zone.ni.com/devzone/cda/tut/p/id/7585 - Looks like "change to read" is what you (I) want.
__________________
My favorite CD quote ever(taken out of context of course):
Quote:
Originally Posted by ttldomination
water would be hard to build

Last edited by Booksy : 19-01-2009 at 17:14.
Reply With Quote
  #3   Spotlight this post!  
Unread 19-01-2009, 17:27
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: How do i find a variable and use it on Labview

Chris,
After you create a control or indicator on the front panel (or right-click on a subVI or function and select "create control" or "create indicator" which does this for you automatically), you can create local variables for accessing it by right-clicking on its icon in the block diagram and selecting "create local variable". If you use the "finger" tool on a local variable, you can change what variable is attached by selecting from all variables in the VI.

Russ
Reply With Quote
  #4   Spotlight this post!  
Unread 19-01-2009, 17:32
Chris11246 Chris11246 is offline
Registered User
FRC #1647
 
Join Date: Jan 2009
Location: Southampton
Posts: 14
Chris11246 is an unknown quantity at this point
Re: How do i find a variable and use it on Labview

Thats just a local variable i know how to find them but how do i use one to input and output values.
Reply With Quote
  #5   Spotlight this post!  
Unread 19-01-2009, 17:34
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: How do i find a variable and use it on Labview

Do what Booksy says - right-click and "change to read" or "change to write" to set it to an indicator/control (aka output/input).

When in doubt, right-click. It unlocks "everything".

Russ
Reply With Quote
  #6   Spotlight this post!  
Unread 20-01-2009, 15:20
Chris11246 Chris11246 is offline
Registered User
FRC #1647
 
Join Date: Jan 2009
Location: Southampton
Posts: 14
Chris11246 is an unknown quantity at this point
Re: How do i find a variable and use it on Labview

Yes but i want something that doest both at once that just lets it either read or write. Is there some way to connect a read variable and a write variable
Reply With Quote
  #7   Spotlight this post!  
Unread 20-01-2009, 15:22
Booksy Booksy is offline
Registered User
FRC #1244 (Viking Robotics)
Team Role: Programmer
 
Join Date: Apr 2008
Rookie Year: 2007
Location: Great White North
Posts: 97
Booksy will become famous soon enoughBooksy will become famous soon enough
Re: How do i find a variable and use it on Labview

Quote:
Originally Posted by Chris11246 View Post
Yes but i want something that doest both at once that just lets it either read or write. Is there some way to connect a read variable and a write variable
why not make 2?
__________________
My favorite CD quote ever(taken out of context of course):
Quote:
Originally Posted by ttldomination
water would be hard to build
Reply With Quote
  #8   Spotlight this post!  
Unread 20-01-2009, 15:31
jmanela's Avatar
jmanela jmanela is offline
+1 is BIGGER than -1
AKA: Joshua Manela
FRC #2586 (Fondy Fire)
Team Role: College Student
 
Join Date: Aug 2008
Rookie Year: 2009
Location: Michigan
Posts: 314
jmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to beholdjmanela is a splendid one to behold
Re: How do i find a variable and use it on Labview

check whether the value is boolean or numeric, and make sure it wires to the corresponding input.
__________________
||2009|| Entrepeneurship Award, QF - Traverse City | Rookie All Star, QF - Detroit | Highest Rookie Seed, Rookie All Star, QF - Michigan State Championship | Finalist - MARC ||2010|| Engineering Inspiration, Website Award, SF- Kettering | Judges Award, Website Award, SF - Detroit | Website Award, Winner, Michigan State Champ //Thank you 469 and 1918!! | Finalist - MARC ||2011|| Engineering Inspiration, Website - Kettering | Entrepreneurship, Website, Finalist - Waterford | Website - MSC
Reply With Quote
  #9   Spotlight this post!  
Unread 20-01-2009, 15:31
Chris11246 Chris11246 is offline
Registered User
FRC #1647
 
Join Date: Jan 2009
Location: Southampton
Posts: 14
Chris11246 is an unknown quantity at this point
Re: How do i find a variable and use it on Labview

Yes but will those be connected. I want one value that will be changed by the joystick value and then will change the motor speed not two values. (Im not using the Crio stuff for testing so i cant use get motor speed or set motor speed)
Reply With Quote
  #10   Spotlight this post!  
Unread 20-01-2009, 15:58
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: How do i find a variable and use it on Labview

Any wire in LabVIEW can be read from but can only be written to by a single output.

You can create as many local variables (either read or write variety) for the same "physical" variable. You can have many outputs "simultaneously" writing to the same "physical" variable via many local variables (see attached).

Russ
Attached Files
File Type: pdf local variables.pdf (18.3 KB, 91 views)
Reply With Quote
  #11   Spotlight this post!  
Unread 20-01-2009, 16:01
BLAQmx's Avatar
BLAQmx BLAQmx is offline
Software Engineer
no team (National Instruments)
Team Role: Engineer
 
Join Date: Sep 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 100
BLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of light
Re: How do i find a variable and use it on Labview

Be careful when you write to a variable. Its good practice to only write to a variable in one location, but you can read from the variable in many locations. If you write to a variable in multiple locations you are bound to run into race conditions.
__________________
NI FIRST Community: Where to go for LabVIEW, Wind River, cRIO-FRC, and NXT support.
Reply With Quote
  #12   Spotlight this post!  
Unread 20-01-2009, 16:08
Chris11246 Chris11246 is offline
Registered User
FRC #1647
 
Join Date: Jan 2009
Location: Southampton
Posts: 14
Chris11246 is an unknown quantity at this point
Re: How do i find a variable and use it on Labview

Ok but if i have multiple variables then how do i know which one is which read is connected to which write variable.
Reply With Quote
  #13   Spotlight this post!  
Unread 20-01-2009, 16:20
Russ Beavis Russ Beavis is offline
Registered User
no team
 
Join Date: Nov 2005
Location: Manchester, NH - DEKA R&D Corp.
Posts: 341
Russ Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond reputeRuss Beavis has a reputation beyond repute
Re: How do i find a variable and use it on Labview

That "example" that I published? FULL OF RACE CONDITIONS (intentionally). Good luck trying to figure out the order of precedence in that. I was simply trying to show that it's possible.

The OS/program will only store 1 "real" copy of the variable in a single memory location. Every function can simultaneously read/write to the single memory location from "anyplace". But as BLAQmx points out, be careful when you have multiple writes that are happening simultaneously.

You'll never know which "write" "wins". That's why I use sequences to force program flow where necessary. Being a very single-threaded engineer, I use a LOT of stacked sequences.

Russ
Reply With Quote
  #14   Spotlight this post!  
Unread 20-01-2009, 16:46
BLAQmx's Avatar
BLAQmx BLAQmx is offline
Software Engineer
no team (National Instruments)
Team Role: Engineer
 
Join Date: Sep 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 100
BLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of light
Re: How do i find a variable and use it on Labview

Every variable can be either read or written to.I n that sense there is only one variable but two states. This single variable may have multiple copies of readers and writers, but they are all reading and writing from the same place in memory.

Let me know if the screen shot I have attached helps at all.
Attached Thumbnails
Click image for larger version

Name:	Variables.png
Views:	111
Size:	27.4 KB
ID:	7183  
__________________
NI FIRST Community: Where to go for LabVIEW, Wind River, cRIO-FRC, and NXT support.
Reply With Quote
  #15   Spotlight this post!  
Unread 20-01-2009, 16:51
Chris11246 Chris11246 is offline
Registered User
FRC #1647
 
Join Date: Jan 2009
Location: Southampton
Posts: 14
Chris11246 is an unknown quantity at this point
Re: How do i find a variable and use it on Labview

In your example you have variables with "X" and "Y" in them all i get are "?"s how did you rename the variable.
BLAQmx where do you find the boolean, string, and numeric all i can find are local, global, and shared and how do you name them.

Last edited by Chris11246 : 20-01-2009 at 16:54.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable rollover with Labview (suggestions?) kamocat NI LabVIEW 7 22-08-2008 08:30
NEED GENERAL HELP on how to find programming and animation resources delphi demon General Forum 1 02-04-2007 15:58
how do i find the camera with labview? CompMaster NI LabVIEW 0 16-02-2006 12:52
How do you find time for sports and robots? Whalley General Forum 50 23-03-2005 12:11


All times are GMT -5. The time now is 09:44.

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