Timer Script for Active Alarms

Okay, so I would recommend that you do some research into python, there are several great resources out there for that.

Technically speaking you haven't created a list (even though it may look that way) instead you have created several variables holding string values.

In python a 'list' is a type of data sequence denoted by surrounding comma separated values with square brackets [ ].

For instance a list of integers could be [1,2,3,4].

In my code I created a list inline by surrounding the strings with [ ]. You could also create the list separately and hold it in a variable.

 tagPaths = ["[Modicon]HR1005.2","[Modicon]HR1005.3","[Modicon]HR1005.4","[Modicon]HR1005.5" , "[Modicon]HR1005.6","[Modicon]HR1005.7","[Modicon]HR1005.8","[Modicon]HR1005.9","[Modicon]HR1005.10","[Modicon]HR1005.11","[Modicon]HR1005.12", "[Modicon]HR1000.8","[Modicon]HR1000.9","[Modicon]HR1004.9", "[Modicon]HR1004.3","[Modicon]HR1005.0"]

tagQVs = system.tag.readBlocking(tagPaths) #NOTE the missing [], because tagPaths is already a list

Alternatively you can also use the append function of the list to add elements

tagPaths = []
tagPaths.append('New Tag Path')

Again, I would highly recommend that you work on getting a better understanding of python. Not only will it help you in writing the code but also in understanding replies to questions on the forum. Because despite our best efforts our answers can be somewhat cryptic to the uninitiated. :wink:

Here's a good post on where to hone your skills, also I can't recommend Inductive University enough.

1 Like