mscomm como poner un puerto concreto
Publicado por Alberto (8 intervenciones) el 30/12/2004 12:16:48
No logro cambiar el puerto que deseo usar , solo me toma el 1 y yo los puertos que uso son altos como el 1038 o el 1042 , etc.
Cómo lo pongo ?
código:
Private Sub Command1_Click()
ok = False
End Sub
Private Sub Form_Load()
' Buffer to hold input string
Form1.Show
ok = True
Dim Instring As String
' Use COM1.
MSComm1.CommPort = 1
' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = "9600,N,8,1"
' Tell the control to read entire buffer when Input
' is used.
MSComm1.InputLen = 1024
' Open the port.
MSComm1.PortOpen = True
' Send the attention command to the modem.
MSComm1.Output = "ATV1Q0" & Chr$(13) ' Ensure that
' the modem responds with "OK".
' Wait for data to come back to the serial port.
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
List1.AddItem (buffer$)
Loop Until ok = False
' Read the "OK" response data in the serial port.
' Close the serial port.
MSComm1.PortOpen = False
End Sub
Cómo lo pongo ?
código:
Private Sub Command1_Click()
ok = False
End Sub
Private Sub Form_Load()
' Buffer to hold input string
Form1.Show
ok = True
Dim Instring As String
' Use COM1.
MSComm1.CommPort = 1
' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = "9600,N,8,1"
' Tell the control to read entire buffer when Input
' is used.
MSComm1.InputLen = 1024
' Open the port.
MSComm1.PortOpen = True
' Send the attention command to the modem.
MSComm1.Output = "ATV1Q0" & Chr$(13) ' Ensure that
' the modem responds with "OK".
' Wait for data to come back to the serial port.
Do
DoEvents
buffer$ = buffer$ & MSComm1.Input
List1.AddItem (buffer$)
Loop Until ok = False
' Read the "OK" response data in the serial port.
' Close the serial port.
MSComm1.PortOpen = False
End Sub
Valora esta pregunta


0