|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Creating Variables in LV
Is there a way to create variables in LabView?
![]() |
|
#2
|
|||
|
|||
|
Re: Creating Variables in LV
Read through the 2011 Training Material to find the answer.
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|