G#

cancel
Showing results for 
Search instead for 
Did you mean: 

Using FGV in OOP

Solved!
Go to solution

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?

0 Kudos
Message 1 of 4
(2,822 Views)
Solution
Accepted by topic author kokthiam.chiam

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.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(2,794 Views)

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... 🤔

0 Kudos
Message 3 of 4
(2,757 Views)

@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.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 4
(2,742 Views)