LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global variable not updating in main vi

Now seeing the internals of your Read_jet_data VI, the problem is that your top level VI is never finishing the first execution of its while loop's diagram.

 

One of the aspect's of LabVIEW's dataflow design is that you cannot finish execution of your while loop diagram and begin the next iteration until everything on the diagram has finished.  Because your Read_jet_data subVI has its own while loop that does not exit (until you press a button!?), your top level VI will never move on, meaning it will never check those globals and update its indicators again.

 

You should take a look at the introduction tutorials that RavensFan linked.



0 Kudos
Message 11 of 27
(1,968 Views)

Hello,

 

Thanks for clearing.

 

I even removed the while loop of read_jet_data sub vi, but that didn't make any difference. It was not updating even then. Is there any other way to do it? 

0 Kudos
Message 12 of 27
(1,963 Views)

You also have something labelled ReadDatalogLiner in the diagram in the original image.  If that is still there, then it is also being executed in the while loop - what does it do?



0 Kudos
Message 13 of 27
(1,956 Views)

It is also read data which updates other variables (other than RPM and force)... read_dataloger doesn't have any while loop inside it.... That existed before I added read_jetdata subvi....

0 Kudos
Message 14 of 27
(1,949 Views)

If you could zip all of your files and attach them, that would probably help us to help you.



0 Kudos
Message 15 of 27
(1,930 Views)

Hi, 

I have attached the vi here... Thanks ...

0 Kudos
Message 16 of 27
(1,919 Views)

In the attached version, the jet read VI still had the while loop.  When I removed it, I was able to get it to behave as expected.

 

Your read from Datasocket has the default timeout of 10,000 ms.  Could it be waiting on this, causing you to think that it is not working?

 

 

Why are you using globals for this, anyway?  Do they actually need to be global and available to something somewhere else in your application?  If not, then you would probably do better to simply create indicators in your subVI's and assign them to output terminals that you can read from in your top level VI.

 

Also, you did not include all dependencies (the graphs global was missing) and you had renamed the files and not updated their dependencies to each other before sending them.



0 Kudos
Message 17 of 27
(1,909 Views)

VItan makes good points. Here is the way it might look without globals or the subVIs.

 

Checking the DataSocket Read timed out and error out lines would allow more robust response to problems with the remote equipment.

 

Lynn

 

No globals.png

0 Kudos
Message 18 of 27
(1,896 Views)

I want to use it for other application too... So I want it in Global variable form only.. So is there any other way to update data using global? it would be really helpful... 

 

Thanks in advance guys..

0 Kudos
Message 19 of 27
(1,893 Views)

If I reduce that timeout seconds, will tat help in updating? 

0 Kudos
Message 20 of 27
(1,891 Views)