Reseller
 
Serial Display Module - Visual Basic Examples

It is easy to send ASCII string to our display modules. Microsoft Comm Control is use to communicate with the LCD/LED display

  • Start a new exe project
  • Add MSComm control
  • Set the MSComm.Setting to match the display module setting
  • Send the data according to the protocol in the User's Manual

All source code is documented and downloadable.

Example 1 : Sending 4 Characters ASCII string to SC4Dlite

 

This project shows how to send ASCII text in the Textbox to SC4Dlite module. ( VB6.0 )

Dim s As String

Dim uid As Byte

' Fill up with spaces so that it is always 4 bytes

If Len(txtASCII) < 4 Then
txtASCII = txtASCII & Space(4 - Len(txtASCII))
End If

MSComm1.Output = Chr(uid) & "b" & txtASCII ' Send the Display ASCII command

Example 1 VB6.0 source code here.
       

Example 2: Display computer time on SC4Dlite and blink decimal point 3 as column LED

This project use Timer2 with 500 ms interval to turn on and off decimal point 3 which as as the clock column LED.Time information is send to the SC4Dlite every 1 minute.

 

Code to send time info

Private Sub Send_Time_Info()

MSComm1.Output = Chr(uid) & "b" & Left(lblTime, 2) & Right(lblTime, 2) ' Send time info to SC4Dlite

End Sub

Code to blinks decimal point

Private Sub Timer2_Timer()

column = column Xor 4

MSComm1.Output = Chr(uid) & "c" & Chr(column) ' Blink Decimal point 3 as clock column

If Second(Now) = 0 Then ' Update time display every 1 minute
lblTime = FormatDateTime(Time, vbShortTime) ' Display current time on lblTime
Timer1.Enabled = True ' Add 20ms delay
While dflag <> True
DoEvents
Wend
Send_Time_Info ' before next command
dflag = False
End If

End Sub

Example2 VB6.0 source code here      
       
 
Copyright© SILICON CRAFT 2006