cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

How to store events

byutz
12-Amethyst

How to store events

We have a gateway in the field that will be sending up events as they happen, and example would be an estop pressed, or a solenoid actuated.  With each event there will be sent a start time and a duration.  What is the best way to store these events?  I would like a general events infotable for each "thing" that holds the name of the event, time, and duration.  Should a new row be added as each event occurs, or should I use a stream and just replace the existing row with the most current event? 

ACCEPTED SOLUTION

Accepted Solutions
pschmaltz
12-Amethyst
(To:byutz)

What I did when facing a similar situation recently was create an infotable type logged property on my thing with a datashape containing the fields I wanted to trap from the event (e.g. maybe for you it is event name, event duration/value, event timestamp... if the value stream timestamp is somehow not appropo). That would give you an ongoing history of events you could query from the value stream (and perhaps purge over time ultimately too).

I then subscribed to data changes on that property and generated whatever property updates and events I want for performing more specific actions on particular types of event names that are received.

View solution in original post

1 REPLY 1
pschmaltz
12-Amethyst
(To:byutz)

What I did when facing a similar situation recently was create an infotable type logged property on my thing with a datashape containing the fields I wanted to trap from the event (e.g. maybe for you it is event name, event duration/value, event timestamp... if the value stream timestamp is somehow not appropo). That would give you an ongoing history of events you could query from the value stream (and perhaps purge over time ultimately too).

I then subscribed to data changes on that property and generated whatever property updates and events I want for performing more specific actions on particular types of event names that are received.

Announcements


Top Tags