Application Indicator Functions

Application Indicator functions let you update the active state of customizable indicators that are part of the Buttons & Indicators module. These AeroScript functions run on the Automation1-iSMC (the Automation1 Intelligent Software-Based Machine Controller). But they are handled through a connected Automation1-MDK (the Automation1 Machine & Motion Development Kit) application, specifically the Automation1 MachineApps application. Thus, you must connect an Automation1 MachineApps application that registers for this callback to the controller before you use these functions. If a MachineApp uses the Buttons & Indicators module, it automatically registers for the necessary callbacks.

AppIndicatorOn()

Use the AppIndicatorOn() function to turn on all indicators with the specified ID. You can specify the display text, animation, animation cycle duration, foreground color, and background color for the indicator.

function AppIndicatorOn($indicatorId as integer, $displayText as string, $animationType as IndicatorAnimationType, $backgroundColor1 as string, $foregroundColor1 as string, $backgroundColor2 as string, $foregroundColor2 as string, $duration as integer)

Turns the specified indicator on.

Arguments

$indicatorId  The ID of the indicator to turn on.

$displayText  The text to display on the indicator.

$animationType  The animation to display on the indicator.

$backgroundColor1  The first background color to show on the indicator.

$foregroundColor1  The first foreground color to show on the indicator.

$backgroundColor2  The second background color to show on the indicator. This color is only used for certain values of $animationType.

$foregroundColor2  The second foreground color to show on the indicator. This color is only used for certain values of $animationType.

$duration  The duration in milliseconds for each color displayed.

For the animation type, refer to the descriptions that follow:

  • Solid displays the indicator background as the $backgroundColor1 color and the $displayText as the $foregroundColor1 color.
  • Flash cycles between two display states - the indicator background as the $backgroundColor1 color for the $duration in milliseconds and the indicator background as transparent for the $duration in milliseconds. The $displayText is displayed as the $foregroundColor1 color for both cycles.
  • Two Color Flash cycles between two display states - the indicator background as the $backgroundColor1 color with the $displayText as the $foregroundColor1 for the $duration in milliseconds and the indicator background as the $backgroundColor2 color with the $displayText is as the $foregroundColor2 for the $duration in milliseconds.
  • Color Sweep cycles between two display states - the indicator background as the $backgroundColor1 color with the $displayText as the $foregroundColor1 for the $duration in milliseconds and the indicator background as the $backgroundColor2 color with the $displayText is as the $foregroundColor2 for the $duration in milliseconds. This animation gradually transitions between the two colors.

All colors can be specified in one of the formats that follow:

  • A hexadecimal string formatted as #RRGGBB. The first two characters are the red channel value, the next two characters are the green channel value, and the final two characters are the blue channel value.
  • A hexadecimal string formatted as #RRGGBBAA. The first two characters are the red channel value, the next two characters are the green channel value, the next two characters are the blue channel value, and the final characters are the alpha channel value.
  • As a predefined string with one of the values listed in the chart that follows. For more information, see Microsoft's Colors Class reference.

AppIndicatorOff()

Use the AppIndicatorOff() function to turn off all indicators with the specified ID.

function AppIndicatorOff($indicatorId as integer)

Turns the specified indicator off.

Arguments

$indicatorId  The ID of the indicator to turn off.

Program Example

Copy

C/C++

// Turn on an indicator with a solid background.
AppIndicatorOn(0, "ON", IndicatorAnimationType.Solid, "limegreen", "#ffffff", "", "", 0)

// Use a variable to store a color value.
var $orange as string = "orange"
// Turn on an indicator with an animation that uses predefined color options.
AppIndicatorOn(1, "WARNING", IndicatorAnimationType.ColorSweep, "gold", $orange, "yellow", $orange, 750)

// Turn on an indicator with an animation using hexadecimal values.
AppIndicatorOn(2, "LOADING", IndicatorAnimationType.Flash, "#98b9d6", "#5d6163ff", "", "", 500)

// Turn off an indicator.
AppIndicatorOff(3)