Create scan classes in code

Does anyone know if it is possible to create scan classes in code? We are dynamically creating a set of tags when a new piece of equipment is added to the system, but we only want to log data for those tags when the system is running.

We were planning to do this using a driven scan class, but we will need a scan class for each piece of equipment and so need to create the scan class dynamically as well.

Start here.
You would get to this with code similar to:

from com.inductiveautomation.ignition.gateway import SRContext
tagmgr = SRContext.get().getTagManager()
1 Like

Not endorsed, don’t expect this to work in Ignition 8, etc…

1 Like

A whole new tag manager too? Awww! :cry:

1 Like

Scan classes don’t even exist in Ignition 8 my friend.

(just replaced by a similar concept with a less misleading name)

Is there an approach that will work going forward?

No, there’s no public API for doing this.

edit: technically, TagManager is public, but it’s public to module developers, and they’re expected to deal with stuff breaking between 7.9 and 8.0.

1 Like