The Preserve Run-Time Class function checks at run time whether object in is of the same class as, or is a child class of, target object.
Use this function on the block diagram of a SubVI when you want to guarantee that LabVIEW downcasts a LabVIEW class output of the subVI node to the same class type as a LabVIEW class input when the subVI receives a child class of the expected input type.
Use this function in VIs that meet the following criteria:
- The VI accepts a LabVIEW class as an input and returns the same LabVIEW class as an output.
- You want to call the VI as a subVI.
- You want to guarantee that the output class type of the resulting subVI node always changes to match the input class type when a child class is wired as an input.
For many subVI nodes that accept and return the same LabVIEW class, LabVIEW automatically downcasts the output class when you wire a child class to the class input. Those subVIs do not require you to use this function on their block diagram.
However, if it is impossible for LabVIEW to verify that the class type does not change across the block diagram of the subVI, LabVIEW does not automatically downcast the output class of the subVI node. In these cases, if you have additional knowledge that guarantees that the class type does not change across the block diagram of the subVI, you can use this function to downcast the class immediately before returning it from the subVI. Because this function always returns an object of the same type as target object, LabVIEW recognizes that it can downcast the returned class to that type. Therefore, this function notifies LabVIEW that it is safe to downcast the class output of the subVI node to match the input class type.
||More info to come.