Best way to copy tag values from one register to another

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 tags to write.
   writeTags = ['[{}]/Cell/Recipe/Current/Cell/{}'.format(cell_id, x) for x in range(0,49)]
   # Write values to tags.
   system.tag.writeBlocking(writeTags, writeValues)

Yes, I like list comprehensions :slight_smile:

2 Likes