Posted data every 10 minutes shows 2 "blank" data entries in between posts

Mark Ennamorato on 21 Aug 2021 (Edited on 21 Aug 2021)
Latest activity Reply by Mark Ennamorato on 22 Aug 2021

Im posting data every 10 minutes to this field as you can see, yet when i pull the data back down there are 2 timestamps in between each post with 'nothing' in them which in tern screws up any matlab script trying to average the data. Why is this happening? thanks see below

created_at,entry_id,field2
2021-08-21 09:54:27 -0600,38811,5.416666666666667
2021-08-21 09:57:02 -0600,38812,
2021-08-21 10:03:59 -0600,38813,
2021-08-21 10:04:27 -0600,38814,5.0
2021-08-21 10:07:02 -0600,38815,
2021-08-21 10:13:59 -0600,38816,
2021-08-21 10:14:28 -0600,38817,5.0
2021-08-21 10:17:03 -0600,38818,
2021-08-21 10:23:59 -0600,38819,
2021-08-21 10:24:28 -0600,38820,5.416666666666667
2021-08-21 10:27:03 -0600,38821,
2021-08-21 10:34:00 -0600,38822,
2021-08-21 10:34:29 -0600,38823,8.333333333333334
2021-08-21 10:37:04 -0600,38824,
2021-08-21 10:44:00 -0600,38825,
2021-08-21 10:44:29 -0600,38826,6.25
2021-08-21 10:47:09 -0600,38827,
2021-08-21 10:54:01 -0600,38828,
2021-08-21 10:54:30 -0600,38829,6.666666666666667
2021-08-21 10:57:10 -0600,38830,
2021-08-21 11:04:01 -0600,38831,
2021-08-21 11:04:34 -0600,38832,7.083333333333334
2021-08-21 11:07:10 -0600,38833,
2021-08-21 11:14:01 -0600,38834,
2021-08-21 11:14:35 -0600,38835,9.583333333333334
2021-08-21 11:17:11 -0600,38836,
2021-08-21 11:24:02 -0600,38837,
2021-08-21 11:24:35 -0600,38838,7.083333333333334
Christopher Stapels
Christopher Stapels on 22 Aug 2021

Generally one device per channel is recommended for this and other reasons.

You can use the MATLAB script to read into a timetable or array and remove the zero entries then make your plot. MATLAB is really good at array manipulation.

Mark Ennamorato
Mark Ennamorato on 22 Aug 2021

thanks i finally did it but not optimized im sure ! what is your suggestion to handle this with a matlab script? i ended up using "insan()" to find where the NaN values were then iterating over the main table using that but there must be a better way !

Mark Ennamorato
Mark Ennamorato on 21 Aug 2021

Hmm i think i know..other devices are posting to this same channel at those other times so it seems thinkSpeakRead reads all timestamps for everything in the channel then populates the data from only the field requested? which seems strange it would do that