Skip to main content
Version: 7.9

One-Shot Button

Component Palette Icon

The One-Shot button is great for telling a PLC to do something. It simply writes a value, and then waits for it to be reset by the PLC before it is available again. Note that this is only applicable when the PLC is programmed to reset the value after reading it. If your PLC expects the HMI to reset the bit, use the Momentary Button. Also note that this component is considered safer than the momentary button, because it receives positive feedback from the PLC that the signal was received, avoiding the timing dangers associated with a Momentary Button.

To use the One-Shot button, bind an OPC tag bidirectionally to the button's Value property. When clicked, the button will write the value in its Set Value property to the Value property. Typically, Set Value is 1, and Value is 0 in a ready state, although the logic could be reversed or change simply by altering Set Value. The button can disable itself when it is writing, and will display different text. Note that the button considers itself to be writing whenever Value equals Set Value - you must make sure that the PLC resets this value, otherwise the button will remain in a writing state.

Properties

NameDescriptionProperty TypeScriptingCategory
AntialiasDraw with antialias on? Makes text smoother.boolean.antialiasAppearance
Background 3D?Should this button have a 3d type background, or a flat color one?boolean.background3DAppearance
Background ColorThe background color of the button.Color.buttonBGAppearance
BorderThe border surrounding this component. NOTE that the border is unaffected by rotation.Border.borderCommon
Border Painted?Should the border of this button be displayed?boolean.borderPaintedAppearance
Confirm TextThe message to ask the user if confirmation is turned on.String.confirmTextBehavior
Confirm?If true, a confirmation box will be shown.boolean.confirmBehavior
CursorThe mouse cursor to use when hovering over this component.int.cursorCodeCommon
Data QualityThe data quality code for any tag bindings on this component.int.dataQualityData
Disable While WritingIf true, the button will be disabled while it is writing.boolean.disableWhileWritingBehavior
Disabled Image PathThe relative path of the image to be displayed when this component is not enabled.String.disabledPathAppearance
EnabledIf disabled, a component cannot be used.boolean.componentEnabledCommon
Fill Area?Controls whether or not this button's internal area is filledboolean.contentAreaFilledAppearance
FocusableIf a button is not focusable, you will not be able to interact with it with the keyboard. This means you can't "tab" over to it.boolean.focusableBehavior
FontFont of text on this componentFont.fontAppearance
Foreground ColorThe foreground color of the component.Color.foregroundAppearance
Horizontal AlignmentThe horizontal alignment of the button's contents (text and/or image)int.horizontalAlignmentLayout
Horizontal Text PositionThe horizontal position of the button's text relative to its imageint.horizontalTextPositionLayout
Icon-Text SpacingThe space (in pixels) between the icon (if any) and the text (if any)int.iconTextGapAppearance
Idle TextThe text of the button while its value is not being writtenString.normalTextBehavior
Image PathThe relative path of the image.String.pathAppearance
MarginThe space between a button's text and its borders.Insets.marginLayout
MnemonicA single letter that will activate the button using 'ALT-mnemonic'.String.mnemonicCharBehavior
Mouseover TextThe text that is displayed in the tooltip which pops up on mouseover of this component.String.toolTipTextCommon
NameThe name of this component.String.nameCommon
OpaqueIs this button completely opaque? Most aren't, so this should usually be false.boolean.opaqueCommon
RolloverIf true, the button may indicate that the mouse is hovering over it.boolean.rolloverEnabledBehavior
Set ValueThe value to set the control value to when the button is pushed.int.setValueData
StylesContains the component's stylesDataset.stylesAppearance
ValueThe current value. Should be bound bi-directionally to a tagint.valueData
Vertical AlignmentThe vertical alignment of the button's contents (text and/or image)int.verticalAlignmentLayout
Vertical Text PositionThe vertical position of the button's text relative to its imageint.verticalTextPositionLayout
VisibleIf disabled, the component will be hidden.boolean.visibleCommon
Writing TextThe text of the button while its value is being writtenString.writePendingTextBehavior

Scripting

Scripting Functions

This component does not have scripting functions associated with it.

Extension Functions

This component does not have extension functions associated with it.

Event Handlers

Event handlers allow you to run a script based off specific triggers. See the full list of available event handlers on the Component Events page

Customizers

Example

One Shot Button