LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Static accessors in series versus parallel configuration

Solved!
Go to solution

Hi Folks,

 

I recently started playing with object-orientated programming in LabVIEW and created a simple program which adds two numbers and displays the result (see attached). As I understand it, I have: (1) created a class with the appropriate controls/indicators stored within its private data cluster, (2) created an addition method which adds these numbers, and (3) created the appropriate static accessors to modify such private data. However, I noticed that when the write accessors are wired in parallel it doesn't carry out the addition, when compared to wiring in series. This is not the case with the read accessors and I was wondering why? Is there a way to achieve the desired functionality in a parallel configuration, and if not, why not?

 

Thank you for taking the time to look into this, I appreciate all the help.

 

Best,

 

Zifikis

0 Kudos
Message 1 of 4
(219 Views)
Solution
Accepted by topic author Zifikis

LabVIEW classes are "by data" not "by reference".  If you use a write accessor, the only way you get the value update is to use the output wire.

Message 2 of 4
(192 Views)

ZYOng_0-1715731647241.png

In your top loop, the data from Write Number 1 is not passed to Write Number 2. The Write Number 1 VI is essentially useless here.

 

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 3 of 4
(189 Views)

I see, this would explain what I am getting. Thank you for the clarification.

0 Kudos
Message 4 of 4
(159 Views)