# How do I make this reset less.. dumb

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-make-this-reset-less-dumb/96550>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [September 27, 2024, 2:44pm UTC](https://forum.inductiveautomation.com/t/how-do-i-make-this-reset-less-dumb/96550 "2024-09-27T14:44:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyle\_kelly](https://avatars.discourse-cdn.com/v4/letter/k/b9e5f3/32.png) [@kyle\_kelly](https://forum.inductiveautomation.com/u/kyle_kelly)\
**Post date:** [September 27, 2024, 2:44pm UTC](https://forum.inductiveautomation.com/t/how-do-i-make-this-reset-less-dumb/96550/1 "2024-09-27T14:44:16Z")

</div>

![IMG_0226](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/0/f00a3fae788d4feb6276a85ed47ecf909fe8b080.jpeg)

It works this way but I don’t like it  
It’s a master reset button for 52 motors

I imagine there’s a way to not write “0” and “1” exactly 52 times

And holding the button down doesn’t keep them all in the same state until released.  
(Not needed but I’d like to know how to make that happen too)

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [September 27, 2024, 2:45pm UTC](https://forum.inductiveautomation.com/t/how-do-i-make-this-reset-less-dumb/96550/2 "2024-09-27T14:45:40Z")

</div>

```python
Values1 = [1]*len(Paths)
Values0 = [0]*len(Paths)

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 27, 2024, 2:45pm UTC](https://forum.inductiveautomation.com/t/how-do-i-make-this-reset-less-dumb/96550/3 "2024-09-27T14:45:59Z")

</div>

> [@kyle\_kelly](#):
>
> I imagine there’s a way to not write “0” and “1” exactly 52 times

```python
Values1 = [1] * len(Paths)
Values0 = [0] * len(Paths)

```

edit: lost the race!

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 27, 2024, 3:25pm UTC](https://forum.inductiveautomation.com/t/how-do-i-make-this-reset-less-dumb/96550/4 "2024-09-27T15:25:54Z")

</div>

1. Hoping you're using some sort of AOI in the PLC, you could've tied them all to one master reset button in the PLC.
2. It looks like many of your paths are the same, just incrementing a number

This is what I'd do:

```python
resets = [

	('[default]MPH/34CL/34_CL{}/Fan_Motor/Reset',	16	),
	('[default]MPH/FR/FR{}/Fan_Motor/Reset', 8	),
	('[default]MPH/FDC/FDC{}/Fan_Motor/Reset', 3	),
	('[default]MPH/45CL/45_CL{}/Fan_Motor/Reset',	3	),
	('[default]MPH/34RD/34_RD{}/Fan_Motor/Reset',	6	),
	('[default]MPH/55CL/55_CL{}/Fan_Motor/Reset',	6	),
	('[default]MPH/55RD/55_RD{}/Fan_Motor/Reset',	2	),
	('[default]MPH/34SD/34_SD{}/Fan_Motor/Reset',	8	),

]

paths = [

	path.format(x) for (path,count) in resets for x in range(1, count +1)

]

system.tag.writeBlocking(paths, [1 for path in paths])
system.tag.writeBlocking(paths, [0 for path in paths])

```

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [September 28, 2024, 7:03am UTC](https://forum.inductiveautomation.com/t/how-do-i-make-this-reset-less-dumb/96550/5 "2024-09-28T07:03:09Z")

</div>

Nicely done.

If you need the ranges configuration to be more flexible, you can change the end bound to anything that will produce the right numbers: list, generator, function...  
So you can change things easily when one of them needs an offset, or needs to skip some numbers.  
ie:

```python
resets = [
	('[default]MPH/34CL/34_CL{}/Fan_Motor/Reset',	xrange(1, 17)),
	('[default]MPH/FR/FR{}/Fan_Motor/Reset', (1, 3, 6, 7, 8)),
	('[default]MPH/FDC/FDC{}/Fan_Motor/Reset', get_FDC_indices()),
	('[default]MPH/45CL/45_CL{}/Fan_Motor/Reset',	xrange(2, 8, 2)),
	...
]

paths = [path.format(x) for (path, indices) in resets for x in indices)]

```

Offers a lot of flexibility. Which may not be required in your case, so don't make it more complicated than it needs to be, but keep in mind it's a possibility,
