LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Local Data Storage in Objects

Hello,

 

I have been trying to program more in Objects.  i.e. Data and Functions are bundled together in a Class or in a project library.  I have used FGV a lot in the past.  One of the things I like about a FGV is the ability to locally store data in an uninitialized shift regester.  Only the cases in the FGV can access the locally stored data.

 

Is there an equivilant storage method using Project Libraries or Classes?  Is it even a good idea to have locally stored data?

 

Thanks

Dan Shangraw, P.E.


   

0 Kudos
Message 1 of 5
(3,128 Views)

With classes, you create methods to access the desired data.  You just need to pass around the object and call the right method to do what you want.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,114 Views)

Is there a way to store that object data within the object?  Do I have to pass it around in my calling application?

 

Does that make any sense?

 

Thanks

Dan Shangraw, P.E.


   

0 Kudos
Message 3 of 5
(3,112 Views)

Hi Dan,

 

object data is stored within the object! Only methods of that class can access that data - similar as your FGV: only cases within the FGV can access the data in the shift register(s)!

 

You have to pass the object to access the data within…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(3,101 Views)

@ASTDan wrote:

Is there a way to store that object data within the object?


That's what that Private Class Data control is for. Smiley Wink



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(3,098 Views)