LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 or More objects of a class

Hi:

I have a Battery Simulator class, that has class information (ctl) about a Battery Module (Module Voltage, Current, SOC, Temp, number of Cells etc); What is the best way to create(to simulate) 2 or more Battery Modules; They both contain different data... I need perform Compare operations between them...

Regards,

Leela.

 

 

0 Kudos
Message 1 of 3
(2,160 Views)

Why not have 2 class objects of the Battery type..? They won't overwrite each other's data.

0 Kudos
Message 2 of 3
(2,153 Views)

There's a major distintion in OOP that you are missing here.  A class is nothing but a blueprint for an object.  It contains no data.  An object is what contains the data.  You can have as many objects of a class as necessary.  And since it is the object that holds the data, you will have no issues with overwritting your data.


GCentral
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 3 of 3
(2,127 Views)