LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems reading from bound shared variable

I have a shared variable that is bound to another shared variable.  When I go to read it's value in a VI by wiring the variable to the "value" property of a digital numeric object it displays zero.  When i look at the two shared variable in the variable manager they show the correct values.  Does anyone have a clue what's going on?
0 Kudos
Message 1 of 3
(2,645 Views)
Welcome to the forums!

Let's narrow down the possibilities here.  Try wiring the shared variable directly to a front panel indicator rather than using a property node.  Second, the shared variable object includes an error out terminal - this is where the variable engine can report any errors in obtaining a value from the bound item.  Wire the error out to an error handler VI and re-run - you may find that the Shared Variable Engine is reporting an error, which would be most helpful in determining the problem. 

If you could let me know the results of the above suggestions, I'll be glad to help further!
Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 2 of 3
(2,622 Views)
I was wiring the variable to the control so I could get an initial value in the display.  So I wanted the initial value displayed in an initialization routine before the main loop on the VI started.  For some reason at first the variable reports a 0.  It must not get the value right off the bat.  I ended up putting code in my main loop that looks to see if the timestamp on the variable has changed in the last second, and updates the variable based on that.  It has solved my problem.  Thank you for the help.
0 Kudos
Message 3 of 3
(2,613 Views)