|
|
 | | From: | johnsold | | Subject: | Re: How can I add new values only to a column of a spreadsheet? | | Date: | Wed, 19 Jan 2005 10:40:17 -0600 (CST) |
|
|
 | I think your three loops solution is probably better than putting different= kinds of functions into one loop. Keeping data acquisition/generation sep= arate from file i/o is usually better because the OS can interfere with tim= ing on the file operations.
If you pass the data to the file loop vi= a queues, place the data into shift registers, and only write to the file w= hen you have equal amounts of data from each generator you should be able t= o keep things synchronized. You can write larger or smaller amounts as nec= essary to keep pace with the generators. If one of the generators gets way= ahead of the other, you have to decide how to deal with that issue.
>Writing to the second column of a three column spreadsheet can be tricky. = It involves keeping pointers to the portions written and not written, read= ing the entire file into memory and overwriting the cells where new data go= es and rewriting the entire file. This can get very slow for large files. = If the file and data structures are simple enough it might be feasible to = read only a portion of the file and overwrite it with new data, but that ap= proach has lots of risks to the data.
Wait until next ms multiple is= only reliable if the wait interval is sufficiently longer than the executi= on time (including random OS delays) of each loop. Look at the synchroniza= tion functions such as notifiers to synchronize your loops.
If you s= till have problems, post a simplified version of your program and someone w= ill probably be able to suggest solutions.
Lynn
|
|
|