serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
Go Back  Xtreme Visual Basic Talk > > > serial communication VB 6 to basic stamp


Reply
 
Thread Tools Display Modes
  #1  
Old 05-24-2009, 11:21 PM
gregory123 gregory123 is offline
Newcomer
 
Join Date: May 2009
Posts: 1
Default serial communication VB 6 to basic stamp


Hi all, i am working on a project that need serial communication from my pc to my basic stamp microcontroller. I have followed instructions on how to code it on VB and on the stamp. But after compiling, there is no error, but nothing happends, and the data i want to send is not sent. Here is my code:


Private Sub Form_load()
MSComm1.CommPort = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.DTREnable = False
MSComm1.PortOpen = True

End Sub


Private Sub Command1_Click()
Dim inputValue As Long

inputValue = cmdInput.Text

MSComm1.Output = Chr$(255) & Chr$(inputValue)
End Sub

Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False
End Sub


I am using a BS2sx stamp microcontroller, and here is my code :

inputValue VAR Word
Main:
SERIN 1,240,[WAIT(255),inputValue]
PULSOUT 1,inputValue
PAUSE 20

END

I know that the maximum number that could be sent through the serial is 255, but even if i send a number like 50, the servo motor is supposed to turn (tried with other codes). But i think i am missing out something to enable the serial communication to actually work. I hope someone can help me with this problem.
Reply With Quote
  #2  
Old 05-28-2009, 06:38 AM
Marc van Eck Marc van Eck is offline
Newcomer
 
Join Date: Feb 2009
Location: South Africa
Posts: 1
Smile serial communication VB 6 to basic stamp

Hi,
Just a question, but does the BS2sx stamp microcontroller not need a line/command terminator? Like a carriage return?

I would try adding this to your output command.
E.G.
MSComm1.Output = Chr$(255) & Chr$(inputValue) & vbcr

Also, make sure that your mscomm object is set correctly for data transfer, I.E.
if there is handshaking protocol needed for the stamp, set the mscomm object to match.(Make sure your data cable has all the wires in it to perform this)

If there is no handshaking required, set the mscomm object handshaking to none. (Only TX data, RX data and Earth is needed in cable)

Have you tried using hyperterminal to check that you can actually communicate with it first?

Sorry if these questions seem obvious, but these things trip us up sometimes.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
 
serial communication VB 6 to basic stamp
serial communication VB 6 to basic stamp
 
-->