LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a class independently in multiple while loops

I have a class that I'm using in self-contained while loops within a VI. The class within each while loop is "instantiated" using a unique parameter (comm object address). So, in three while loops, I'm using the same class instantiated three times using comm object address 1,2,3. 

 

Will this work? Will the three class instances in the three while loops behave as independent objects with their own data?

 

I've attached an edited snapshot of two loops (I couldn't fit all three loops on the screen).

 

Thanks! 

0 Kudos
Message 1 of 2
(186 Views)

@abvenk wrote:

I have a class that I'm using in self-contained while loops within a VI. The class within each while loop is "instantiated" using a unique parameter (comm object address). So, in three while loops, I'm using the same class instantiated three times using comm object address 1,2,3. 

 

Will this work?

Yes, unless your methods have side effects, or if you've done something funky with your properties.

 

Will the three class instances in the three while loops behave as independent objects with their own data?


Yes.  They won't merely "behave as independent objects with their own data", they actually are independent objects with their own data.

0 Kudos
Message 2 of 2
(172 Views)