# Best way to write to PLC array

**URL:** <https://forum.inductiveautomation.com/t/best-way-to-write-to-plc-array/83791>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 4, 2024, 2:57pm UTC](https://forum.inductiveautomation.com/t/best-way-to-write-to-plc-array/83791 "2024-01-04T14:57:33Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [January 4, 2024, 3:14pm UTC](https://forum.inductiveautomation.com/t/best-way-to-write-to-plc-array/83791/5 "2024-01-04T15:14:41Z")

</div>

That looks about right. You can also use some list comprehensions instead of the for loops to do the same thing in a more compact way.

Something like this:

> [@Best way to copy tag values from one register to another](https://forum.inductiveautomation.com/t/best-way-to-copy-tag-values-from-one-register-to-another/44069/4):
>
> One version I believe replaces all the functionality in use in the function you shared above (caveat: untested): def load\_mem\_to\_current(cell\_id): """Load recipe parameters from memory to cell/current location Param: cell\_id (str): Id designation of cell """ # List tags to read. readTags = ['[{}]/Cell/Recipe/Memory/{}'.format(cell\_id, x) for x in range(0,49)] # Read tags and extract values. writeValues = [x.value for x in system.tag.readBlocking(readTags)] # List…

---

_[View the full topic](https://forum.inductiveautomation.com/t/best-way-to-write-to-plc-array/83791)._
