09-02-2011 01:15 AM - edited 09-02-2011 01:25 AM
Hello to you all,
I would like to add a status bar using a global variable, unfortunately it does not work that way I thought.
Pls see attachement: Status_test_global.vi contains the global variable that I used.
What couses the problem and how can I solve it ?
Every answer is appreciated.
Br
B.
PS: Status_global.picture is a *.jpeg
Solved! Go to Solution.
09-02-2011 01:28 AM
You're reading from the globabl variable just one time at the beginning of your program because the global variable read is located outside the while loop.
What would you have expected to happen?
09-02-2011 01:38 AM - edited 09-02-2011 01:41 AM
Hi Ravens Fan,
I expect that every message is displayed in the Statuszeile one after another !
please see attached picture. How can I arrage a read in every part of the sequence structure to the same Statuszeile?
Thanks !
B.
09-02-2011 03:23 AM
You update the global variable, you dont update the indicator.
/Y
09-02-2011 04:44 AM
Yes, you are right. How can I update the Indicator ?
09-02-2011 06:13 AM
You can create a local variable of the indicator and update both in the frames (just split the wire).
/Y
09-02-2011 06:17 AM
or create two while loops, one where you update the global, one where you read it out.
I would suggest you to look up "functional global variable" and "action engine" to avoid racing conditions as well as global variables.
09-02-2011 08:14 AM
thanks, so far...I am a fully LabView beginner...
Yamaeda: How to split the line ? Is it possible to post the vi with the solution ?
Questionmaker: Interesting points with the functional global variable, I have to take a closer look on it. Could you create a little vi using "fgv", and could you explain the idea with the two while loops more in detail or also post a vi ?
That would be great !
BR
B.
09-02-2011 08:16 AM
There are some mistakes in your VI.
1) You have not followed dataflow structure between updating global variable and delay time.
2) You are not updating indicator (You have kept it outside loop hence it will update only one time)
Do following correction
1) Make functional global VI. (Take reference from forum if you don't know about functional global)
2) make two while loop structure running parallel.
3) From one loop update message in Functional global vi.( Keep sequence like -messageupdate-delay-messageupdate-delay..so on)
4) Read functional global vi in another loop also keep some delay in this loop.
Try this correction.
Prashant
CLAD
Labview 6.1-2010
KUDOS ARE WELCOMED
09-02-2011 08:18 AM
/Y