I’ve written a python script to pull SER records from an SEL relay via telnetlib. I end up with a list of lists that looks like:
>>>
['10', '11/11/16', '12:23:48.771', 'IN104', 'Asserted']
['9', '11/11/16', '12:23:48.771', 'TMB3A', 'Asserted']
['8', '11/11/16', '12:23:51.914', '59Q', 'Asserted']
['7', '11/11/16', '12:23:51.964', '59Q', 'Deasserted']
['6', '11/11/16', '12:23:57.924', 'IN104', 'Deasserted']
['5', '11/11/16', '12:23:57.924', 'TMB3A', 'Deasserted']
['4', '11/20/16', '08:16:06.130', '59Q', 'Asserted']
['3', '11/20/16', '08:16:06.168', '59Q', 'Deasserted']
['2', '11/20/16', '18:21:08.307', '59Q', 'Asserted']
['1', '11/20/16', '18:21:08.428', '59Q', 'Deasserted']
It’s easy to process this into something more useful:
>>>
[11/11/16 12:23:48.771, IN104, True]
[11/11/16 12:23:48.771, TMB3A, True]
[11/11/16 12:23:51.914, 59Q, True]
[11/11/16 12:23:51.964, 59Q, False]
[11/11/16 12:23:57.924, IN104, False]
[11/11/16 12:23:57.924, TMB3A, False]
[11/20/16 08:16:06.130, 59Q, True]
[11/20/16 08:16:06.168, 59Q, False]
[11/20/16 06:21:08.307, 59Q, True]
[11/20/16 06:21:08.428, 59Q, False]
Retrieving these records is relatively expensive in a time sense, I’m planning on running this as a gateway timer script. What is the best approach to saving this data to a database / historian for HMI viewing and long term archiving given that:
- I don’t get the data in real time.
- Retrieving records doesn’t purge them from the relay - if no events have happened since the last poll, I get the same list of events.
So far, everything historian related I’ve used the store and forward engine but I don’t get how to use that in this scenario. Is my best option to create a separate table for this data and manage adding records myself? Has anybody here already developed solutions for sequential event recorder data retrieval and storage?
Thanks.