|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [FTC]: Variables in labview | wilsonmw04 | FIRST Tech Challenge | 2 | 23-11-2008 08:57 |
| Labview dashboard and multiple variables | Joe Ross | LabView and Data Acquisition | 2 | 15-03-2006 21:55 |
| Making a LabVIEW Multimeter | Bruce Barber | National Instruments LabVIEW and Data Acquisition | 4 | 10-02-2006 11:54 |
| HELP!!! Counters, global variables, and the like | danielkitchener | Programming | 2 | 23-02-2004 23:53 |
| Global Variables, anyone? | Darkman_X000 | Programming | 3 | 05-02-2004 22:11 |