Hi,
I'm trying to program in VB one of the keypad "Enter" to display something like "Power On". For exampling, pressing the Enter button on the LCD pad - will display "Power ON" on the screen.
I know that pressing "enter" on the keypad will store a HEX value of 48 in
MSComm1.input. Somehow I can not get it to display on the screen.
Can someone give me a sample code on how to display some text after pressing one of the keypad.
Thanks.
MX product - program keypad in VB
Hi tphuynh,
Thank you for posting at the forums.
Please refer to the link at http://www.lcdforums.com/forums/viewtopic.php?t=1961 to display text. What you may want to try after receiving the character is to use some type of if statement. Ex) If 0x48 is detected, then print a specific screen. What you need to make sure you are doing, when you are trying to receive a character is to put some delay in to give sufficient amount of time for the processor to process the information.
If you have anymore questions or concerns, please feel free to post them.
Best Regards,
Thank you for posting at the forums.
Please refer to the link at http://www.lcdforums.com/forums/viewtopic.php?t=1961 to display text. What you may want to try after receiving the character is to use some type of if statement. Ex) If 0x48 is detected, then print a specific screen. What you need to make sure you are doing, when you are trying to receive a character is to put some delay in to give sufficient amount of time for the processor to process the information.
If you have anymore questions or concerns, please feel free to post them.
Best Regards,
Hi Tom,Tom wrote:Hi tphuynh,
Thank you for posting at the forums.
Please refer to the link at http://www.lcdforums.com/forums/viewtopic.php?t=1961 to display text. What you may want to try after receiving the character is to use some type of if statement. Ex) If 0x48 is detected, then print a specific screen. What you need to make sure you are doing, when you are trying to receive a character is to put some delay in to give sufficient amount of time for the processor to process the information.
If you have anymore questions or concerns, please feel free to post them.
Best Regards,
The link you sent me. I know all of that already. Somehow I can not get the Enter keypad to trigger any display on the screen.
THis is what I have:
If MSComm1.Input = Chr$(&H48) Then
Form1.MSComm1.Output = "Power On"
End If
It's not displaying to the screen. I think I'm missing something, but I can't figure it out. I want this code to fire once the "Enter" keypad is pressed on the MX product. Do I need to put this in a loop?
Another suggestions?
-
- Matrix Orbital
- Posts: 745
- Joined: Thu Dec 13, 2001 4:00 pm
- Location: Earth.... I think..
- Contact:
Code: Select all
Private Sub Form_Load()
MSComm1.Settings = "19200,N,8,1"
MSComm1.CommPort = 3
MSComm1.InputLen = 0
MSComm1.RThreshold = 1
MSComm1.PortOpen = True
End Sub
Private Sub SendText(text As String)
MSComm1.Output = Chr$(&HFE) & Chr$(&H58)
MSComm1.Output = text
End Sub
Private Sub MSComm1_OnComm()
Dim strInput As String
If MSComm1.CommEvent = comEvReceive Then
While (MSComm1.InBufferCount > 0)
strInput = Left(MSComm1.Input, 1) '<---- Evil code here discards all other data in buffer except the first byte
Select Case strInput
Case "D"
SendText "Up"
Case "E"
SendText "Down"
Case "K"
SendText "Left"
Case "C"
SendText "Enter"
Case "J"
SendText "F1"
Case "I"
SendText "F2"
Case Else
SendText "Unknown (" & strInput & ")"
End Select
Wend
End If
End Sub
-
- LCD Guru
- Posts: 55
- Joined: Tue Apr 12, 2005 2:31 am
Hi tphuynh,
You could also try the SDK I wrote (freeware) Should save you a lot of time
You can find it at http://www.jvonk.info/mosdk Also works in VB...
Regards,
Jeroen
You could also try the SDK I wrote (freeware) Should save you a lot of time

Regards,
Jeroen