locked
Chart: Only plot every N data poing from a series RRS feed

  • Question

  • Hi, I have a chart in a panel and only around 100 points are easily visible, after that for column at least, it becomes blocky and unreadable.  I have upto 4 series in each chart, usually only 3.  Each series is the same size with from 200 to 600 data points.  X axis is usually time, 0 to 600 seconds for example or a date.  The problem I have it that whist line chart works fine, column and bar are unreadable. currently is it autoscaling.

    So I need to some how reduce the number of datapouints plotted.  Every 2nd upto 6th data point will still give the overall impression of the shape.  How do I do this ideally without damaging the data series?  Is there a way to loop and write certain points of the series to a chart?

    Friday, April 13, 2018 11:16 AM

All replies

  • Just skip the points ??? ie don't add them to the series. This will plot every fourth point:

       For i As Integer = 0 To max Step 4

           Chart1.Series("Channel 1").Points.AddXY( x(i), y(i) )

       Next


    Or maybe you need to change the values depending on excactly what you are doing.


    In this example every 20th point is plotted and the xaxis scale is recalculated.

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/ccff6fd9-3b36-4aa2-a9d4-ba3a56bae88f/how-to-draw-a-wav-chart-graph-with-real-time-postion-indicator?forum=vbgeneral

    PS The example also has the zoom feature of the chart working. Maybe that will work better for your case again depending on exactly what your constraints are.

    Friday, April 13, 2018 12:04 PM
  • You could use scrollbars too if you wanted such that you could scroll to see all the datapoints.

    Here's some lengthy code that shows the use of scrollbars.

    Option Strict On
    
    Imports System.Windows.Forms.DataVisualization.Charting ' Add reference Assemblies, Framework, System.Windows.Forms.DataVisualization
    
    Public Class Form1
    
        Dim Count As Integer = 0
    
        Dim A1 As Integer = 0
        Dim B1 As Integer = 0
        Dim C1 As Integer = 0
        Dim D1 As Integer = 0
        Dim E1 As Integer = 0
        Dim F1 As Integer = 0
        Dim G1 As Integer = 0
        Dim H1 As Integer = 0
        Dim I1 As Integer = 0
        Dim J1 As Integer = 0
        Dim K1 As Integer = 0
        Dim L1 As Integer = 0
    
        Dim Chart1HorizontalScroll As Integer = 0
    
        Dim DTNow1Count As Integer = 0
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Me.CenterToScreen()
            RichTextBox2.Text = ""
            RichTextBox3.Text = ""
            RichTextBox4.Text = ""
            RichTextBox5.Text = ""
            RichTextBox6.Text = ""
            RichTextBox7.Text = ""
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(-1, 1, "")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(2, 0, "MODEM 6 No State")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(3, 1, "MODEM 6 deconnected")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(5, 1, "MODEM 6 NOK")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(7, 1, "MODEM 6 Sent/Rcvd")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(9, 1, "")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(11, 1, "MODEM  No State")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(13, 1, "MODEM 5 deconnected")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(15, 1, "MODEM 5 NOK")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(17, 1, "MODEM 5 Sent/Rcvd")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(19, 1, "")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(21, 1, "MODEM 4 No State")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(23, 1, "MODEM 4 deconnected")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(25, 1, "MODEM 4 NOK")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(27, 1, "MODEM 4 Sent/Rcvd")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(29, 1, "")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(31, 1, "MODEM 3 No State")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(33, 1, "MODEM 3 deconnected")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(35, 1, "MODEM 3 NOK")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(37, 1, "MODEM 3 Sent/Rcvd")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(39, 1, "")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(41, 1, "MODEM 2 No State")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(43, 1, "MODEM 2 deconnected")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(45, 1, "MODEM 2 NOK")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(47, 1, "MODEM 2 Sent/Rcvd")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(49, 1, "")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(51, 1, "MODEM 1 No State")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(53, 1, "MODEM 1 deconnected")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(55, 1, "MODEM 1 NOK")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(57, 1, "MODEM 1 Sent/Rcvd")
            Chart1.ChartAreas("ChartArea1").AxisY.CustomLabels.Add(59, 1, "")
            Chart1.ChartAreas("ChartArea1").AxisY.Interval = 1
            Chart1.ChartAreas("ChartArea1").AxisY.Maximum = 31
            Chart1.ChartAreas("ChartArea1").AxisY.Minimum = 0
            Chart1.ChartAreas(0).AxisX.ScaleView.Size = 300
            Chart1.ChartAreas(0).AxisX.ScrollBar.Size = 20
            Chart1.ChartAreas(0).AxisX.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll
            Chart1.ChartAreas(0).AxisX.ScrollBar.IsPositionedInside = True
            Chart1.ChartAreas(0).AxisX.ScrollBar.BackColor = Color.Red
            Chart1.ChartAreas(0).AxisX.ScrollBar.ButtonColor = Color.Gray
            Chart1.ChartAreas(0).AxisY.ScaleView.Size = 30
            Chart1.ChartAreas(0).AxisY.ScrollBar.Size = 20
            Chart1.ChartAreas(0).AxisY.ScrollBar.ButtonStyle = ScrollBarButtonStyles.SmallScroll
            Chart1.ChartAreas(0).AxisY.ScrollBar.IsPositionedInside = True
            Chart1.ChartAreas(0).AxisY.ScrollBar.BackColor = Color.LightGray
            Chart1.ChartAreas(0).AxisY.ScrollBar.ButtonColor = Color.Gray
            Chart1.Series("MODEM 1").Color = Color.LimeGreen
            Chart1.Series("MODEM 1").BorderWidth = 5 ' Set the lines width
            Chart1.Series("MODEM 1").IsVisibleInLegend = False
            Chart1.Series("MODEM 2").Color = Color.LimeGreen
            Chart1.Series("MODEM 2").BorderWidth = 5
            Chart1.Series("MODEM 2").IsVisibleInLegend = False
            Chart1.Series("MODEM 3").Color = Color.LimeGreen
            Chart1.Series("MODEM 3").BorderWidth = 5
            Chart1.Series("MODEM 3").IsVisibleInLegend = False
            Chart1.Series("MODEM 4").Color = Color.LimeGreen
            Chart1.Series("MODEM 4").BorderWidth = 5
            Chart1.Series("MODEM 4").IsVisibleInLegend = False
            Chart1.Series("MODEM 5").Color = Color.LimeGreen
            Chart1.Series("MODEM 5").BorderWidth = 5
            Chart1.Series("MODEM 5").IsVisibleInLegend = False
            Chart1.Series("MODEM 6").Color = Color.LimeGreen
            Chart1.Series("MODEM 6").BorderWidth = 5
            Chart1.Series("MODEM 6").IsVisibleInLegend = False
            Timer1.Interval = 1000
            Timer1.Start()
            Timer2.Interval = 1
        End Sub
    
        Private Sub Chart1_DoubleClick(sender As Object, e As EventArgs) Handles Chart1.DoubleClick
            If Chart1HorizontalScroll = 0 Then
                Chart1HorizontalScroll = 1
            Else
                Chart1HorizontalScroll = 0
            End If
        End Sub
    
        Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
            If RichTextBox2.Text = "" And RichTextBox3.Text = "" And RichTextBox4.Text = "" And RichTextBox5.Text = "" And RichTextBox6.Text = "" And RichTextBox7.Text = "" Then
                Timer2.Enabled = False
            Else
                Timer2.Enabled = True
            End If
        End Sub
    
        Dim PicCounter As Integer = 1
    
        Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
    
            Me.Text = "This is picture " & PicCounter.ToString
            Dim Img As New Bitmap(Me.Width, Me.Height)
            Dim FRM1 As Graphics = Graphics.FromImage(Img)
            FRM1.CopyFromScreen(Me.Left, Me.Top, 0, 0, Img.Size)
            Img.Save("C:\Users\John\Desktop\Form1 Images\Form1Image" & PicCounter.ToString & ".Bmp", System.Drawing.Imaging.ImageFormat.Bmp)
            Img.Dispose()
            FRM1.Dispose()
            PicCounter += 1
    
            If Chart1HorizontalScroll = 0 Then
                If Chart1.ChartAreas(0).AxisX.Maximum > Chart1.ChartAreas(0).AxisX.ScaleView.Size Then
                    Chart1.ChartAreas(0).AxisX.ScaleView.Scroll(Chart1.ChartAreas(0).AxisX.Maximum)
                End If
            End If
    
            If G1 = 20 Then
                RichTextBox1.AppendText("MODEM 1 OK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf G1 = 21 Then
                RichTextBox1.AppendText("MODEM 1 NOK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf G1 = 22 Then
                RichTextBox1.AppendText("MODEM 1 deconnected " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf G1 = 23 Then
                RichTextBox1.AppendText("MODEM 1 down " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            End If
            If H1 = 20 Then
                RichTextBox1.AppendText("MODEM 2 OK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf H1 = 21 Then
                RichTextBox1.AppendText("MODEM 2 NOK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf H1 = 22 Then
                RichTextBox1.AppendText("MODEM 2 deconnected " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf H1 = 23 Then
                RichTextBox1.AppendText("MODEM 2 down " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            End If
            If I1 = 20 Then
                RichTextBox1.AppendText("MODEM 3 OK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf I1 = 21 Then
                RichTextBox1.AppendText("MODEM 3 NOK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf I1 = 22 Then
                RichTextBox1.AppendText("MODEM 3 deconnected " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf I1 = 23 Then
                RichTextBox1.AppendText("MODEM 3 down " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            End If
            If J1 = 20 Then
                RichTextBox1.AppendText("MODEM 4 OK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf J1 = 21 Then
                RichTextBox1.AppendText("MODEM 4 NOK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf J1 = 22 Then
                RichTextBox1.AppendText("MODEM 4 deconnected " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf J1 = 23 Then
                RichTextBox1.AppendText("MODEM 4 down " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            End If
            If K1 = 20 Then
                RichTextBox1.AppendText("MODEM 5 OK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf K1 = 21 Then
                RichTextBox1.AppendText("MODEM 5 NOK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf K1 = 22 Then
                RichTextBox1.AppendText("MODEM 5 deconnected " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf K1 = 23 Then
                RichTextBox1.AppendText("MODEM 5 down " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            End If
            If L1 = 20 Then
                RichTextBox1.AppendText("MODEM 6 OK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf L1 = 21 Then
                RichTextBox1.AppendText("MODEM 6 NOK " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf L1 = 22 Then
                RichTextBox1.AppendText("MODEM 6 deconnected " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            ElseIf L1 = 23 Then
                RichTextBox1.AppendText("MODEM 6 down " & DateTime.Now.ToString & vbCrLf & vbCrLf)
                RichTextBox1.ScrollToCaret()
            End If
            If RichTextBox2.Text.Contains("LastReceived ok:") Then
                A1 = 29
            ElseIf RichTextBox2.Text.Contains("NOK") Then
                A1 = 28
            ElseIf RichTextBox2.Text.Contains("deconnected") Then
                A1 = 27
            ElseIf RichTextBox2.Text = "" Then
                A1 = 26
            End If
            If RichTextBox3.Text.Contains("LastReceived ok:") Then
                B1 = 24
            ElseIf RichTextBox3.Text.Contains("NOK") Then
                B1 = 23
            ElseIf RichTextBox3.Text.Contains("deconnected") Then
                B1 = 22
            ElseIf RichTextBox3.Text = "" Then
                B1 = 21
            End If
            If RichTextBox4.Text.Contains("LastReceived ok:") Then
                C1 = 19
            ElseIf RichTextBox4.Text.Contains("NOK") Then
                C1 = 18
            ElseIf RichTextBox4.Text.Contains("deconnected") Then
                C1 = 17
            ElseIf RichTextBox4.Text = "" Then
                C1 = 16
            End If
            If RichTextBox5.Text.Contains("LastReceived ok:") Then
                D1 = 14
            ElseIf RichTextBox5.Text.Contains("NOK") Then
                D1 = 13
            ElseIf RichTextBox5.Text.Contains("deconnected") Then
                D1 = 12
            ElseIf RichTextBox5.Text = "" Then
                D1 = 11
            End If
            If RichTextBox6.Text.Contains("LastReceived ok:") Then
                E1 = 9
            ElseIf RichTextBox6.Text.Contains("NOK") Then
                E1 = 8
            ElseIf RichTextBox6.Text.Contains("deconnected") Then
                E1 = 7
            ElseIf RichTextBox6.Text = "" Then
                E1 = 6
            End If
            If RichTextBox7.Text.Contains("LastReceived ok:") Then
                F1 = 4
            ElseIf RichTextBox7.Text.Contains("NOK") Then
                F1 = 3
            ElseIf RichTextBox7.Text.Contains("deconnected") Then
                F1 = 2
            ElseIf RichTextBox7.Text = "" Then
                F1 = 1
            End If
    
            Dim DTNow1 As String = DateTime.Now.ToString
            Dim DTNow1Split() As String = DTNow1.Split(" "c)
            Chart1.Series("MODEM 1").Points.AddY(A1)
            For Each Point As DataPoint In Chart1.Series("MODEM 1").Points
                If Point.YValues(0) = 29 Then
                    Point.Color = Color.LimeGreen
                ElseIf Point.YValues(0) = 28 Then
                    Point.Color = Color.Red
                ElseIf Point.YValues(0) = 27 Then
                    Point.Color = Color.Orange
                ElseIf Point.YValues(0) = 26 Then
                    Point.Color = Color.Black
                End If
            Next
            Chart1.Series("MODEM 2").Points.AddY(B1)
            For Each Point As DataPoint In Chart1.Series("MODEM 2").Points
                If Point.YValues(0) = 24 Then
                    Point.Color = Color.LimeGreen
                ElseIf Point.YValues(0) = 23 Then
                    Point.Color = Color.Red
                ElseIf Point.YValues(0) = 22 Then
                    Point.Color = Color.Orange
                ElseIf Point.YValues(0) = 21 Then
                    Point.Color = Color.Black
                End If
    
            Next
            Chart1.Series("MODEM 3").Points.AddY(C1)
            For Each Point As DataPoint In Chart1.Series("MODEM 3").Points
                If Point.YValues(0) = 19 Then
                    Point.Color = Color.LimeGreen
                ElseIf Point.YValues(0) = 18 Then
                    Point.Color = Color.Red
                ElseIf Point.YValues(0) = 17 Then
                    Point.Color = Color.Orange
                ElseIf Point.YValues(0) = 16 Then
                    Point.Color = Color.Black
                End If
            Next
            Chart1.Series("MODEM 4").Points.AddY(D1)
            For Each Point As DataPoint In Chart1.Series("MODEM 4").Points
                If Point.YValues(0) = 14 Then
                    Point.Color = Color.LimeGreen
                ElseIf Point.YValues(0) = 13 Then
                    Point.Color = Color.Red
                ElseIf Point.YValues(0) = 12 Then
                    Point.Color = Color.Orange
                ElseIf Point.YValues(0) = 11 Then
                    Point.Color = Color.Black
                End If
            Next
            Chart1.Series("MODEM 5").Points.AddY(E1)
            For Each Point As DataPoint In Chart1.Series("MODEM 5").Points
                If Point.YValues(0) = 9 Then
                    Point.Color = Color.LimeGreen
                ElseIf Point.YValues(0) = 8 Then
                    Point.Color = Color.Red
                ElseIf Point.YValues(0) = 7 Then
                    Point.Color = Color.Orange
                ElseIf Point.YValues(0) = 6 Then
                    Point.Color = Color.Black
                End If
            Next
            Chart1.Series("MODEM 6").Points.AddY(F1)
            For Each Point As DataPoint In Chart1.Series("MODEM 6").Points
                If Point.YValues(0) = 4 Then
                    Point.Color = Color.LimeGreen
                ElseIf Point.YValues(0) = 3 Then
                    Point.Color = Color.Red
                ElseIf Point.YValues(0) = 2 Then
                    Point.Color = Color.Orange
                ElseIf Point.YValues(0) = 1 Then
                    Point.Color = Color.Black
                End If
            Next
    
            Chart1.Series("MODEM 1").Points(DTNow1Count).AxisLabel = DTNow1Split(0) & vbCrLf & DTNow1Split(1) & " " & DTNow1Split(2)
            DTNow1Count = DTNow1Count + 1
    
            G1 = 0
            H1 = 0
            I1 = 0
            J1 = 0
            K1 = 0
            L1 = 0
    
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            If RichTextBox2.Text = "" Then
                RichTextBox2.Text = "LastReceived ok: 1432  / Last sent ok: 2345"
                G1 = 20
            ElseIf RichTextBox2.Text = "LastReceived ok: 1432  / Last sent ok: 2345" Then
                RichTextBox2.Text = "NOK databits"
                G1 = 21
            ElseIf RichTextBox2.Text = "NOK databits" Then
                RichTextBox2.Text = "deconnected"
                G1 = 22
            ElseIf RichTextBox2.Text = "deconnected" Then
                RichTextBox2.Text = ""
                G1 = 23
            End If
        End Sub
    
        Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            If RichTextBox3.Text = "" Then
                RichTextBox3.Text = "LastReceived ok: 1432  / Last sent ok: 2345"
                H1 = 20
            ElseIf RichTextBox3.Text = "LastReceived ok: 1432  / Last sent ok: 2345" Then
                RichTextBox3.Text = "NOK databits"
                H1 = 21
            ElseIf RichTextBox3.Text = "NOK databits" Then
                RichTextBox3.Text = "deconnected"
                H1 = 22
            ElseIf RichTextBox3.Text = "deconnected" Then
                RichTextBox3.Text = ""
                H1 = 23
            End If
        End Sub
    
        Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
            If RichTextBox4.Text = "" Then
                RichTextBox4.Text = "LastReceived ok: 1432  / Last sent ok: 2345"
                I1 = 20
            ElseIf RichTextBox4.Text = "LastReceived ok: 1432  / Last sent ok: 2345" Then
                RichTextBox4.Text = "NOK databits"
                I1 = 21
            ElseIf RichTextBox4.Text = "NOK databits" Then
                RichTextBox4.Text = "deconnected"
                I1 = 22
            ElseIf RichTextBox4.Text = "deconnected" Then
                RichTextBox4.Text = ""
                I1 = 23
            End If
        End Sub
    
        Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
            If RichTextBox5.Text = "" Then
                RichTextBox5.Text = "LastReceived ok: 1432  / Last sent ok: 2345"
                J1 = 20
            ElseIf RichTextBox5.Text = "LastReceived ok: 1432  / Last sent ok: 2345" Then
                RichTextBox5.Text = "NOK databits"
                J1 = 21
            ElseIf RichTextBox5.Text = "NOK databits" Then
                RichTextBox5.Text = "deconnected"
                J1 = 22
            ElseIf RichTextBox5.Text = "deconnected" Then
                RichTextBox5.Text = ""
                J1 = 23
            End If
        End Sub
    
        Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
            If RichTextBox6.Text = "" Then
                RichTextBox6.Text = "LastReceived ok: 1432  / Last sent ok: 2345"
                K1 = 20
            ElseIf RichTextBox6.Text = "LastReceived ok: 1432  / Last sent ok: 2345" Then
                RichTextBox6.Text = "NOK databits"
                K1 = 21
            ElseIf RichTextBox6.Text = "NOK databits" Then
                RichTextBox6.Text = "deconnected"
                K1 = 22
            ElseIf RichTextBox6.Text = "deconnected" Then
                RichTextBox6.Text = ""
                K1 = 23
            End If
        End Sub
    
        Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
            If RichTextBox7.Text = "" Then
                RichTextBox7.Text = "LastReceived ok: 1432  / Last sent ok: 2345"
                L1 = 20
            ElseIf RichTextBox7.Text = "LastReceived ok: 1432  / Last sent ok: 2345" Then
                RichTextBox7.Text = "NOK databits"
                L1 = 21
            ElseIf RichTextBox7.Text = "NOK databits" Then
                RichTextBox7.Text = "deconnected"
                L1 = 22
            ElseIf RichTextBox7.Text = "deconnected" Then
                RichTextBox7.Text = ""
                L1 = 23
            End If
        End Sub
    
    End Class
    


    La vida loca

    Friday, April 13, 2018 4:04 PM