LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Are pre-obtained/initialized Queues not inherited by child classes?

Solved!
Go to solution

My parent methods do all the Queue initialization work.  And stores the references in the class/object.  I use my Accessors to do this.  Those queues are handling data acquisition.  I have a Method that taps those Queues and the data they contain to determine which child class to be more specifically into.  I have confirmed that the Child VI is running (I made it open its FrontPanel once called).  However, the queue references from the parent appear to be nothing.  Any queue call spits out the error 1.  The parent is still running other methods asynchronously using those same queue references without any error.  But the child gets errors for the queues.

 

So... do Child Classes not inherit Queues?  I used my Accessors from the Parent to get the references originally, then I tried using Proper Nodes to get the refs.  Still... error 1.  What am I possibly doing wrong here?  Again - the methodology I'm using to determine the correct Child to specify is working - and can't work unless the Queue references are working.  (And yes, I'm using the error to kill the While Loop because the parent destroys the Queue refs when closing - I am working on an FGV to do this instead - but that's not the issue here - those Queues are nothing)

 

DailyDose_0-1689180410265.png 

DailyDose_1-1689180633684.png

 

 

0 Kudos
Message 1 of 4
(918 Views)
Solution
Accepted by topic author DailyDose

Do you think that this:

 

Kyle97330_0-1689181374878.png

... preserves the parent class data but converts it to a child class?

 

Because it does not.  All that does is take the class coming in on the left and change its wire type to match the class coming in the top.  If the class on the left had no data, the class on the right will not.

 

If you want to do this you need to make a "Copy" method for your parent class, taking in 2 inputs (a "Copy from" object, and a "Copy to" object"), have it copy everything from one to the other, and output the "Copy to" object.  You would then put that method in this VI, with the input object as the "Copy from" object and the object you obtain with the "Get LV class default value" to the "Copy to" object.

Message 2 of 4
(910 Views)

@Kyle97330 wrote:

Do you think that this:

 

Kyle97330_0-1689181374878.png

... preserves the parent class data but converts it to a child class?

 

Because it does not.


Yep, that's exactly what I thought.  And sounds like I was wrong.

 

I will do what you suggested, thank you!

0 Kudos
Message 3 of 4
(896 Views)

Yep, sure enough.

Thank you for that lesson!

0 Kudos
Message 4 of 4
(880 Views)