Tag Historian cycle based instead of time based?

Don’t know exactly how to word my question, but would it be possible to setup a historical tag as more of a measurement count based series instead of a time based series?

For example, I’m logging cycle time for every part that is run. I don’t really care WHEN the cycle was ran, just that it was the cycle time of the 8th part. Graphing based on time makes it look funky when line takes breaks or doesn’t run for several days.

Second, I break that cycle time up into steps such as weld time, clamping time, table rotation time, operator load time, etc… that I need to keep together. So I need to store that the 5th cycle, weld time was 21 seconds, clamping time was 42 seconds, etc… whatever.

Third, I name the steps in PLC that I would like to log to make it more automated when setting up on new cells. Operation 320 may have a pierce step that I need to log in addition to welding etc…

From the options given by tag historian, I’m just going to venture to assume best bet would be transaction groups for this type of data, but just curious if there might be a simpler way to set it up with tag historian I might be missing.

Added bonus question: In my AOI instruction that I’m setting up an array of a UDT called Steps[20]. I may not use all 20 steps. Step consists of Name, Time.

Example. Step[0].Name = “Operator Load”, Step[0].Time = 21 seconds.

In my database I basically want my columns to be my step names names, and each row to be a single part broken down into times. Would there be an automated way to setup the transaction groups for each instance of the AOI I setup? I’m not sure how to set the column name equal to a string tag in general.

Yes, transaction groups are the tool you need here, as they keep data together in a row in the database. Your rows will need to correspond to events that your trigger can fire upon. You will have to assemble these events into the wide format you wish with database views or with scripting.

Figured as much. Triggering is easy, as I change a “LogRequestID” every time data updates, so I can just trigger on value change there and it doesn’t matter if I miss any long as I don’t miss a lot.

I’m wanting to automate this a bit since i’m going to have to set it up on hundreds of operations. Given that any operation could have up to 20 different steps, and step names may not be identical between operations, I’m going to venture to assume again that my best bet would be to create a stored procedure and using stored procedure group to handle this? Since my target names will change based on whatever I name the steps in PLC. I’m not 100%, but I bet I could handle column creation/naming inside a stored procedure.

I’m pretty sure this will come to grief. IIRC, data definition statements don’t play well with transactions on most platforms.