LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Variables Concern

Hello,

 

I have developed a large program with many instruments and drivers.  Being a little new to LabVIEW, I used local variables for everything.  This is messy, so I cleaned it and I am currently using a Shared Variable (Array of Doubles). 

 

To update this shared variable, I am using the Replace Array Subset.vi to replace an index of the shared variable.  I am reading shared variable > replace array subset.vi > writing shared variable. 

 

For some reason the shared variable is still giving me straight zeros.  It can't be an initialization problem because the rest of my shared variables (clusters) are working just fine.

 

Any idea?

 

Danny

Thank you

0 Kudos
Message 1 of 3
(1,964 Views)

We need to see some code, it is probably crawling with race conditions.

 

What is "everything"? What are "straight" zeroes? Are there any other zeroes?

Also remember that you cannot replace a nonexisting element. Are the arrays fixed size?

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

Hello,

 

Yes you are right, I needed to initialize the array to a fixed size.  Thank you.  Sorry for the lack of information.

0 Kudos
Message 3 of 3
(1,941 Views)