Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/21/05 22:07
Read: times


 
#88094 - Serial Comms and Visual Basic
Responding to: ???'s previous message
As I look through this thread, I notice there is no mention that you have to add the control to the form and then set up the port prior to using it. You need to open it, set the baud rate plus a whole bunch of other options.

Your setup should look something like

With UserForm1.MSComm1
.CommPort=1
.Handshaking=comNone
.Settings= "4800,N,8,1"
.InputMode=comInputModeBinary
.InputLen=1
.RThreshold=1
.DTREnable=True
.RTSEnable=False
End With

etc. Have you done this?

The best coverage of the topic I found to be in Jan Axelson's book "Serial Port Complete". I used it for the basis of two of the chapters of my book "Excel by Example : A Microsoft Excel Cookbook for Electronics Engineers". (Please forgive me if you consider this advertising- I won't go into unrelated details on the book. I am new to the forum and I am not sure of my manners yet.) The two chapters actually cover using the serial port within Excel and interfacing to electronics instrumentation, but it is in Visual Basic and the details are applicable to VB as well as VBA.

I also found some good information at this URL
http://www.yes-tele.com/vb.html
There is also quite a bit of documentation in the VB help file although I am not sure if it shows up if the VB control is not installed.


List of 24 messages in thread
TopicAuthorDate
8051 <-> RS232 comunication            01/01/70 00:00      
   VB to Microcontroller            01/01/70 00:00      
      Very Informative!            01/01/70 00:00      
         Language(s)?            01/01/70 00:00      
            Languages            01/01/70 00:00      
   Line buffering?            01/01/70 00:00      
      furthermore Russell Bull            01/01/70 00:00      
      Line buffering            01/01/70 00:00      
         buffer            01/01/70 00:00      
            Serial Comms and Visual Basic            01/01/70 00:00      
               Another URL            01/01/70 00:00      
                  MSComm config            01/01/70 00:00      
                     More on VB setup            01/01/70 00:00      
                        VB Setup            01/01/70 00:00      
                           Code for 8051/VB            01/01/70 00:00      
                              Thank you            01/01/70 00:00      
   MSDN            01/01/70 00:00      
   Flush your buffers            01/01/70 00:00      
   Stu            01/01/70 00:00      
      REN ???            01/01/70 00:00      
         REN !!            01/01/70 00:00      
   Hardware/software            01/01/70 00:00      
      Got a MAX232 or 1488/9 chip?            01/01/70 00:00      
         MAX232 and oscilloscope            01/01/70 00:00      

Back to Subject List