LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why does the polymorphic vi doesnt work??

why does the polymorphic vi doesnt work??
if i connect the output with an string or double array there is always an error.
why?
markus
0 Kudos
Message 1 of 7
(2,905 Views)
Hello Markus,

that's easy: they don't have the same output...
Polymorphic VIs have to have the same output. The input can be of different format.

Btw: in your examples you are always subtracting an I32 from an U8. That can be dangerous...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(2,898 Views)
Hi

Just to correct GerdW - the vis of a polymorphic vi do not have to have the same output.

Have a look at the vis I attached. I just pass a dbl to a polymorphic vi and get a dbl in one vi and a string in the other.

The real problem is that the vi has to be set to the necessary type. If there are different inputs you just can wire them to the polymorphic vi, but this does not work with the outputs, so you have to set the type.

Hope this helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 3 of 7
(2,890 Views)
In addition to my previous post, here is an extract of the LV help:

Create two or more VIs with the same connector pane pattern. Make sure the connector panes have corresponding input and output terminals—if a terminal in the connector pane of one VI is an input, the corresponding terminal of the connector pane of the other VI(s) also must be an input or it must be unused. The same applies for output terminals. The VIs do not have to have similar data types or similar subVIs and functions.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 7
(2,888 Views)
Hello Thomas,

you're right. But in my opinion it makes no sense to have a polymorphic vi with different outputs. Then you always have to select the proper vi, which can also be done via "normal" subvi selection (just load the correct subvi, either from disk or from user.lib menu).
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(2,884 Views)
Hi GerdW

I don't think so. Although I don't use them very often, I'm happy to have this feature in LV. I think it makes it more concise.

Or would you prefer to search all the correct subvis (for example DAQmx read - just have a look at how many vis there are bundled into a polymorphic vi)?

I agree with you that the selection is annoying - maybe it won't be there anymore in a next LV generation ;).

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 7
(2,877 Views)
Here is a case where the output should have different data types. You want to convert a string to ASCII values. Sometimes you need an array of bytes, and sometimes you need a string of "bytes". This is just one example that I have actually created, but I can think of many other possibilities (one add - and - concatenate VI).

Good luck,
Bob
0 Kudos
Message 7 of 7
(2,871 Views)