# Select scan class based on user input

**URL:** <https://forum.inductiveautomation.com/t/select-scan-class-based-on-user-input/6759>\
**Category:** Ignition\
**Created:** [June 25, 2013, 2:00pm UTC](https://forum.inductiveautomation.com/t/select-scan-class-based-on-user-input/6759 "2013-06-25T14:00:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcorkern](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rcorkern](https://forum.inductiveautomation.com/u/rcorkern)\
**Post date:** [June 25, 2013, 2:00pm UTC](https://forum.inductiveautomation.com/t/select-scan-class-based-on-user-input/6759/1 "2013-06-25T14:00:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dep05d](https://avatars.discourse-cdn.com/v4/letter/d/e495f1/32.png) [@dep05d](https://forum.inductiveautomation.com/u/dep05d)\
**Post date:** [June 25, 2013, 6:40pm UTC](https://forum.inductiveautomation.com/t/select-scan-class-based-on-user-input/6759/2 "2013-06-25T18:40:41Z")

</div>

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

```auto
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!

Dan

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [July 12, 2013, 7:00pm UTC](https://forum.inductiveautomation.com/t/select-scan-class-based-on-user-input/6759/3 "2013-07-12T19:00:33Z")

</div>

You can do this with the IA Labs Scripting Module.
