Documentation

LEDs Library

Library Overview

The LEDs library contains controls that use graphical elements to imitate light-emitting diodes (LEDs). Each block displays its input value by setting one or more graphical elements to an on or off state. By default, the number of LEDs in the on state is the rounded value of the block's input. The library provides:

  • Display elements — number of LEDs, shape, color, size, layout, decay timing, binary display

  • Preconfigured controls

    • Single LED—Green Rect, Rect Bitmap, Red Rect, Red Rectangle Plain, Red Star, Round Red

    • Multiple-LED — Circle Meter, Horizontal Meter, Vertical Meter

  • Custom controls — Generic LED

Customizing LEDs

The table below lists some common ways to customize a block in the LEDs library, using its ActiveX® Control Properties dialog box.

TaskDescription
Add or remove LEDsChange the NumLEDs property on the LEDs/General panel.
Change the shape or color of a particular LEDOn the LEDs/General panel, set LEDIndex to the number corresponding to the LED you want to customize. To apply a previously defined style, set the LEDStyleID to the number corresponding to the style. To define a new style for this LED, increase the StyleID property on the Styles panel and then configure the color, picture, or shape properties accordingly.
Change the size or layout of a set of LEDsOn the LEDs/General panel, use LEDWidth and LEDHeight to control the size of each LED. Use LEDSeparation to control the spacing between successive LEDs. Use Orientation and/or Direction to control how multiple LEDs are arranged along a line.
Display a binary representation of the (rounded) inputSet the Mode property on the LEDs/General panel to Bitwise. The first LED corresponds to the least significant bit.
Display decaying maximum value of the input, in addition to the current inputCheck the MaxDecay check box on the LEDs/General panel. The DecayRate value controls how quickly the displayed value decays from the maximum to the current input value. Larger positive values correspond to a slower decay. A value of zero causes the block to reflect its maximum value with no decay.

Was this topic helpful?