Select scan class based on user input

I have a page with several tags that I want the scan class to be selected via a spinner (increments of 5 seconds up to 30 seconds) where the user can select the update time. If i were to create a scan class for each 5 second increment what scripting can I use to tell which scan class to use based on value selected on the spinner?
Example: If value of spinner selected is 10 then use the 10 second scan class for the tags in question.
Thank you in advance

You can write to the scan class property of a tag:

system.tag.write("Path/To/Tag.ScanClass","New Scan Class Name")

You can also bi-directionally bind to the ScanClass property in windows.

While you can change it, I don’t really know if it’s something you should do, or if the intended varying read rates will always occur. I can’t vouch for the behavior of OPC with changing this on the fly (effect or lack thereof on opc subscription rate, revised rate, PLC read optimizations, etc).

Good Luck!


You can do this with the IA Labs Scripting Module.