I need to know how to put an array of 3 different string in a table and show like is in console

actually i have a little scrip that read data from an opc plc and organize

x=0
for m in range(9):
for r in range(11):
for c in range(5):

		   pnPath = "[TAG01_default]ModuleRack 1/ModuleRack_" + str(m) + "_/Row/Row_" + str(r) + "_/Column/Column_" + str(c) + "_/Module/PartNumber"

		   snPath = "[TAG01_default]ModuleRack 1/ModuleRack_" + str(m) + "_/Row/Row_" + str(r) + "_/Column/Column_" + str(c) + "_/Module/SerialNumber"
		   tagread = system.tag.readBlocking([pnPath,snPath])
		   if tagread[0].value != '':
				print "Rack " + str(m)
				print " Row " + str(r)
				print "Column " + str(c)
				#print tagread
				
				pnsn = tagread[0].value + ":S" + tagread[1].value
				print pnsn
				x+x+1

with this o would like to be able to put in a power table or a text field
to show like my console

image

If you want to use it on a Power Table, you'll need to create a dataset, this page has almost everything you need to know about datasets but basically you'll need a list of columns and a list of rows, it's important that the length of the list of columns is equal to the length of each item on the list of rows.

https://docs.inductiveautomation.com/display/DOC81/Datasets

So your code could look something like this, noting that i don't know what values you actually want to show and how you want to show them:

x=0
headers = ['Rack','Row','Column','pnsn']
Rows = []
for m in range(9):
	for r in range(11):
		for c in range(5):
		   pnPath = "[TAG01_default]ModuleRack 1/ModuleRack_" + str(m) + "_/Row/Row_" + str(r) + "_/Column/Column_" + str(c) + "_/Module/PartNumber"

		   snPath = "[TAG01_default]ModuleRack 1/ModuleRack_" + str(m) + "_/Row/Row_" + str(r) + "_/Column/Column_" + str(c) + "_/Module/SerialNumber"
		   tagread = system.tag.readBlocking([pnPath,snPath])
		   if tagread[0].value != '':
				print "Rack " + str(m)
				print " Row " + str(r)
				print "Column " + str(c)
				#print tagread
				Rows.append(["Rack " + str(m),
							 "Row " + str(r),
							 "Column " + str(c),
							 tagread[0].value + ":S" + tagread[1].value])
				pnsn = tagread[0].value + ":S" + tagread[1].value
				print pnsn
				x+x+1
resultDataset = system.dataset.toDataSet(headers, Rows)

You'll have to send your resultDataset to your Power Table's data property afterwards.

Please edit your question and add a tag (below the title) for Vision or Perspective. The answer may depend on which you are using.

Your performing 495 reads on 990 tags, 2 tags at a time. Not great. I can't imagine that this script runs very quickly, nowhere nearly as quickly as it can.

This script is equivalent to yours but will run exponentially faster.

from itertools import product

def chunker(seq,size):
	return(seq[pos:pos + size] for pos in xrange(0,len(seq),size))

parentPath = "[TAG01_default]MosuleRack 1/ModuleRack_{}_/Row/Row_{}_/Column/Column_{}_/Module/{}"
paths = [parentPath.format(m,r,c,tag) for m,r,c,tag in product(xrange(9),xrange(11),xrange(5),("PartNumber","SerialNumber"))]

outputStrings =  ["Rack {} \n Row {} \nColumn {}".format(m,r,c) + '\n{}:S{}' for m,r,c in product(xrange(9), xrange(11), xrange(5))]

for i,(pn,sn) in enumerate(chunker([qv.value for qv in system.tag.readBlocking(paths)],2)):
	if pn:
		print outputStrings[i].format(pn,sn)

The 'chunker' function just breaks the tag values list into chunks of two values at a time, one for the part number and one for the serial number.

Throw it in your script console and try it out if you don't believe me.

You said you would like to be able to put it in either a power table or a text field, so I am assuming Vision, but depending on what component you want to show this in, will change what the rest of the code looks like. So let us know what you actually want and then we can help you from there. Or better yet, give it a try yourself and come back with what didn't work.