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.

GDS(Goop Development Suite)

cancel
Showing results for 
Search instead for 
Did you mean: 

To more specific class when using GOOPUTIL Generic Create

I am trying to create GOOP child classes that can act as plug-ins during runtime.  I have attached a project that was created with the UML code gen so I know it is 100% GOOP code.

In the below, the parent and child 1 instances work fine, but in the child 2 instance, I am using GOOPUTIL's Generic Create and Generic Destroy which call the create and destroy VIs by name.  these work fine, Generic Create casts the class reference as an LV Object, so to use the reference, I need to re-cast it to the child 2 class type.  All fine so far.

Now the problem is that when I call the parent's Set Do and Get Do methods, the parent_GetAttributes casts the ref attribute as a DataRef type then checks it with Not A Number/Path/Refnum, which returns "TRUE" and throws an error 1556.

When I probe the refnum, it looks like a perfectly valid refnum (something like 3914334209).  Yet that Not A Number/Path/Refnum output a "TRUE".

Advice please?

Capture.PNG

0 Kudos
Message 1 of 4
(6,637 Views)

give a look at this file,

 

I do not know why your way does not work, but it works the way it is in this Factory Pattern example.

 

 

0 Kudos
Message 2 of 4
(6,466 Views)

Because the Child2 constructor called by GOOPUtility\GOOPUtil_GenericCreate.vi go ilde and LabVIEW Garbage Collector unload the Child2 reference,so the ref is invalid and go wrong.

more about this topic:

http://forums.ni.com/ni/board/crawl_message?board.id=170&message.id=943198

 

I don't know the reason that it has kept the constructor VI reference (output of the GOOPUtil_GenericCreate.vi) not closed unitl the class destroy in your code,but it does not work.The Child2 constructor VI go idle.

(my version is LabVIEW2016 Win7 64bit)

 

You can use add persistance pattern in the class.and it will not be unload in this example.

0 Kudos
Message 3 of 4
(6,333 Views)

I want to know the example about how to kept the constructor.vi in memory with GOOPUtility\GOOPUtil_GenericCreate.vi

0 Kudos
Message 4 of 4
(6,333 Views)