Attempting to write to tags with a button press

I would like to write to a tag representing a digital output on a modbus TCP io module. I can change the state of the output by checking the value box of the tag in the tag browser of designer, I can do it by adding a toggle switch to the view and that works great. I cannot seem to do it by using a button though. What property of the button do I bind to my tag?

A two state toggle button is not offered in the version of designer I have, I don't have any components I can use to indicate the status of inputs like an LED mimic. Is the Maker version of designer limited by comparison with the paid version?

[I have never worked with Maker so let me know if some of this doesn't work.]

I cannot seem to do it by using a button though. What property of the button do I bind to my tag?

The Toggle Switch and Checkbox components allow binding of their selected property to a boolean tag.
Buttons don't have a selected property. You would have to right-click on the component → Configure Events ... → onActionPerformed → Script and write a script to do what you want.

A two state toggle button is not offered in the version of designer I have.

Is the Toggle Switch component not there?

I don't have any components I can use to indicate the status of inputs like an LED mimic.

These are easy to generate using a Label component.

LED indicator

  1. Create a new view. (A coordinate view will be simplest for now.)

  2. Paste the Toggle Switch code below into your view.

Toggle Switch
[
  {
    "type": "ia.input.toggle-switch",
    "version": 0,
    "props": {
      "label": {
        "text": "Toggle switch"
      }
    },
    "meta": {
      "name": "ToggleSwitch"
    },
    "position": {
      "x": 878,
      "y": 190.5,
      "rotate": {
        "anchor": "75% 61%"
      },
      "height": 36,
      "width": 189
    },
    "custom": {}
  }
]
  1. Paste the lblLED code block below into your view.
Indicator label component
[
  {
    "type": "ia.display.label",
    "version": 0,
    "props": {
      "style": {
        "borderStyle": "solid",
        "borderWidth": 1,
        "borderColor": "#695858",
        "borderTopLeftRadius": "50%",
        "borderTopRightRadius": "50%",
        "borderBottomLeftRadius": "50%",
        "borderBottomRightRadius": "50%"
      }
    },
    "meta": {
      "name": "lblLED"
    },
    "position": {
      "x": 836.5,
      "y": 197,
      "rotate": {
        "anchor": "176% -437%"
      },
      "height": 32,
      "width": 34
    },
    "custom": {},
    "propConfig": {
      "props.style.backgroundColor": {
        "binding": {
          "type": "expr",
          "config": {
            "expression": "{../ToggleSwitch.props.selected}"
          },
          "transforms": [
            {
              "inputType": "scalar",
              "outputType": "color",
              "mappings": [
                {
                  "input": true,
                  "output": "#00AC00"
                }
              ],
              "fallback": "#D90000",
              "type": "map"
            }
          ]
        }
      }
    }
  }
]
  1. Turn on preview to try it out.

Have a look at how the binding is done on the label's backgroundColor. You'll be pointing that to a tag rather than the position of the Toggle Switch component.

I think the only difference is it cannot be used for commercial projects.

It also does not have Vision and a few other modules.

@Phillip_Armstrong
If you would like to have a two state button bring in a multi state toggle button, and delete one of the states. I have attached a screen shot of the two state button with the props. Bind your tag to the control value and the indicator value and make sure bidirectional is checked. I have maker running connected to a plc using modbus at home to control a stack light so the kids know I am in a meeting.

Thank you, I will experiment with your suggestion

There is much to learn, thanks for such a quick response