I have an application that contains the following objects:
Database.lvclass
Signal.lvclass
Diagnostic Signal.lvclass
Input Signal.lvclass
Output Signal.lvclass
A "Signal" object array is initially created, but it is possible for an attribute to be added at run-time to these signals which makes the object a more "specific" class (diagnostic/input/output). The class type is specified by an attribute that is set AFTER a signal object is created. The creation of the Signal Object contains a lot of accessors (around 20). Initially I was thinking I could "cast" the Signal Object to a more specific class that would copy the Signal Object data to the appropriate descendant Diganostic/Input/Output Object. However, this will return error:
Error 1448 occurred at To More Specific Class in CAN Signal.lvclass:Cast Signal To Type.vi
Possible reason(s):
LabVIEW: Bad type cast. LabVIEW cannot treat the run-time value of this LabVIEW class as an instance of the given LabVIEW class.
According to the information from here, this is not possible and the current procedure for creating a descendant from an ancestor is to use accessors for every possible data item up the chain.
However, a LAVA thread posted here seems to state otherwise, except it is an "old" lava post and the example cannot be downloaded!
1. What best procedure for creating a descendant from an ancestor? If more data items are added to the ancestor, is there a technique that will warn/errror if the descendant creator does not include?
I have attached my initial attempt that has caused the Error 1448. Any help would be appreciated!