LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems in LabVIEW 8.20 GOOP Class

Please find the Attached project
basically if i create a object and if i want to use the same object in different loops (or dynamic VIs running at same time) then labview automatically creates new object
also i couldnt find out how i can write constructor and destructors in labview class
 
in the attached example i am creating one object then passing its reference in two parallel loops.
as reference is same i expect if i change the value of property in one loop then it should get updated in other loop as well
 
can anybody help me out

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 1 of 3
(2,673 Views)
This is a limitation in the way NI implemented OO in LabVIEW. Branching the class creates a copy. Yeah, I know. You can read more at LAVA. For the simple example that you have you can use a static class variable that's basically a global variable inside the class. There's an example that ships with LabVIEW that shows how to do this. Since this is a class problem (no pun intended) I'll let the student implement the solution. Always the best way to learn. Smiley Wink

Message Edited by smercurio_fc on 12-11-2006 09:32 AM

Message Edited by smercurio_fc on 12-11-2006 09:33 AM

0 Kudos
Message 2 of 3
(2,646 Views)
You can also keep your data in a single element queue and keep the queue reference in your class ctl.  You can access the queue reference in the class and read the queue element when needed.  This is talked about extensively in the LAVA forums.


Randall Pursley
0 Kudos
Message 3 of 3
(2,618 Views)