View Single Post
  #6   Spotlight this post!  
Unread 03-01-2013, 10:52
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: best practices for logging sensors?

I finally found time to check this out myself.

I decided to create a binary file and append values inside the loop, in binary.

I added a logging loop to auto, put a delay in the loop, and had parameters for changing the delay, the amount being written, and I charted the loop time so that I could see any glitches. Additionally, I was watching the CPU usage.

I was logging from 10 doubles to 10,000 doubles each iteration with loop delays of from 5ms to 100ms. When logging large amounts of data, I could see some RT glitches. Clip1 shows logging 80kB every 10ms. It shows that the loop was running at a messy 20ms with 60ms glitches due to buffers or flash. The second clip shows saving 8kB each 5ms, pretty clean with similar 60ms glitches. In both cases, CPU usage was still below 50%.

Logging at 20ms was very clean. I logged 8kB and saw one 60ms glitch about every 15 seconds. At 80kB each 20ms, I saw a 60ms glitch every second or so.

While testing I accumulated a single 50MB log file. cRIO CPU impact was certainly reasonable, usually less than 10% additional.

I didn't try using higher level blocks for logging, but see no reason why well written log program should pose any problem. The cRIO is a logging and monitoring platform after all. This is what the cRIO does in its day job at CERN, JPL, etc. -- when it isn't having fun on FIRST robots ; )

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	23
Size:	65.0 KB
ID:	13373  Click image for larger version

Name:	Clipboard 2.png
Views:	22
Size:	50.9 KB
ID:	13374  
Reply With Quote