08-02-2020 08:38 PM
Hi,
I'm new to OOP in Labview. Usually, I use FGV in non OOP style. I tried to use FGV (keep values in shift register in while loop) defined in a class, but it seems that the shift register is shared among different instances. Is it possible to make the shift register to be unique to each instance? Or FGV concept needs to be implemented to object attribute, since G# instance is by reference?
Solved! Go to Solution.
08-03-2020 02:44 AM
A FGV works the same in OOP as in normal LV, with all the same pro's and con's. It's a singleton object that's the same regardless.
To have different instances you need the data to reside in the object, or possibly class.
08-10-2020 07:42 PM
Hi Yamaeda,
Thanks for your confirmation. I tried to modify an elapsed timer FGV into class and store them in the object attribute. So, it's basically replacing the shift registers with the object attributes. I'm using G# though, which uses DVR to make this possible. I find it hard to use native Labview class, as the data is by copy. I wonder how this is being handled by others... 🤔
08-11-2020 02:50 AM
@kokthiam.chiam wrote:
Hi Yamaeda,
Thanks for your confirmation. I tried to modify an elapsed timer FGV into class and store them in the object attribute. So, it's basically replacing the shift registers with the object attributes. I'm using G# though, which uses DVR to make this possible. I find it hard to use native Labview class, as the data is by copy. I wonder how this is being handled by others... 🤔
There's ways around it. Quite often in LV it ends with some Queue or event to make sure it's only handled in one place. 🙂
You can ofc use DVRs in ordinary LV(OOP) also.