Failing to create a start button for a pump using indirect tags

trying to create a standard one shot or similar start/stop button to be used in several pumps without having to rewrite as much as possible, currently my approach has been the introduction of indirect tags as part of the button's customization, however this has been to no avail. anyone out there with experience doing this or something similar> urgent help needed please!!!

A few housekeeping things first.

Vision or Perspective? Mark the topic as such.

What exactly are you having issues with? My suggestion is to get it working with direct tags first, then move on to indirection. If it doesn't work directly it probably isn't going to work indirectly.

If/when you have issues, show us what you have tried. Post code using preformatted text. Screenshots don't help much.

And, welcome to the forum!

1 Like

currently throught vision, the issue at hand is that whenever I try: to use two Bool tags to provide the values, create the button and write the following scritp under action: # Define the path to the one-shot trigger tag
one_shot_trigger_path = "[default]Path/To/Your/OneShotTriggerTag"

Check if the one-shot trigger tag is currently false

if not system.tag.read(one_shot_trigger_path).value:
# Set the one-shot trigger tag to true
system.tag.write(one_shot_trigger_path, True)

I can save and run, however i get an error message and the button text goes from "start: to "writing"

and thanks for the welcome I sincerely appreciate it :slight_smile:

Welcome to the forum. Please take a few extra seconds when composing your posts to capitalise and punctuate properly. It makes reading much easier and can eliminate much ambiguity. (Your compiler wouldn't let you away with incorrect syntax so why should we!)

You can edit your question title to fix the "pumo" typo and add the Vision tag as requested.

2 Likes

Hi Luis,

I've gone ahead and added the Vision tag to your post to make it easier for the right people to find your post. I also corrected the typo while I was at it but feel free to edit as needed.

1 Like

Welcome, and as with the others, here are a few pointers:

When posting code, use the formatting tool:
image
or surround your code with triple backticks, you can even specify what language to use:
```python
code
```

This doesn't help much if we don't know what the error is. Post it with the code that produces it.

edit: The whole forum uses markdown for formatting. If you're not familiar with it, it's quite simple:

And as you can see, you can edit your own posts to correct things... like code formatting.

1 Like

Read the docs, Vision - One-Shot Button - Ignition User Manual 8.1 - Ignition Documentation

Use bindings vs script.

Take note of the comment in the doc:
"you must make sure that the PLC resets this value, otherwise the button will remain in a writing state."

1 Like

thank you appreciate the help

do i just add the reset to the script of the tag?

Did you read the doc?

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. 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.