LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get the reference of an existing object using Goop?

hi,
    I cretae an object using Goop. I have a private control into which i store some values which is unique for every object i cretae.
 
I create an object named "slot1" and set some values like "address" and "supporting uut". I create 5 objects similarly and set the above said values which are different for every object.
 
Now after setting i want to get back the stored values by calling the object either by name or reference.
 
The problem i face with the Goop tool  is  that if i try getting the set values immediately using the reference after i set, im able to get the values but if i try setting for 5 objects and try getting one by one using the name/ or reference, a new object is created. How to solve this...
 
 
Regards
Jayaraman
0 Kudos
Message 1 of 3
(2,237 Views)
Can you post your code?  I would have to see how you are doing it to find out why a new object is created.
0 Kudos
Message 2 of 3
(2,234 Views)

Hi,

 

If new objects are created it is because you call a VI called XX_Create.vi (where XX is the class name) which in turn calls XX_New.vi to create a new object. Or perhaps you call XX_New.vi directly in some method (VI).

 

To read data from an object you can add a new method like XX_GetAddress.vi. In the block diagram of this method you use the utility VI called XX_GetAttributes.vi. It returns all data of the object in the cluster and you just unbundle it and wire the address field into an indicator.

 

To write data you follow the same scenario, for example XX_SetAddress.vi, and use the utility VIs XX_GetAttributes toModify.vi and XX_SetModifiedAttributes.vi to change the object data. The object reference must be wired into all these VIs.

 

The names of the utility VIs I have described above are valid for GOOP architectures where Endevo has been involved. So it is valid for GOOP 1, 2 and 3. If you are using OpenG or some other the names may differ but the general scenario is the same.

 

Also, if you are using named objects you need to use the XX_New.vi to get the object reference from the name. The XX_New.vi as a "method" input, which is an enum. One selection of this enum is "look up existing". Use this selection to get the object reference from the object name.

 

Jan

Endevo

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