Asked — Edited

Vb 2008 Get Ping

Can someone help me with my VB 2008 code? I'm trying to read a ping sensor D00, D01. I tried to convert the C# code "Get Ping" to VB 2008 but it is missing to much. I am new to VB and having a difficult time with this. The connect works fine and will work if I put (') in front of the timer. I uploaded a file of my VB code.


ARC Pro

Upgrade to ARC Pro

Get access to the latest features and updates before they're released. You'll have everything that's needed to unleash your robot's potential!

#1  

sorry my code did not show on my question so here it is.

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    '
    'EzB_Connect1
    '
    Me.EzB_Connect1.Location = New System.Drawing.Point(12, 12)
    Me.EzB_Connect1.Name = "EzB_Connect1"
    Me.EzB_Connect1.Port = ""
    Me.EzB_Connect1.ShowDebugButton = True
    Me.EzB_Connect1.Size = New System.Drawing.Size(283, 31)
    Me.EzB_Connect1.TabIndex = 6
    '
    'Form1
    ''
    Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
    Me.ComboBox1 = New System.Windows.Forms.ComboBox()
    Me.Label1 = New System.Windows.Forms.Label()
    Me.Label2 = New System.Windows.Forms.Label()
    Me.ComboBox2 = New System.Windows.Forms.ComboBox()
    Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
    Me.Label3 = New System.Windows.Forms.Label()
    Me.SuspendLayout()
    ' 
    ' progressBar1
    ' 
    Me.ProgressBar1.Location = New System.Drawing.Point(12, 60)
    Me.ProgressBar1.Maximum = 255
    Me.ProgressBar1.Name = "progressBar1"
    Me.ProgressBar1.Size = New System.Drawing.Size(260, 23)
    Me.ProgressBar1.[Step] = 1
    Me.ProgressBar1.TabIndex = 1
    ' 
    ' comboBox1
    ' 
    Me.ComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
    Me.ComboBox1.FormattingEnabled = True

    Me.ComboBox1.Location = New System.Drawing.Point(107, 106)
    Me.ComboBox1.Name = "comboBox1"
    Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
    Me.ComboBox1.TabIndex = 2
    ' 
    ' label1
    ' 
    Me.Label1.AutoSize = True
    Me.Label1.Location = New System.Drawing.Point(39, 109)
    Me.Label1.Name = "label1"
    Me.Label1.Size = New System.Drawing.Size(62, 13)
    Me.Label1.TabIndex = 3
    Me.Label1.Text = "Trigger Port"
    ' 
    ' label2
    ' 
    Me.Label2.AutoSize = True
    Me.Label2.Location = New System.Drawing.Point(47, 136)
    Me.Label2.Name = "label2"
    Me.Label2.Size = New System.Drawing.Size(54, 13)
    Me.Label2.TabIndex = 5
    Me.Label2.Text = "Echo Port"
    ' 
    ' comboBox2
    ' 
    Me.ComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
    Me.ComboBox2.FormattingEnabled = True
    Me.ComboBox2.Location = New System.Drawing.Point(107, 133)
    Me.ComboBox2.Name = "comboBox2"
    Me.ComboBox2.Size = New System.Drawing.Size(121, 21)
    Me.ComboBox2.TabIndex = 4
    ' 
    ' timer1
    ' 
    AddHandler .Timer1.Tick, New System.EventHandler(Me.Timer1_Tick)
    ' 
    ' 
    ' label3
    ' 
    Me.Label3.AutoSize = True
    Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CByte(0))
    Me.Label3.Location = New System.Drawing.Point(80, 187)
    Me.Label3.Name = "label3"
    Me.Label3.Size = New System.Drawing.Size(118, 42)
    Me.Label3.TabIndex = 6
    Me.Label3.Text = "label3"
    ' 
End Sub

End Class