Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Data Logging question with high speed!!!!

Status
Not open for further replies.

cubdh23

New Member
Hi, I was posting questions for my project couple weeks ago, i took a break and now i want to finish it. I got tons of help from here but i have a problem. Im logging data from a microcontroller to VB and export it to Excell. I have a 2 part question. Question #1 Im fulling up rows at a rate of 160 rows per sec. The problem is that the rows dont fill up that fast and if transmit for 10 secs which means 1600 rows. It takes like 20 more secs for all the rows to fill with data even though i stopped transmitting 20 secs ago. No data is lost but im guessing there is a lag when u transport from VB to excell. Any ideas on how to speed up this process????? Question number #2 which is the more important question.
Any ideas how to pre program the excell columns so that for example if i import the numbers i want the columns to perform specific calculations on the values. Like if i want to multiply all the values by 3. How do i write an equation that automatically lets excell do that. Rather than each time i manually do it in excell??
Thanks for the help
Prior pitches tomarrow
:)
 
Yes, VB is slow isn't it...
Did you try making a large enough buffer in VB (1600 spaces) and do nothing but receive data and store it in the buffer (without sending it to excell). Once everything is received send it to excell. This way you won't lose any data.
 
Naw VB is slow but it isnt that slow. Iv done experiements with it that slows that VB handles baud rates of 9600 easily and you dont even need a buffer and it doesnt lose any data. This is where the problem comes. Last night i have played with the code enough that i have narrowed down where the problem is but i dont know how to fix it.
This is what i am doing. I get 6 ascii values of data at a time from the microcontroller Ram. I send this to VB then send this to excel, for everytime i do this i want 3 characters to go in row A1 and the other 3 to go in B1 of excel, then everytime i get data it fills the row beneath it.
This is the way i do it with " hight" being greater 3 bytes and " low" being lower 3 bytes and i increment row each time i get data
oSheet.Cells(1, 1).Value = "Force"
oSheet.Cells(1, 2).Value = "Presure"
oSheet.Cells(1, 3).Value = "Flag"

' Add Data
oSheet.Cells(row, 1).Value = hight
oSheet.Cells(row, 2).Value = low

This method puts them in their respective rows but it is very slow.
I want to get 100 data per second, but the rows in excell only fill up at 17 rows per second creating tons of problems. This way excell uses 98% -100% of system resources. I tried something else because i figured each time excel needs to figure out which row to put the data, it takes a lot of time to figure this out so
Print comEvReceive
' s = g_s6 + "\" + g_s5 + ".xls"
' Open s For Append As #1
' Print #1, hight & " " & low; "
' Close #1

When i do it this way, The system works extremely fast and there is absolutely no lag. IT fills the row with the data values. The problem is if i do it this way how can i get " hight" to go to A1 and low to go in B1
both goes into A1. If i can figure this out, i can do it this way.
Please i really am stuck here and i need to get this over with. thanks
BTW g_s6 and G_s5 is just location and filename that the user will enter.
 
If you Have VB dump the data into a comma delimited file and then open it with excel it when you're done gathering data might be faster than adding the data a feild at a time. There is a standard comma delimited format and extension that is a recognized as an excel file. You should be able to google for it.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top