Click here to Skip to main content
15,886,362 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Recommendations on VB.Net to C# code conversion tool Pin
Tim Carmichael26-Sep-14 11:24
Tim Carmichael26-Sep-14 11:24 
GeneralRe: Recommendations on VB.Net to C# code conversion tool Pin
Vipul Mehta27-Sep-14 3:21
Vipul Mehta27-Sep-14 3:21 
QuestionFormatting Excel from Access: How do I apply conditional formatting with a loop? Pin
Member 1111259726-Sep-14 7:29
Member 1111259726-Sep-14 7:29 
AnswerRe: Formatting Excel from Access: How do I apply conditional formatting with a loop? Pin
Chris Quinn28-Sep-14 21:15
Chris Quinn28-Sep-14 21:15 
GeneralRe: Formatting Excel from Access: How do I apply conditional formatting with a loop? Pin
Member 1111259729-Sep-14 7:10
Member 1111259729-Sep-14 7:10 
Questionicacls vbscript - disabling inheritance and removing permissions a security group Pin
Chris Cooper26-Sep-14 3:17
Chris Cooper26-Sep-14 3:17 
AnswerRe: icacls vbscript - disabling inheritance and removing permissions a security group Pin
Eddy Vluggen26-Sep-14 6:03
professionalEddy Vluggen26-Sep-14 6:03 
QuestionPloting xy grapgh on VB Pin
Member 1051522523-Sep-14 20:31
professionalMember 1051522523-Sep-14 20:31 
Dear all,

I am leaner to VB.At present i am trying to get data serially from arduino and plot grapgh time Vs current.I can data serially and print it on text . Now my next process is plotting single line grapgh.
[^]
example show in above link.
I am facing probelm in setting chart permaeter and label them. How to load live data in to chart w.r.t time.

VB
Current working code

Current working code


Imports System
Imports System.IO.Ports
Imports System.ComponentModel
Imports System.Threading

Imports System.Drawing

Public Class Form1
    Dim myPort As Array
    Dim Distance As Integer









    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        myPort = IO.Ports.SerialPort.GetPortNames()
        PortComboBox.Items.AddRange(myPort)
        BaudComboBox.Items.Add(9600)
        BaudComboBox.Items.Add(19200)
        BaudComboBox.Items.Add(38400)
        BaudComboBox.Items.Add(57600)
        BaudComboBox.Items.Add(115200)
        ConnectButton.Enabled = True
        DisconnectButton.Enabled = False
    End Sub

    Private Sub ConnectButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ConnectButton.Click
        SerialPort1.PortName = PortComboBox.Text
        SerialPort1.BaudRate = BaudComboBox.Text
        SerialPort1.Open()
        Timer1.Start()

        'lblMessage.Text = PortComboBox.Text & " Connected."
        ConnectButton.Enabled = False
        DisconnectButton.Enabled = True
    End Sub

    Private Sub DisconnectButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisconnectButton.Click
        SerialPort1.Close()

        DisconnectButton.Enabled = False
        ConnectButton.Enabled = True
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Try
            SerialPort1.Write("c")
            System.Threading.Thread.Sleep(250)
            Dim k As Double
            Dim distance As String = SerialPort1.ReadLine()
            k = CDbl(distance)
            ListBoxSensor.Text = k
        Catch ex As Exception

        End Try



    End Sub

    Private Sub Relay_ON_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Relay_ON.Click
        SerialPort1.Write("1")
    End Sub

    Private Sub Relay_Off_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Relay_Off.Click
        SerialPort1.Write("0")
    End Sub

End Class

QuestionMore than 1 barcode reader in one pc Pin
Member 380289623-Sep-14 19:19
Member 380289623-Sep-14 19:19 
AnswerRe: More than 1 barcode reader in one pc Pin
Bernhard Hiller23-Sep-14 22:01
Bernhard Hiller23-Sep-14 22:01 
AnswerRe: More than 1 barcode reader in one pc Pin
Tino Fourie24-Sep-14 6:40
Tino Fourie24-Sep-14 6:40 
AnswerRe: More than 1 barcode reader in one pc Pin
ZurdoDev24-Sep-14 10:07
professionalZurdoDev24-Sep-14 10:07 
QuestionTextBox Validation Pin
Benniiit23-Sep-14 7:09
Benniiit23-Sep-14 7:09 
AnswerRe: TextBox Validation Pin
JR21223-Sep-14 21:18
JR21223-Sep-14 21:18 
QuestionRemove double spaces in a textbox on keypress Pin
Benniiit20-Sep-14 3:10
Benniiit20-Sep-14 3:10 
AnswerRe: Remove double spaces in a textbox on keypress Pin
Bernhard Hiller21-Sep-14 21:43
Bernhard Hiller21-Sep-14 21:43 
AnswerRe: Remove double spaces in a textbox on keypress Pin
Mycroft Holmes21-Sep-14 22:28
professionalMycroft Holmes21-Sep-14 22:28 
QuestionMultiline text box manipulating Pin
Member 1109601819-Sep-14 17:58
Member 1109601819-Sep-14 17:58 
SuggestionRe: Multiline text box manipulating Pin
Richard MacCutchan19-Sep-14 21:22
mveRichard MacCutchan19-Sep-14 21:22 
GeneralRe: Multiline text box manipulating Pin
Member 1109601819-Sep-14 22:17
Member 1109601819-Sep-14 22:17 
QuestionDirectx 11 and vb6.0 or .net Pin
Otekpo Emmanuel19-Sep-14 12:17
Otekpo Emmanuel19-Sep-14 12:17 
SuggestionRe: Directx 11 and vb6.0 or .net Pin
Richard MacCutchan19-Sep-14 21:24
mveRichard MacCutchan19-Sep-14 21:24 
AnswerRe: Directx 11 and vb6.0 or .net Pin
Dave Kreskowiak20-Sep-14 12:22
mveDave Kreskowiak20-Sep-14 12:22 
Questionhow to convert this VB10 to VB6 Pin
Member 1109056417-Sep-14 16:08
Member 1109056417-Sep-14 16:08 
AnswerRe: how to convert this VB10 to VB6 Pin
Dave Kreskowiak17-Sep-14 17:14
mveDave Kreskowiak17-Sep-14 17:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.