Activate Tag History via Scripting

Hello there,

is there a way to enable the Tag Historian for a Tag via Skripting?

More specificaly what i need to accomplish with that:

I have an OPC Tag that is receives its Data from a PLC / CNC, it shows the current torque of a Drive.
Another Tag shows the current NC Programm that runs on the machine.
Now i want the Tag History to be enabled ONLY when a specific NC Programm is running, or in Terms of Tags Only when the NC Programm Tag has a certain value.

Background:

We want to monitor the development of the Drives Torque Values, for that we need a standard programm to make the measurments comparable.

I thought something like this example (simpliefied) would do the job.

Programm Tag = PT
Torque Tag = TT

IF "PT" == "Standard Programm":
Enable Tag History for "TT"
Else:
Disable Tag History for "TT"

I know the code wouldnt finaly do the job, i just need an way for enabling/disabling Tag History based on another tags value.
Is there a build in Function in Ignition?

I really appreciate any help and tipps how to accomplish that.
Greetings,

Luca

Yes, technically, via system.tag.configure.

However, this is a bad idea. Ignition's tag historian is strongly optimized for "set it and forget it" storage of data, not process driven or otherwise 'controlled' historical data.

You should look into transaction groups or simply scripting this operation yourself into your own storage table(s). Ignition 8.1 adds the DB table historian provider type which allows you to 'bridge' more standard wide DB table structures into Ignition's historian easily.

4 Likes

Thank you Paul,

i'll take a look into the transaction groups.
I checked the videos at the University and it seems like its the functionality i need!

Greetings,

Luca