LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Local Variables

The problem is that I want to create a local variable, (which I have done), and then simply link it to my block diagram of my VI. I believe I stuck the VI, (which I want to make a node and connect it to the Local Variable), and the Local Variable VI into the same Library, (I tried to create one). I don't even know if I needed to do this but I tried to do it because I coulden't figure out how to invoke a reference and connect it to a local variable.

Thanks for any help and Please see the attached files. In red dialog is where I want to make an attachment to a local variable.

Brian
Download All
0 Kudos
Message 1 of 3
(2,823 Views)
What you call a "local variable" is actually a "global variable". If you want a reference to it on your diagram, just drag the icon of the global variable on your diagram.

It seems to me that you are hacking around in the blackjack VI available HERE. This is not very good code to begin with, because it suffers severely from a bad case of "sequence'itis" and "local variable'itis". Now you want to make it even worse by infecting it with "global'itis"????

It should not be too hard to cleanly rewrite this entire thing with a single event structure, no sequences, and virtually no local va
riables at all!

I don't fully understand what you are trying to do, maybe you could try to explain it a little better. What is the purpose of the global? Adding 20 global references just does not sound like it's the right thing to do. (It makes me shudder....). 🙂
0 Kudos
Message 2 of 3
(2,822 Views)
altenbach,
Lol, What I am trying to do is create a game, in this game I will have 2 decks of cards, from one deck I will have a high probability of choosing a positive number and from the second deck a low probability of choosing a positive number

(you might recognize me also with a handle "relative0"). Since I post similar questions.

What I want to do is be able to track (write string to file and graph), peoples choice from each deck. This is why I am hacking up the Blackjack trying to understand what it is doing and trying to use pieces I need.

For example I asked a previous question about where LabVIEW stores its memory. Notice in the blackjack game if you click on one of the cards you get a little side screen with a choice o
f 53 cards, (deck and a black card). I don't know where these cards come from and I want to make my own cards. How would I do this?). Also the reason that I was trying to create a local variable is because in the first block diagram in the first while loop there are all kinds of nodes that hold spaces to cards on the front panel. Now I want to make spaces for 20 cards, (they get to choose 20). And as you might imagine this will take up a lot of space. Because of this I tried making the 20 nodes and sticking turning them all into a subVI but then it seems that if I want to make a reference to something in this new block diagram but want to have the reference in another block diagram, (the original block diagram for example), this will not work, I mean I there is no reference for me to select (under right click "select item). This is why I was figuring that I needed a global or local variable.

Thanks much

Brian
0 Kudos
Message 3 of 3
(2,822 Views)