LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

global variable not updating in main vi

Hello Friends,

I had already prepared a vi with global variables assigned in it previously... now I have updated 4 more global variables to this vi... The output at the read jet data sub vi is updating whereas the force and the rpm values are not updating in this main vi.... I call this as main vi because I just see the final output here, all in one front panel...

If i click on run once, I get 1 value and in order to get another value i should stop and run again.

Could you please suggest me how can I get it updated continuously?

 

 

 

 

Global vis.png

0 Kudos
Message 1 of 27
(4,565 Views)

I don't understand what you are trying to do.  I don't see where you are writing any values to the global variables.  What is going on inside the two subVI's you show?

0 Kudos
Message 2 of 27
(4,546 Views)

 am sorry to give the wrong info, the read_jet_data is a subvi (that reads the data throgh data socket server from the other computer).The other subvi is currently not running.I am just trying to add two new variables (rpm and force) to the existing main vi. Now I am able to see these values only in the read_jet_data  subvi and not able to see the updated value in main vi. The read_jet_data  subvi writes the values to the global variables.

0 Kudos
Message 3 of 27
(4,538 Views)

You do have a race condition.  You don't know whether that subVI is going to execute first, or the globals read and written to the indicators first.

0 Kudos
Message 4 of 27
(4,528 Views)

I  mean..m not understanding exactly wat u mean!! I am new to labview.... How do i come to know which is being executed first??

0 Kudos
Message 5 of 27
(4,525 Views)

 or how to make it execute one after the other??

0 Kudos
Message 6 of 27
(4,515 Views)

LabVIEW will execute whichever one who wants to first.

 

You can use error wires to force an order of execution.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 7 of 27
(4,509 Views)

Hey, I came to know that the global RPM is executing first and then the rest of the globals and next the read_jet_data runs but after that it doesn't continue to the global RPM for the next iteration....

0 Kudos
Message 8 of 27
(4,502 Views)

Do you have a loop inside your subVI?

 

You still haven't shown it or attach the file so we can see what it is doing.

0 Kudos
Message 9 of 27
(4,496 Views)

Read jet data Subvi.png

0 Kudos
Message 10 of 27
(4,480 Views)