[ArchivingRoot] archiving every 100ms with TdbArchiver
|
|
---|---|
Hello, I would like to know if the ms are copied by TdbArchiver into the TDB table, knowing that they are in the .dat file? Because I cannot retrieve the ms from the TDB database (data archived every 100ms). Both in the database with the 'select' command and with a python script and the 'GetAttDataBetweenDates' command… I put prints below :) THANKS. extracted from the .dat file: 2024-07-09 11:20:17.089,mysql commands: MariaDB [tdb] > select * from att_00181 where ((time >= '2024:07:09 11:20:17.000') and (time <= '2024:07:09 11:20:17.999')); extract from the python script with a DeviceProxy: >>>[N,], [name,] = extractor.GetAttDataBetweenDates(["er/sy/rac.17-elr.01-rdp.03/ai_2","2024-07-09 11:20:17" ,"2024-07-09 11:20:17"]) |
|
|
---|---|
Hi, I may have found the explanation and I can try to give an answer. To be confirmed though ;) The ms seem to be archived well but on the other hand the datetime type in MariaDB does not contain the milliseconds! The precision of datetime depends on the SQL base Must modify the format in the table: MariaDB [tdb]> ALTER TABLE `att_00181` MODIFY `time` datetime(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000'; Checking the result after the `ALTER TABLE`: With mysql: MariaDB [tdb]> SELECT DATE_FORMAT(time, '%Y-%m-%d %H:%i:%s.%f') FROM att_00181 WHERE time LIKE '2024-07-18 00:00:00%'; With the use of TdbExtractor: [datetime.datetime(2024, 7, 18, 0, 0, 0, 61000) |