LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What's a polymorphic terminal and why can't I change the colour of an LED?

Hi,

I've written a small vi to experiment with changing the
colour of an LED from the front panel by the user. (See attached.)

I've created a property node for the LED indicator and selected the 'Colors[4]' property.

I've then selected the 0th element of the array using 'Index Array' and used this as the cluster type on 'Bundle By Name' but no names appear in the elements.

When I then try to wire a colour box to the input of Bundle By Name I get a broken wire and the message: "This wire connects to a polymorphic terminal that cannot accept this data type".

And yet when I hold the mouse over the wire from the output of index array so it's just looking at one element of the colors[4] array in the help window I'm told it's a cluster made up of two U32's. Individually these are the same data type as the output from the colour box.

What's a polymorphic data type and what's the correct way to wire from the colour selection box to the Colors[4] property of the LED so the colour can be changed?

Any help much appreciated.
Thanks,
Dave.
0 Kudos
Message 1 of 6
(3,015 Views)
You can't use the bundle by name node since the cluster elements you wired in have NO NAME 😉
Just use a simple bundle node.
CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 2 of 6
(3,007 Views)
Dave,

A couple of comments.

  • As CC said, you need to use the plain bundle node.
  • If you want to change the "ON" color, you need element 1, not zero.
  • Property operations should only be done exacly once whenever something changes, not 10000 times/second. Use an event structure.

    See attached (LabVIEW 7.0). Modify as needed.
  • 0 Kudos
    Message 3 of 6
    (2,991 Views)


    @altenbach wrote:
    Dave,

    A couple of comments.

  • As CC said, you need to use the plain bundle node.
  • If you want to change the "ON" color, you need element 1, not zero.
  • Property operations should only be done exacly once whenever something changes, not 10000 times/second. Use an event structure.

    See attached (LabVIEW 7.0). Modify as needed.


  • Hi,

    Thanks to both of you for your replies.

    I could'nt find any info on what element of the color[4] array set the ON color, I was just guessing and going to try each one starting with the 0th.

    Where did you (Altenbach) find out what element of the color[4] array controlled each colour property of the LED? Where is it documented?

    Thanks,
    Dave.
    0 Kudos
    Message 4 of 6
    (2,978 Views)
    Ways to show the info on specific properties:

    Enable context help (Ctrl-H). Now place the mouse cursor over the "Colors[]" propertly. and the help will show "...Array of up to 4 (FG color, BG color) pairs. Color pairs include False, True, True to False, and False to True. .... This is also the order of the elements in the array.

    There is even more information if you click on the Click Here For more Info link in the context help.
    Message 5 of 6
    (2,969 Views)


    @altenbach wrote:
    Ways to show the info on specific properties:

    Enable context help (Ctrl-H). Now place the mouse cursor over the "Colors[]" propertly. and the help will show "...Array of up to 4 (FG color, BG color) pairs. Color pairs include False, True, True to False, and False to True. .... This is also the order of the elements in the array.

    There is even more information if you click on the Click Here For more Info link in the context help.





    Thanks,
    Dave.
    0 Kudos
    Message 6 of 6
    (2,940 Views)