Change Label Text Binding Based on Multi-State Button Selection (OPC Tags)

Hi everyone,

I’m working with Ignition Perspective and I have a Multi-State Button that allows the operator to select between three different tools. Each state represents a different tool selection.

I want to display a value in a Label component, where the Label’s Text property shows a value coming from an OPC tag. The requirement is that the OPC tag being displayed should change depending on the selected state of the Multi-State Button.

For example:

  • State 0 → show OPC Tag for Tool 1

  • State 1 → show OPC Tag for Tool 2

  • State 2 → show OPC Tag for Tool 3

I’m trying to handle this using a binding on the Label’s props.text property, but I’m unsure of the best method to dynamically switch between OPC tags based on the button’s selected state.

What is the recommended approach in Perspective for this use case?

Create 3 custom props that are bound to the 3 different tags.

Then on your label's props.text you can grab the buttons value, and choose which of the custom props to read the value of.

2 Likes