LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically obtain a specific class wire type

Hi,
I'm writing a test program that will use different sets of instruments. Using the new OO features of LV, I'm trying to write a program that loads a specific set of instruments from a config file. All the different instruments inherit from one parent device class. When loading the set, I want each object to use its specific initialize methods so I can't simply wire the parent class constant to the initialize methods. I thought the config file could have the class file path and name (from the library property node)  and this could be used to start "a new wire" of the specific class type. Could this be done?
 
Thanks,
0 Kudos
Message 1 of 7
(4,096 Views)
If you're using LV 8.5, them there's an easy built-in function to do this called Get LV Class Default Value in the Class, Cluster and Variant palette. Use as shown below.




Message Edited by Jarrod S. on 12-25-2007 06:45 PM
Jarrod S.
National Instruments
0 Kudos
Message 2 of 7
(4,072 Views)
Anything in LV 8.2?
0 Kudos
Message 3 of 7
(4,065 Views)

Yes, there is a way to do this in 8.2. It requires a little more work (but not much). Refer to the section of this document called The Design of a LabVIEW Class for more info. This document is also an interesting reader for many other facts about LVOOP. I'll also link to the pic itself:

 
Jarrod S.
National Instruments
0 Kudos
Message 4 of 7
(4,051 Views)

I have tried your suggestion- there is a wire conflict- the specific class wire is not compatible with the parent class indicator (see attached)



Message Edited by ysegev on 12-30-2007 06:29 AM
0 Kudos
Message 5 of 7
(4,013 Views)
I have tried this out but there  is a wire conflict- the specific class wire conflicts with the parent indicator
0 Kudos
Message 6 of 7
(4,011 Views)
Sorry, I got  the wires wrong- it works ok. Doesn't it make more sense if the target is the more specific class?
 
Thanks a lot.
0 Kudos
Message 7 of 7
(4,005 Views)