From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
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?
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?
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?
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.