• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Real-Time Data Plot in VB 2008

I'm writing a data acquisition program in VB 2008 Express. The program essentially sends commands to a controller and the controller runs internal programs and throws a lot of data back at my computer. I would like to sample this data every 100 ms or so and put it in a plot so I can follow the data more easily, since I'm monitoring 16 variables at a time.

In its current form, I'm doing this by simply updating a progress bar based on the value of the variables. This doesn't give me any history of the variable, however, which would be really helpful for my application. It looks like all of the VB plotting tools from VB6 no longer work, so I was wondering if anyone had any suggestions/ideas. Current code is basically the following:

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Try
ProgressBar1.Value = Data1
ProgressBar2.Value = Data2
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

where the timer executes at a user-specified interval (e.g. 100 ms) and "Data1" and "Data2" are the data of interest.
 
Did you check CodeProject.com for a VB.Net plotting library?

For a graph plot you'd want to have set up array of N values (blank at first), then once it's full you shift left 1 to make room for the newest value.


 
GDI+, perhaps? Get a reference to the graphics object of the relevant form from the onpaint event, store it and use that for some graphing?
 
Back
Top