I am wanting to use the "system.tag.browse" command by passing in a variable into the path. Can this be done? Here is what I have so far but I can't seem to get past the line "tag =system.tag.browse(tagPath)".
for v in range(1,9):
tagString = '[default]Recipe_Builder/Station_%s/InstructionList'%(v)
for row in range (0,20):
tagString2 = 'InstructionList_%s_'%(row)
tagPath = tagString + tagString2
#print tagPath
tag = system.tag.browse(tagPath)
for i in tag.getResults():
You can use the second parameter of system.tag.browse to pass in filters. I think that's what you're asking.
An example
return system.tag.browse('[Provider]Devices', {"name":"*Filter*"})
It will return all tags in the "Devices" folder that have "Filter" in their name.
Edit:
Looking at your code I think you might be better served using a template repeater and indirect bindings.
If you copy something from the perspective property editor you can paste it in a text editor to see what the JSON looks like. Then you can create dynamic JSON using a script.
So you can make a template for 1 row on some form of custom data and have it indirect all its bindings from the passed in parameter. Then you can instantiate that template with a flex repeater using a script.
The only time I would recommend using tag browse with this is if you're trying to generate the content based on tags that exist in a location in the tag db which sometimes makes sense to do.
I believe this is what I'm looking for. I am wanting to get all the tags that is used in this parent folder "Recipe_Builder" which I will then use to write a value back to SQL.
for v in range(1,9):
for row in range (0,20):
tag = system.tag.browse('[default]Recipe_Builder/Station_%s/InstructionList/InstructionList_%s_'%(v,row))
for i in tag.getResults():
Oh, you don't have a front end for what you're doing. Yeah, that is probably what you need.
I thought you might be making a recipe editor.
That is exactly what I'm making. However we are wanting to capture any changes that are made to the recipes and the date they are made. I am running a query on an SQL database and writing those values to memory tags in Ignition. Once changes have been made, capturing the before and after values and then writing values back to SQL when a "Save" button is pressed.