Author Topic: Visual Basic - Real time graphing  (Read 4450 times)

0 Members and 1 Guest are viewing this topic.

Offline Kryptonite

  • /dev/null
  • *
  • Posts: 16
  • Cookies: 0
    • View Profile
Visual Basic - Real time graphing
« on: August 31, 2013, 01:47:36 pm »
Good day guys,


I am currently working with VB 2010, and am to receive values via RS232 communication, and plot these received values in a real time graph.


I have searched the net, but I cannot seem to narrow down on a proper tutorial or explanation on how to achieve this.


Would anybody here be able to help or explain what needs to be done?


Thanks in advance

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Visual Basic - Real time graphing
« Reply #1 on: August 31, 2013, 08:38:00 pm »
Do you HAVE to use VB? It would be easier in Python.
http://pyserial.sourceforge.net/
Used this once, worked great: http://matplotlib.org/
« Last Edit: August 31, 2013, 08:38:13 pm by Kulverstukas »

Offline Kryptonite

  • /dev/null
  • *
  • Posts: 16
  • Cookies: 0
    • View Profile
Re: Visual Basic - Real time graphing
« Reply #2 on: September 01, 2013, 09:27:48 am »
I'm not forced to use VB, but that's what I'm familiar with, because I still have to create a GUI and perform several other functions and interact with databases. If I use Python, I'll have to learn the language first

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Visual Basic - Real time graphing
« Reply #3 on: September 01, 2013, 10:16:42 am »
You'll end up making it in Python faster than VB either way. I'd go with python if I were you.

Offline ArkPhaze

  • Peasant
  • *
  • Posts: 136
  • Cookies: 20
  • null terminated
    • View Profile
Re: Visual Basic - Real time graphing
« Reply #4 on: November 01, 2013, 02:56:58 am »
In the event that he can't go with Python... What kind of graph are you looking for @OP? It's easy enough to create a custom graph control using GDI in .NET. I've made a few of them already. But there are chart controls already available to you.
« Last Edit: November 01, 2013, 02:57:31 am by ArkPhaze »
sig=: ArkPhaze

[ J/ASM/.NET/C/C++ - Software Engineer ]

Offline Kryptonite

  • /dev/null
  • *
  • Posts: 16
  • Cookies: 0
    • View Profile
Re: Visual Basic - Real time graphing
« Reply #5 on: December 02, 2013, 11:12:26 pm »
I was able to use a few chart controls built into the VB environment. If anybody needs any help with a similar problem in the future, contact me and I shall provide my code and project

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Visual Basic - Real time graphing
« Reply #6 on: December 03, 2013, 05:26:46 am »
I was able to use a few chart controls built into the VB environment. If anybody needs any help with a similar problem in the future, contact me and I shall provide my code and project
And why not share it now?

Offline Kryptonite

  • /dev/null
  • *
  • Posts: 16
  • Cookies: 0
    • View Profile
Re: Visual Basic - Real time graphing
« Reply #7 on: December 03, 2013, 03:30:07 pm »
The goal of the project attached was to:
- receive information in the form of a string via serial communication
- extract the various readings
- plot and display a real time graph
- and to save various values into a database


Use it as you will, but please make sure not to include any of the names in the project


(it may not work if the database directory isn't corrected)

Offline ArkPhaze

  • Peasant
  • *
  • Posts: 136
  • Cookies: 20
  • null terminated
    • View Profile
Re: Visual Basic - Real time graphing
« Reply #8 on: December 10, 2013, 03:59:58 am »
IMO you should be using more features of the language to write such a project. Arrays, etc... All you have is repeated code, a bunch of forms, single letter variables, a lack of loops that would've been valuable in more than several cases, and more. Where's your separation of concerns?

Functions? Classes?  ???
sig=: ArkPhaze

[ J/ASM/.NET/C/C++ - Software Engineer ]