Click here to Skip to main content
15,913,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: salam Pin
javad andamani5-Jan-11 20:41
javad andamani5-Jan-11 20:41 
GeneralRe: salam Pin
Keith Barrow5-Jan-11 21:31
professionalKeith Barrow5-Jan-11 21:31 
GeneralRe: salam Pin
Pete O'Hanlon5-Jan-11 22:17
mvePete O'Hanlon5-Jan-11 22:17 
GeneralRe: salam Pin
fjdiewornncalwe6-Jan-11 16:17
professionalfjdiewornncalwe6-Jan-11 16:17 
AnswerRe: salam Pin
katayoonkadri13655-Jan-11 17:41
katayoonkadri13655-Jan-11 17:41 
GeneralRe: salam Pin
OriginalGriff5-Jan-11 20:47
mveOriginalGriff5-Jan-11 20:47 
GeneralRe: salam Pin
JOAT-MON6-Jan-11 12:12
JOAT-MON6-Jan-11 12:12 
QuestionStreaming real-time data to a file - recommendations? [modified] Pin
Wjousts5-Jan-11 8:11
Wjousts5-Jan-11 8:11 
I have an app that reads data from a sensor, displays the last 60 seconds or so on as a graph and has some other events that need to happen at specific timings. Currently I'm only storing the last 60 seconds of data at any one time in order to stop it from consuming increasing amounts of memory.
However, I now need to think about persisting the data to a file as it's collected and I'm looking for any recommendations on best practice for this. It is very important that the writing to file doesn't interfere with reading data from the sensor and the timing of other events (which are trigger using Theading.Timer) as much as possible. In other words, I don't want disk access to delay processing of data coming from the sensor or to delay running the Timer's delegate method when the timer is up. Or in other, other words, the writing to disk should be very low priority.
The data coming from the sensor isn't particularly fast, it's about 7Hz and what I need to store is the time since the start of recording (in seconds, stored as a double) and the value from the sensor (also a double). I could easily see an hour of data being collected at one time which I (very) roughly estimate as being about 1.5 Mb of raw data. Ultimately this would need to be saved in a human readable format (or at least an Excel importable format) maybe tab delimited text, so the file size on disk would be several times bigger.
So any thoughts? Recommendations? Am I better off trying to store as much as possible in memory and then only write to disk when recording ends? Or is it better to try and write pieces as it's collected?

[edit: typo in topic title]

modified on Wednesday, January 5, 2011 3:39 PM

AnswerRe: Steaming real-time data to a file - recommendations? Pin
Luc Pattyn5-Jan-11 8:34
sitebuilderLuc Pattyn5-Jan-11 8:34 
GeneralRe: Steaming real-time data to a file - recommendations? Pin
Wjousts5-Jan-11 9:48
Wjousts5-Jan-11 9:48 
GeneralRe: Steaming real-time data to a file - recommendations? Pin
Luc Pattyn5-Jan-11 9:52
sitebuilderLuc Pattyn5-Jan-11 9:52 
QuestionRe: Steaming real-time data to a file - recommendations? Pin
Paladin20005-Jan-11 10:11
Paladin20005-Jan-11 10:11 
AnswerRe: Steaming real-time data to a file - recommendations? Pin
Luc Pattyn5-Jan-11 10:24
sitebuilderLuc Pattyn5-Jan-11 10:24 
GeneralRe: Steaming real-time data to a file - recommendations? Pin
Paladin20005-Jan-11 10:35
Paladin20005-Jan-11 10:35 
GeneralRe: Steaming real-time data to a file - recommendations? Pin
Luc Pattyn5-Jan-11 10:47
sitebuilderLuc Pattyn5-Jan-11 10:47 
GeneralRe: Steaming real-time data to a file - recommendations? Pin
Wjousts6-Jan-11 3:57
Wjousts6-Jan-11 3:57 
AnswerRe: Steaming real-time data to a file - recommendations? Pin
Luc Pattyn6-Jan-11 4:05
sitebuilderLuc Pattyn6-Jan-11 4:05 
GeneralRe: Steaming real-time data to a file - recommendations? Pin
Wjousts6-Jan-11 11:49
Wjousts6-Jan-11 11:49 
AnswerRe: Steaming real-time data to a file - recommendations? Pin
Wjousts6-Jan-11 3:57
Wjousts6-Jan-11 3:57 
AnswerRe: Streaming real-time data to a file - recommendations? Pin
Kythen6-Jan-11 9:16
Kythen6-Jan-11 9:16 
GeneralRe: Streaming real-time data to a file - recommendations? Pin
Wjousts6-Jan-11 11:52
Wjousts6-Jan-11 11:52 
AnswerRe: Streaming real-time data to a file - recommendations? Pin
jschell6-Jan-11 9:21
jschell6-Jan-11 9:21 
GeneralRe: Streaming real-time data to a file - recommendations? Pin
Wjousts6-Jan-11 11:55
Wjousts6-Jan-11 11:55 
AnswerRe: Streaming real-time data to a file - recommendations? Pin
carbon_golem7-Jan-11 5:14
carbon_golem7-Jan-11 5:14 
Questioncall an opener form method Pin
mabrahao5-Jan-11 3:17
mabrahao5-Jan-11 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.