LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

shared variable doesn't change on first read

Hi,

A slave program reads a shared variable at turn-on that is written to by a master program. I find that the shared variable isn't updated to the latest value until the second read of the variable. I thought that this should be instant (no buffer)

see attached if this description doesn't make sense!

Thanks

Al

 

LV 8.6.1 Vista

0 Kudos
Message 1 of 3
(2,685 Views)

I have seen this issue before. I have not had a look at your code yet, but the way to resolve this is to always do a shared variable read at the beginning of your loop (outside) before you actually start reading values from the variable. In previous versions, this was necessary to warm up the shared variable (so it initializes and establishes connection) before you actually start using it.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 3
(2,680 Views)

Please see attached code - it seems that Adnan is correct and that my shared variables need to be "tickled" to make them work! but the time delay is important. (greater than 0.3s makes it work for me)

This is obviously not the correct / intended operation what am I doing wrong?

This is causing me a problem in my current project.

Al

0 Kudos
Message 3 of 3
(2,660 Views)