05-06-2022 10:26 AM
So I've inherited a project that uses objects. And I want to improve upon the design by introducing asynchronous loops. But before I go about messing with this too much to implement, I was curious if objects work anything like Data Value References and FGVs. If I update the object in any of the asynchronously running VIs, is it updated everywhere or only in that instance?
05-06-2022 11:36 AM
The object itself is just an object, like a DBL or I32. However, an object can be implemented so that all of the data contained in the object is by reference (with a DVR, for example). So the answer to your question is maybe, but it depends on how the original developer set them up.
05-06-2022 11:42 AM
LVOOP is By-Value. You can use a DVR (of the class) to make it By-Reference, but this is generally not recommended. I think there is an article floating around about this. I'd have to do some digging to see if I can find it.
05-06-2022 11:51 AM
@johntrich1971 wrote:
The object itself is just an object, like a DBL or I32. However, an object can be implemented so that all of the data contained in the object is by reference (with a DVR, for example). So the answer to your question is maybe, but it depends on how the original developer set them up.
So the photo I'm showing is a simple "right-click create class" object. So what do I do to this class so that it updates in all instances?
DailyDose_0-1651855823028.png
05-06-2022 12:49 PM
No, objects are, by default, by-value. You can make them by-ref by using DVR's, single-element queues, etc. There's also the GOOP toolkit that automates some of that but I've never used it myself.
05-06-2022 02:54 PM
@DailyDose wrote:So the photo I'm showing is a simple "right-click create class" object. So what do I do to this class so that it updates in all instances?
DailyDose_0-1651855823028.png
You pass around the DVR reference and use the In Place Element Structure to access the object. The IPES will act as a mutex to keep multiple places from trying to access it at the same time.
05-09-2022 07:38 AM
@DailyDose wrote:
@johntrich1971 wrote:
The object itself is just an object, like a DBL or I32. However, an object can be implemented so that all of the data contained in the object is by reference (with a DVR, for example). So the answer to your question is maybe, but it depends on how the original developer set them up.
So the photo I'm showing is a simple "right-click create class" object. So what do I do to this class so that it updates in all instances?
DailyDose_0-1651855823028.png
wiebeCARYA_0-1652099818320.png
Turn this off, then you can put the class in a DVR.
I personally avoid DVRs (anything not by wire actually) at almost all costs.
They are hell to debug.