save to .doc faster or more reliably

I have a timer which over a 4 second period reads values and saves them to a document  at 1000 times per second:
Sadly the document only shows about 130 of those readings
I am using a pentium 266  
Can i without upgrading reach better results?
animazooAsked:
Who is Participating?
 
ShaneCourtrilleConnect With a Mentor Commented:
Okay.. that makes a lil more sense.

I wouldn't be using Text1.Text as my data source.  Sure you can use it to show the user what the current value is but you're best bet is going to be to save your values to an array.. or queue of some kind would probably be better to actually store the values since you could add to it.  This way you can have the timer following (pseduo-code)

Timer2_Timer

If There are Values In My Queue
   Disable Me
   Figure out how many values to write from my queue
   Write Only those values to my queue
   Enable Me
End If

The only problem with this is that while you're writing the values out your code won't be doing its port readings.  Why not just write the values as you read them from the port?
0
 
ShaneCourtrilleCommented:
What kind of code are you using to save to the file?

Are you opening the file at the beginning and keeping it open the entire time?

0
 
animazooAuthor Commented:
ShaneCourtrille
I'm reading values coming in from the lpt port which are coming in at 1000 per second. The code i put in a timer reads the port at a 1000 readings per second
Open ("c:\file.ini") For Output As #1
Print #1, Text1.Text
Close #1
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
animazooAuthor Commented:
to be more accurate What i actually have is
Private Sub Timer2_Timer()
Open ("c:\test.ini") For Append As #1
Print #1, Text1.Text
Close #1
End Sub
0
 
animazooAuthor Commented:
ShaneCourtrille
that makes sense
i will try that  and let you know how i get on tomorrow
Thanks for now
0
 
animazooAuthor Commented:
ShaneCourtrille

before tomorrow
could you kindly give some pointers on writing directly from source to an array or queue?
0
 
ShaneCourtrilleCommented:
Unfortunately I don't have any code which I can provide you with.  There are a few articles on the subject available at DevX.Com under the Visual Basic Programmers Journal area IF you have a membership there.  Otherwise your best bet is going to be to do some searching online and see what people have come up with.  
0
 
animazooAuthor Commented:
ShaneCourtrille
Thanks
0
 
ShaneCourtrilleCommented:
Go check out this for setting up a Linked List:  

http://support.microsoft.com/support/kb/articles/Q166/3/94.asp

You can use this to do queuing.  Add items to the list.. then remove them from it.  You could even add another field (as long as you were only adding to the end of the list) giving a 'stop' point to check against.
0
 
animazooAuthor Commented:
ShaneCourtrille
Your help has put on the scent
0
 
animazooAuthor Commented:
"I feel after reading the above link that i have the answer but now to understand the answer!"
0
 
animazooAuthor Commented:
SimonCourtrille
If I could get to manipualate this part of the queuing

Set head = New Node          
        head.key = 0                
        Set curr = head              
        For i = 1 To 30  
          Set curr.pnext = New Node  
          Set curr = curr.pnext      
          curr.key = i              
        Next i
What i need to do is put my set of approx 4000 figures into this code e.g
For i = 1 to my set of figures?
0
 
DanRollinsCommented:
Hi animazoo,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept ShaneCourtrille@idg's comment(s) as an answer.

animazoo, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
Computer101Commented:
Comment from expert accepted as answer

Computer101
E-E Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.