PR27 GUI... Need Guidance...
Posted: Sat Apr 02, 2011 5:16 pm
Greetings,
I'm a newbie in this uC field. I just got my PR27 Multi UART board. 1st I try using Cytron's GUI program and everything working fine. Then I try to build my own GUI program using VB6 and have a bit difficulties. Based on the original PR27 source code, to control the led needed the board to receive 2 bytes. So I did try to send 2 byte using VB6 (according to the required data on the PR27 source code). Before I test directly to the board, I did check the transmitted signal (using hyperterminal on another laptop) and everything seems to be sent correctly (I guess). But when I connect to the board, it seems does not react with my VB. Below are the source code, which I hope uC expert here can help me.
Thanks.
MSCOMM Settings
DTREnable : False
EOFEnable : False
Handshaking : 0 - comNone
InBufferSize : 1024
InputLen : 1
InputMode : 0 - comInputModeText
NullDiscard : False
OutBufferSize : 512
ParityReplace : ?
RThreshold : 1
RTSEnable : False
Settings : 9600,n,8,1
SThreshold : 1
VBProgram
Private Sub Form_Load()
MSComm1.PortOpen = True
End Sub
____________________________________________________________________
Private Sub Command2_Click()
If Command2.Caption = "LED 1 On" Then
MSComm1.Output = "1" & "0"
Command2.Caption = "LED 1 Off"
ElseIf Command2.Caption = "LED 1 Off" Then
MSComm1.Output = "1" & "1"
Command2.Caption = "LED 1 On"
End If
End Sub
I'm a newbie in this uC field. I just got my PR27 Multi UART board. 1st I try using Cytron's GUI program and everything working fine. Then I try to build my own GUI program using VB6 and have a bit difficulties. Based on the original PR27 source code, to control the led needed the board to receive 2 bytes. So I did try to send 2 byte using VB6 (according to the required data on the PR27 source code). Before I test directly to the board, I did check the transmitted signal (using hyperterminal on another laptop) and everything seems to be sent correctly (I guess). But when I connect to the board, it seems does not react with my VB. Below are the source code, which I hope uC expert here can help me.
Thanks.
MSCOMM Settings
DTREnable : False
EOFEnable : False
Handshaking : 0 - comNone
InBufferSize : 1024
InputLen : 1
InputMode : 0 - comInputModeText
NullDiscard : False
OutBufferSize : 512
ParityReplace : ?
RThreshold : 1
RTSEnable : False
Settings : 9600,n,8,1
SThreshold : 1
VBProgram
Private Sub Form_Load()
MSComm1.PortOpen = True
End Sub
____________________________________________________________________
Private Sub Command2_Click()
If Command2.Caption = "LED 1 On" Then
MSComm1.Output = "1" & "0"
Command2.Caption = "LED 1 Off"
ElseIf Command2.Caption = "LED 1 Off" Then
MSComm1.Output = "1" & "1"
Command2.Caption = "LED 1 On"
End If
End Sub