Page 1 of 1

PR27 GUI... Need Guidance...

PostPosted: Sat Apr 02, 2011 5:16 pm
by xretiprogram
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

Re: PR27 GUI... Need Guidance...

PostPosted: Mon Apr 04, 2011 1:53 pm
by sich
Did you specify the PortName (COM number) in your VB6 program? Which com port are you connecting to?

Re: PR27 GUI... Need Guidance...

PostPosted: Mon Apr 04, 2011 3:48 pm
by xretiprogram
Yup, already declared the com port.
I'm using COM1.

Re: PR27 GUI... Need Guidance...

PostPosted: Thu Apr 07, 2011 10:52 am
by sich
Please note that the data to be sent from PC to PR27 should be decimal code, not ASCII.
For example in VB.net (I've never use VB6 before): SerialPort.Write(1);
NOT SerialPort.Write("1");