LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use a local or global variable

My question:

 

I want to use a local or global variable  in a single VI program.

 

I want to be able to create and name variables as the single VI program executes?

0 Kudos
Message 1 of 6
(1,412 Views)

Why?  Care to elaborate more on what your application is and why you think to need to define variables on the fly?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(1,408 Views)

You definitely need to explain in much more detail what you actually want to do. It is significantly more helpful to explain what you want to do, and not how you want to do it.

 

(For example you could use a Map to store name<>value pairs.)

0 Kudos
Message 3 of 6
(1,403 Views)

oh naming variables on-the-fly.. I was just thinking it might be something I could use in order to save real estate.

 

So I don't really have a explanation currently exactly how I would use that..

 

I just want to know if it's possible or not?

0 Kudos
Message 4 of 6
(1,352 Views)

@chrlum47 wrote:

oh naming variables on-the-fly.. I was just thinking it might be something I could use in order to save real estate.

 

So I don't really have a explanation currently exactly how I would use that..

 

I just want to know if it's possible or not?


There are certainly ways to do essentially what you are asking, but why would you want to do so? The fact that you are asking about local and global variables suggests that you look at these as normal programming practice. They are not. There are instances where they are useful, but improper use will lead to all sorts of race conditions. I'm working on a project now with hundreds of vi's and not a local or a global variable in sight.

0 Kudos
Message 5 of 6
(1,345 Views)

Fair enough thanks

0 Kudos
Message 6 of 6
(1,341 Views)