PR27 GUI... Need Guidance...

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

PR27 GUI... Need Guidance...

Postby xretiprogram » 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
xretiprogram
Greenhorn
 
Posts: 2
Joined: Sat Apr 02, 2011 4:17 pm

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

Postby sich » Mon Apr 04, 2011 1:53 pm

Did you specify the PortName (COM number) in your VB6 program? Which com port are you connecting to?
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

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

Postby xretiprogram » Mon Apr 04, 2011 3:48 pm

Yup, already declared the com port.
I'm using COM1.
xretiprogram
Greenhorn
 
Posts: 2
Joined: Sat Apr 02, 2011 4:17 pm

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

Postby sich » Thu Apr 07, 2011 10:52 am

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");
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm


Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 13 guests

cron