07-31-2013 07:06 AM
Hi,
I've learn about how to create global variables. However, I need to associate a global variable to some controls/indicators I already have in my front panel (not creating a new front panel). Is it possible?
Portuguese:
Olá. Eu aprendi sobre como criar variaveis globais. No entanto, eu preciso associar estas variáveis a alguns controles e indicadores que eu já tenho no meu painel frontal, não criando um novo painel frontal com novas variáveis. Isto é possível?
07-31-2013 07:20 AM
You place the Global Variable that you created to the block diagram... then right click and select either 'Change to Read' OR 'Change to Write' to read from or write to global variable.
07-31-2013 07:30 AM
@1M2S wrote:
I've learn about how to create global variables. However, I need to associate a global variable to some controls/indicators I already have in my front panel (not creating a new front panel). Is it possible?
You cant associate a Global, you read and write it as needed, but it's a separate variable. In this case you'll simply read the global and write the value to an indicator, or the other way around. Be careful of race conditions, local variables and Globals are equally tricky in this regard.
/Y
07-31-2013 04:19 PM
Perhaps the question should be "Why do you want to use a global variable?" In most cases there are better ways to get data from a control to where it will be used.
Please tell us more about what you are trying to do.
Lynn