Hello Everyone,
Application: I have accumulation section with 24 beds and there's individual PE's for each section. I want to create a pop up window with all the PE's listed in table to show where exactly the jam is using the following script.
step 1: I have multiple tags that I'm reading form a folder for an accumulation zone with 24 tags. so naturally built a tagpath list to read from.
step 2: read all the tags and used list comprehension to generate another list to store values that i read.
****part I'm currently cant get past is step 3
step 3: tag_value_list is what I'm trying to attach to a data table. and where should I apply this script on. possibilities i have considered so far (button action performed, project scripts).
acc_number = 12093701
bed_number = 24
end_acc_number = acc_number + bed_number
x = [item for item in list(range(acc_number, end_acc_number))]
print(x)
#tag_base_path = "JAM_PHOTOEYES/12093730/1209370"
tag_base_path = "JAM_PHOTOEYES/12093730/"
tag_paths = [ ]
# These two for loops iterate over a range and generate tag paths for us to read from
for i in x:
tag_path = tag_base_path + str(i)+"/AFE_Recirc_Pecblockage"
tag_paths.append(tag_path)
# this line reads all the tags at the path we specified
tag_values = system.tag.readAll(tag_paths)
#this list comprehension allows us to wrap all the values read in a list for us
tag_value_list = [tag.value for tag in tag_values]
# new to convert list into a dataset and bind data property of the table to this dataset tag
print(tag_value_list)