?
Solved

save to .doc faster or more reliably

Posted on 2001-06-11
14
Medium Priority
?
174 Views
Last Modified: 2010-05-02
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?
0
Comment
Question by:animazoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 1

Expert Comment

by:ShaneCourtrille
ID: 6177932
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
 

Author Comment

by:animazoo
ID: 6177968
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
 

Author Comment

by:animazoo
ID: 6178047
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
ShaneCourtrille earned 400 total points
ID: 6178184
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
 

Author Comment

by:animazoo
ID: 6178233
ShaneCourtrille
that makes sense
i will try that  and let you know how i get on tomorrow
Thanks for now
0
 

Author Comment

by:animazoo
ID: 6178246
ShaneCourtrille

before tomorrow
could you kindly give some pointers on writing directly from source to an array or queue?
0
 
LVL 1

Expert Comment

by:ShaneCourtrille
ID: 6178297
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
 

Author Comment

by:animazoo
ID: 6178312
ShaneCourtrille
Thanks
0
 
LVL 1

Expert Comment

by:ShaneCourtrille
ID: 6178680
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
 

Author Comment

by:animazoo
ID: 6179037
ShaneCourtrille
Your help has put on the scent
0
 

Author Comment

by:animazoo
ID: 6180321
"I feel after reading the above link that i have the answer but now to understand the answer!"
0
 

Author Comment

by:animazoo
ID: 6180732
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 7135880
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
 
LVL 1

Expert Comment

by:Computer101
ID: 7168345
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question