Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi,
I wish to every 1 second add a row into a data table (I already created a data shape and I have 23 columns) in order to export them later and manipulate the data.
The problem is I don´t know which service use or how to add them every 1 second.
I Tried using Add Data Table Entries but the timestamp is not working well.
Is always showing a 00:00 and I don´t know why
Thank You
Solved! Go to Solution.
Hi
+1 to Carlos' advice above.
There's a substantial performance difference between Streams and Data Tables. Streams are written asynchronously, data to be persisted in a stream goes into a queue and is processed from the queue. Data Tables are written synchronously. The system effectively stops and waits for the data to be written, if you're trying to put large amounts of data into a Data Table, it's relatively easy to start negatively impacting system performance.
The "AddStreamEntry" code snippet creates a timestamp for you and persists that in the timestamp column that is part of the default set of fields for a Stream object.
Hope this helps
Regards
Ian
Hi David,
00:00 --> hours:minutes --> On this format there's no seconds to show, maybe you have it on every second but you don't see it.
If you want to trigger a add data table entry every second, you can use a Timer thing configured to trigger an event every second, and subscribe to that timer event and add the data table entry.
But, if you want to add an entry every second for a long time, DataTables are not the Data Store mechanism to go, betters you go to a Stream thing. DataTables are meant to store about 100k registers and in this frequency you will reach it fast.
Carles.
Hi
+1 to Carlos' advice above.
There's a substantial performance difference between Streams and Data Tables. Streams are written asynchronously, data to be persisted in a stream goes into a queue and is processed from the queue. Data Tables are written synchronously. The system effectively stops and waits for the data to be written, if you're trying to put large amounts of data into a Data Table, it's relatively easy to start negatively impacting system performance.
The "AddStreamEntry" code snippet creates a timestamp for you and persists that in the timestamp column that is part of the default set of fields for a Stream object.
Hope this helps
Regards
Ian
Thank you both of you,
I decided using a stream, and query for the property history for using the export button.