Hi, I have a historical group that is set to save data every 250ms to a mysql database. This is being achieved but when calling the data to an easy chart I can see that the four records that make up a second are displayed all together in the same second and not spaced by milliseconds. Is this a transactional group problem? or what would be the problem?
That usually means your DB isn’t saving the milliseconds. For PostgreSQL, you’d specify the column type as timestamptz(3) for milliseconds, timestamptz(6) for microseconds, timestamptz(0) for seconds. PostgreSQL defaults to (6). It is similar for MariaDB and datetime columns, but the default is (0). I’m not sure what you’d use for MySQL (why are you using MySQL?).
Forget the dolphin. Move on to the Sea Lion (MariaDB).
Now I using MariaDB, I set DATETIME (6) to t_stamp but the Transaction group don’t save millisecond.
CREATE TABLE IF NOT EXISTS `test_rapido` ( `test_rapido_ndx` int(11) NOT NULL AUTO_INCREMENT, `t_stamp` DATETIME (6), `M400_3` int(11) DEFAULT NULL, `M400_4` int(11) DEFAULT NULL, PRIMARY KEY (`test_rapido_ndx`), KEY `test_rapidot_stampndx` (`t_stamp`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
I think that using transactional groups it is not possible to save milliseconds but it is possible using the tag historian module.
It is possible, try using a timestamp column.
Using TIMESTAMP(6) with mysql did the job, thanks for the advice.