From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-14-2024 04:45 PM
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
Solved! Go to Solution.
05-14-2024 07:00 PM
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.
05-14-2024 07:08 PM
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.
05-15-2024 03:35 AM
I see, this would explain what I am getting. Thank you for the clarification.