OCCRA
Go to Post FIRST has set me on a completely different path in life. And I'm all the better for it. - Vincent Chan [more]
Home
Go Back   Chief Delphi > Technical > National Instruments LabVIEW and Data Acquisition
CD-Events   CD-Media   CD-Spy   FRC-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 01-19-2009, 12:00 PM
Joshamuffin Joshamuffin is offline
Programmer
FRC #1723 (FBI)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Missouri
Posts: 24
Joshamuffin will become famous soon enough
Send a message via MSN to Joshamuffin
Making global variables in LabVIEW.

I made separate VI's to control the drive motors. In the default program, there are global variables that are device references. I need to make my own device references for the joystick and the motors. Otherwise I would have to copy/paste the code directly into the main body, which I would like to avoid.
Reply With Quote
  #2   Spotlight this post!  
Unread 01-19-2009, 12:35 PM
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: Making global variables in LabVIEW.

What's the question?

If you right-click on the "cRIO" in your LabVIEW project window, you should be able to create a "global" that you can copy whatever controls and indicators you'd like into. The "global" actually looks and feels exactly like the front panel of a VI. It's just a container for arbitrary data.

You can drag any variable within the global into any VI within the project and share the data.

You can probably also modify the global that is in the default project by adding new variables.

Globals can be very useful for sharing data across VIs that are called from the same "main" VI. Just be careful with race conditions and multiple writes to the same variable at the "same" time (especially if you've got multiple programmers who want to write to a single global variable). In general, I like to limit "writes" to one VI and let every other VI "consume" the data.

Russ
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
[FTC]: Variables in labview wilsonmw04 FIRST Tech Challenge 2 11-23-2008 07:57 AM
Labview dashboard and multiple variables Joe Ross LabView and Data Acquisition 2 03-15-2006 08:55 PM
Making a LabVIEW Multimeter Bruce Barber National Instruments LabVIEW and Data Acquisition 4 02-10-2006 10:54 AM
HELP!!! Counters, global variables, and the like danielkitchener Programming 2 02-23-2004 10:53 PM
Global Variables, anyone? Darkman_X000 Programming 3 02-05-2004 09:11 PM


All times are GMT -5. The time now is 07:00 AM.

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


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