Jump to content

Why Child class cannot read its own values?


Recommended Posts

Class A ->

Private Data: Q Ref and Cluster-A

Protected Member function: “Initialize” which is a dynamic dispatch, Creates a Queue and assign user defined values to Cluster-A

Private Member function: “Start Write” which calls “Write Information” every xx interval of times

Public Member function: “Write Information” which is a dynamic dispatch

Class B -> Inherits from Class A

Private Data: Cluster-B

Protected Member function: “Initialize” which is a dynamic dispatch, first calls the Parent Initialize and then assigns the User define value to Cluster-B

Public Member function: “Write Information” which is a dynamic dispatch

Class C -> Inherits from Class B

Private Data: A Numeric Control (default = -1) and a Boolean Control (default = False)

Protected Member function: “Initialize” which is a dynamic dispatch, pass the user defined values of Cluster-A and Cluster-B to Parent Class

Public Member function:

1. Write Information – Write the information from Queue to the file depending on the Numeric control, Boolean Control and Cluster-B data of Class B

2. Create - creates an object of class C + Calls Initialize to pass data to respective class

3. Set # – Assign the user defined value to Numeric Control

4. Read # – Read the value of Numeric Control

5. Set Bool – Assign the user define value to Boolean Control

6. Read Bool – Return the value of Boolean Control

Class D -> Inherits from Class B

Private Data: Empty

Protected Member function: “Initialize” which is a dynamic dispatch, pass the user defined values of Cluster-A and Cluster-B to Parent Class

Public Member function:

1. Write Information – Write the information from Queue to the file depending on the Cluster-B data of Class B

2. Create - creates an object of class D + Calls Initialize to pass data to respective class

My application,

Create Object C + Set # (to say 10) and

Create Object D

Object D - Write Information works fine

Object C - Write Information has Read # and Read Bool which always returns the default value.

Not able to understand why?

Any help is appreciated.

Thanks.

Edited by Vidula S
Link to comment

I tried to puzzle it out from your text description, but I couldn't get a good grasp on the situation. If you can post VIs, that would help a lot.

All I needed was reference class. I found the solution in examples.

Thanks!

Link to comment

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.