LEDND Sample Program

When Using the Command

Control commands can be sent from the program and displayed on the LEDND. This is a sample program to display on LEDND from Visual Basic 2019. Before running the program, please check the configured connection mode using the LEDND configuration utility.
Before running the program, check the connection mode using the LEDND configuration utility.
You can download the complete program here.
  • Select “USB COM” or “Wireless LAN” as the connection method
  • Press "Display", "1,234,567" is displayed on the LEDND
  • Press "Clear" to clear the LEDND display
Sample screen when executed from LEDND VisualBasic

Imports System.IO
Imports System.Net.Http

Public Class LEDNDSample

  'When the display button is pressed
  Private Sub BtnDisp_Click(sender As Object, e As EventArgs) Handles BtnDisp.Click
    SendData("1,234,567")
  End Sub

  'When the clear button is pressed
  Private Sub BtnClear_Click(sender As Object, e As EventArgs) Handles BtnClear.Click
    SendData("")
  End Sub

  'Execute communication
  'When incorporating into a practical program, please incorporate error handling etc.
  Private Sub SendData(ByVal msg As String)
    Dim ret As Integer = 0
    Dim sendData As String = ""

    If RadioUSB.Checked Then

      'For USBCOM

      'If the serial port number is COM1
      SerialPort1.PortName = "COM1"
      SerialPort1.BaudRate = 115200
      SerialPort1.Parity = IO.Ports.Parity.None
      SerialPort1.DataBits = 8
      SerialPort1.StopBits = IO.Ports.StopBits.One
      SerialPort1.Handshake = Ports.Handshake.RequestToSend

      If msg = "" Then
          'Clear display
          sendData = Chr(&HC)
      Else
          'Display
          sendData = msg
      End If

      SerialPort1.Open()

      'Data Transmission
      SerialPort1.Write(sendData)

      SerialPort1.Close()

    ElseIf RadioWiFi.Checked Then

      'For Wireless LAN

      'If the IP address of LEDND is 192.168.1.250
      Dim url As String = "http://192.168.1.250/disp/"

      If msg = "" Then
          'Clear Display
          sendData = url + "%0C"
      Else
          'Display
          sendData = url + msg
      End If

      'Data Transmission
      SendByHttp(sendData)

    End If
End Sub

' HTTP Communication Processing
Private Async Sub SendByHttp(ByVal url As String)
  Dim sendUrl As Uri = New Uri(url)
  Dim html As String = ""

  Using httpcl As New HttpClient()
      html = Await httpcl.GetStringAsync(sendUrl)
  End Using

End Sub