LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cast generic VI to strictly typed VI

Is there a way of casting a generic VI to a strictly typed VI through something other than from the Open VI icon?  I'm trying to make a generic VI to handle the open and cast it where I need it.

Thanks,


Adrian

PS.  I should mention that I am using LV 7.0 and have tried to use the "To More Specific Class" icon without success.

Message Edited by Been bitten by LabVIEW on 10-10-2007 03:18 PM

0 Kudos
Message 1 of 9
(4,111 Views)
Yes, but it won't do you much good. You can't use a type cast (that's not
allowed), but you can use flatten to string and unflatten to string. That
way, you basically have what you've asked for.

All normal properties will work (only tried Panel Open). But the only reason
to do this, is so you can call the Call By Reference Node. And that will
fail. The node says something about the vi not being reserved. If you put
this code inside a sub vi, LabVIEW (8.2.1) will crash (R6025 - pure virtual
function call). This is not something that you'd want to use.

There are probably other ways to solve your problem, but you have to explain
what your higher goal is.

Regards,

Wiebe.


Message 2 of 9
(4,087 Views)
Tried that, didin't work.  But as soon as I expanded the code inline it worked. 😞  LV is a pain in the ass.


Adrian
0 Kudos
Message 3 of 9
(4,076 Views)
What do you mean by "expanded the code inline"?

Regards,

Wiebe.


0 Kudos
Message 4 of 9
(4,068 Views)
Cut and pasted with the only change being the VI type being passed to VI Open.  Though, this may be a connect pane problem.  I've had some issues even when using the VI type being the same, but VI open saying that the "VI Reference type does not match VI connector pane" which is bunk. 😞


Adrian

Message Edited by Been bitten by LabVIEW on 10-11-2007 09:16 AM

0 Kudos
Message 5 of 9
(4,067 Views)

BTW, what equates one connector pane to another?  I.e. If I have a connector pane that has three connectors of various types, what will break the connector pane compatibility given that the types are the same and the names of the controls and indicators are the same as well?

Thanks,

Adrian

Message Edited by Been bitten by LabVIEW on 10-11-2007 09:29 AM

0 Kudos
Message 6 of 9
(4,062 Views)
This is very strict. I think everything has to match. The number of
terminals must match. The types must match exactly. The position too. The
only thing that can differ is the name of the terminals.

I'm not sure if a scalar U32 will match a I32 or dbl. From memory I think
not. I think internally the "type string" is compared, so even a type def'd
U32 won't match a normal U32.

Regards,

Wiebe.


0 Kudos
Message 7 of 9
(4,041 Views)
The call type (required, recommended, optional) must also match. This is very easy to miss, but is critical to the way LabVIEW compiles an application, so will break a connector pane type.
0 Kudos
Message 8 of 9
(4,034 Views)
Thanks for all the replies.  I'll try out some of your suggestions sometime next week as this project just got demoted in priority.

Thanks again.


Adrian  
0 Kudos
Message 9 of 9
(4,026 Views)