I don't quite get it. Where's the 'ScreenManager' sub? What's the 'ms_oncomm' subroutine?
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
CF Tech said:We put together a small Visual Basic program to demonstrate sending packets to the CFA-631.
http://www.crystalfontz.com/backlight/VB_631/CFA_631_Basic_Demo.zip
The code could also be modified to work with the CFA-633 with only minimal changes.
Knight said:it not working. the if statement keeps skiping the If statement....Code:Public Sub PacketAnalyzer(Packet) Dim SplitPacket() As String SplitPacket = Split(Packet, " ") If SplitPacket(0) = "128" Then Select Case SplitPacket(2) Case "1" 'Key Up Pressed 'Do this when key up is pressed Case "2" 'Key Down Pressed 'Do this when key down is pressed Case "3" 'Key Left Pressed 'Do this when key down is pressed Case "4" 'Key Right Pressed 'Do this when key right is pressed Case "5" 'Key Enter Pressed 'Do this when key enter is pressed Case "6" 'Key Cancel Pressed 'Do this when Cancel key is pressed Case "7" 'Key Up Released 'Do this when Key Up is released Case "8" 'Key Down released 'Do this when key down is released Case "9" 'Key left released 'Do this when key left is released Case "10" 'Key right released 'Do this when key right is released Case "11" 'Key Enter released 'Do this when enter key is released Case "12" 'Key Cancel released 'Do this when Cancel key is released End Select End If
is the Packet variable really suppost to equal "€cá"?
im using the 633 btw
i found out whats wrong...the msComm returns the data as a string... at least i think so... if i place at the begining of the PacketAnalyzer:
Packet = Asc(Packet) then Packet becomes 128, exactly what the if statement is looking for.
The problum now:
SplitPacket(2) = subscript out of range
im pritty sure this means that SplitPacket(2) doesnt exist...and, since i have never seen the "Split" command before and MSDN's help on it makes no sence...i dont know how to fix it.
any help?
The way the packet analyzier works is the following:i found out whats wrong...the msComm returns the data as a string... at least i think so... if i place at the begining of the PacketAnalyzer:
Packet = Asc(Packet) then Packet becomes 128, exactly what the if statement is looking for
the problum now:
SplitPacket(2) = subscript out of range
im pritty sure this means that SplitPacket(2) doesnt exist...and, since i have never seen the "Split" command before and MSDN's help on it makes no sence...i dont know how to fix it.
CF Tech said:> . . . all thats there is 128. . .
Which is correct for the first character. What happens if you put in multiple "MsgBox (Asc(ComPortData))" ?