Application Button Functions

Application button functions let you update the active state of customizable buttons that are part of the Buttons & Indicators module. To use these AeroScript functions, an Automation1 MachineApps application must be connected to the controller.

Set a Button State

Use the AppButtonSetState() function to set all buttons with the specified ID or name to the specified state.

function AppButtonSetState($buttonId as integer, $stateId as integer)

Sets the specified button to the specified state.

Arguments

$buttonId  The ID of the button on which to set the state.

$stateId  The ID of the state to set on that button.

function AppButtonSetState($buttonName as string, $stateName as string)

Sets the specified button to the specified state.

Arguments

$buttonName  The name of the button on which to set the state.

$stateName  The name of the state to set on that button.

Program Example

// Set a button to its default state
AppButtonSetState("Button1", "Default State")
// Use a variable to iterate over state IDs
var $stateIterator as integer = 0
// Set a button to each of its three states in order
for $stateIterator = 0 to $stateIterator < 3
	AppButtonSetState(1, $stateIterator)
	$stateIterator++ 
end