From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-01-2010 03:52 AM
Hello,
I have defined a class with a single variable, and two methods for set and get the value of the variable, the variable is declared as private in the class, and both the methods are declared as public. can some one please help me to find the mistake, of set method or get method, they are not working as expected, i.e. display the value of the varible, after i excute the set method.
Thanking you in advance
Venkatesh
Solved! Go to Solution.
07-01-2010 04:15 AM
Hope the illustration is sufficient:
Norbert
07-01-2010 04:15 AM
If you branch the wire for a class (like you do before your first case structure) then you are creating a copy of the object, not a copy of a reference to the object.
This means that any changes you are making to your copied object in the write case are never going to be communicated to the read case because thes are operating on two completely different objects.
I have re-written the test VI for you to fix the problem.
Shane.
07-01-2010 04:25 AM
Thank you for the replay, can you please send the corrected vi for Labview ver 8.5
07-01-2010 04:28 AM - edited 07-01-2010 04:30 AM
Actually, I don't think so because IIRC the "save for previous" from LV 2009 is broken and I don't have any intermediate version to help me out in this regard. Maybe someone else can help you out.
My changes were trivial. You just wire through the original object wire instead of branching the wire as already displayed above and wire the object to a shift register instead of a tunnel when entering the loop.
Shane.
07-01-2010 04:54 AM
Thank you, the shift register is working. Does the branching instantiate copy of the same class as 2nd object? if so how can i create refence of the 2nd object.