LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

different reference type passed to SubVI

Hi all,

I use a subVi to access some properties of an XY graph (scale, offset ...) that's why I use a reference to the graph and give it to the subVI.

Now I would like to use the same subVI in order to modify the same properties but for an intensity graph.

Of course when I connect the intensity graph reference to the subVI, the wire gives an error related to incompatible reference type.

Could someone tell me how I could proceed to connect different reference types to the same subVI input?

I tried to use "to more generic class" component but I'm not able to find how to use it in this case.

Thanks in advance for your help
0 Kudos
Message 1 of 3
(2,698 Views)

Hi Fabrice,

You could place a Case Statement indexed by the type of graph whose properties you want to access / modify, etc.  The reason for mentioning that is the fact that you may not be able to use the same property node for both types of graphs, especuially if you access properties that are not common between the two. 

There may be tricks that you could try, but as far as using the component "to more generic class", it would have to be located in the calling vi and not the sub-vi.  That is so the same (sub-vi) Terminal can be used.

However, I am not sure that it would work...  I think I understand what you are trying to do...  I'm not sure if you'll be successful due to the reference types (might be worth a try)..  Nevertheless, if you simply wish to use the same sub-vi for two different graph types, then using the Case Statement will be the quickest solution to implement.

RayR

0 Kudos
Message 2 of 3
(2,691 Views)
OK, I though I could do this by type casting the references as I did for an other VI (to use the Get Image method but this is a generic method).

I will use a case statement but I will have to add 2 inputs to the subVI.
0 Kudos
Message 3 of 3
(2,689 Views)