LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

status with global variable

Solved!
Go to solution

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

 

Download All
0 Kudos
Message 1 of 13
(3,473 Views)

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?

0 Kudos
Message 2 of 13
(3,467 Views)

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.

0 Kudos
Message 3 of 13
(3,462 Views)

You update the global variable, you dont update the indicator.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 13
(3,443 Views)

Yes, you are right. How can I update the Indicator ?

0 Kudos
Message 5 of 13
(3,439 Views)

You can create a local variable of the indicator and update both in the frames (just split the wire).

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 13
(3,435 Views)

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.

Message 7 of 13
(3,432 Views)

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.

0 Kudos
Message 8 of 13
(3,413 Views)

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

PBP
Labview 6.1 - 2019
0 Kudos
Message 9 of 13
(3,410 Views)

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 13
(3,409 Views)