blossalvador,
Before you can connect two devices together you also have to make certain that both terminals are configured for the same Baud Rate, Number Of Stop Bits, Number Of Data Bits and Parity Bits. With this not set right, Baud rate mismatch, data mismatch or parity error can occur. This is done with the VB code.
Also make certain that both ports are open when attempting to TX and RX.
Code Examples:
'Set the parameters for the port each port will be the same
'Same form_load for each machine
Private Sub Form_Load()
Dim Data As Long
MSComm1.CommPort = 1 'select your com port
MSComm1.Settings = "9600,n,8,1" 'this must be configured to your specifications
'9600 is the baud rate, n is no parity bits, 8 data bits and 1 stop bit
MSComm1.PortOpen = True 'opens the port
End Sub
'To read data from the port on a mouse click
Private Sub readData_Click()
data = MSComm1.input
End Sub
'Or, Use a OnComm to Continuously poll the port.
Private Sub MSComm1_OnComm()
Dim buffer As Variant
Select Case MSComm1.CommEvent
Case comEvReceive
buffer = MSComm1.Input
Text1.Text = Text1.Text & buffer
End Select
End Sub
You might also have to use a Null Modem Cable. The null modem is connected to facilitate the connection of 2 "DTE" or 2 "DCE". The null modem simulated the "handshaking" signals output by a serial connection. The cable wiring is important, here is some info on that:
http://www.loop-back.com/n
http://www.nullmodem.com/N
Diagrams:
http://www.beckwithelectri
http://goforit.unk.edu/dat
http://www.qsl.net/wb3afl/
To ensure it's done correctly, you can buy pre-made null modem cables, as well as connectors for around $1.50. Check this site for info
http://www.national-tech.c
http://www.trianglecables.
Bingie
EE VB PE
Main Topics
Browse All Topics





by: RanjeetRainPosted on 2003-12-25 at 04:45:07ID: 9999678
If you are looking for some source code which you can begin with, it may be hard to get. However, you may begin with these tutorials, which will help you get started with MSComm control programming.
al.htm comm.html .com/show/ 21/ library/de fault.asp? url=/libra ry/ en-us/c omm98/html /vbobjcomm .asp library/de fault.asp? url=/libra ry/ en-us/c omm98/html /vbprosett ings_comm. asp om/default .aspx?scid =http:// su pport.micr osoft.com: 80/support /kb/articl es/Q192/0/ 12.asp& NoW ebContent= 1 wwboard/me ssages/111 2.html t/t78787.h tml
-> http://www.ontrak.net/visu
-> http://www.yes-tele.com/ms
-> http://www.developerfusion
-> http://msdn.microsoft.com/
-> http://msdn.microsoft.com/
-> http://support.microsoft.c
-> http://www.thevbzone.com/w
-> http://www.dotnetforums.ne