Ok, first things first, it’s been awhile since I last posted, and it appears that my scripting skills have rusted over time.
I have 450 OPC Tags that are all integers. There are only 12 values that they can have. What I need is the equivalent of excel’s
COUNTIF function. I have been unsuccessful in using the
system.tag.readAll scripting function.
Example of Tag Layout
There are 13 folders in the Curing folder:
Tags-> US9_FIS-> Curing->
For 0000, there are 44 INT Tags. For 0100 - 1200 there are 34 INT Tags in each folder:
US9_FIS Curing 0000 0001_DTCode_Right 0001_DTCode_Left 0003_DTCode_Right 0003_DTCode_Left . . . 0041_DTCode_Right 0041_DTCode_Left 0100 0101_DTCode_Right 0101_DTCode_Left 0103_DTCode_Right 0103_DTCode_Left . . . 0133_DTCode_Right 0133_DTCode_Left . . . 1200 1201_DTCode_Right 1201_DTCode_Left 1203_DTCode_Right 1203_DTCode_Left . . . 1233_DTCode_Right 1233_DTCode_Left
My idea is this, create 12 Memory tags to hold the count from each type of code that can exist. Then, loop through all the tags with a
system.tag.readAll and count while looping through the tags. I also imagine that I would have to loop for each code, so 12 times? Any assistance would be greatly appreciated!!
Thank you all in advance.