|
-
Dec 9th, 2004, 08:12 AM
#1
Thread Starter
Lively Member
see the output
Hi everybody
i hv questions to ask. Please take a look at the following code.
While moRS232.Read(1) = -1
End While
If i want to know what the Read method is reading, i can write the output to the console. Is it "console.writeline.......something " ? can anyone advice ?
besides, does anyone know how this code is used and why "- 1" is used in this case ?
Hereby, i would like to thank u all first....thank u very much
-
Dec 9th, 2004, 08:36 AM
#2
Re: see the output
Hi
You can use console.writeline everywhere and the lines will be display the output window.
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Dec 9th, 2004, 08:38 PM
#3
Thread Starter
Lively Member
Re: see the output
Hi,
moRS232 refers to the com settings, part of the code is shown below.
Private Sub btnOpenCom_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenCom.Click
moRS232 = New Rs232()
Try
'// Setup parameters
With moRS232
.Port = miComPort
.BaudRate = CInt(txtBaudrate.Text)
.DataBit = 8
.StopBit = Rs232.DataStopBit.StopBit_1
.Parity = Rs232.DataParity.Parity_None
.Timeout = CInt(txtTimeout.Text)
.WorkingMode = CType(IIf(chkOl.Checked, Rs232.Mode.Overlapped, Rs232.Mode.NonOverlapped), Rs232.Mode)
btnAsyncTx.Enabled = (.WorkingMode = Rs232.Mode.Overlapped)
btnAsync.Enabled = (.WorkingMode = Rs232.Mode.Overlapped)
chkOl.Enabled = False
End With
'// Initializes port
moRS232.Open()
'// Set state of RTS / DTS
moRS232.Dtr = (chkDTR.CheckState = CheckState.Checked)
moRS232.Rts = (chkRTS.CheckState = CheckState.Checked)
Catch Ex As Exception
MessageBox.Show(Ex.Message, "Connection Error", MessageBoxButtons.OK)
Finally
btnCloseCom.Enabled = moRS232.IsOpen
btnOpenCom.Enabled = Not moRS232.IsOpen
btnTx.Enabled = moRS232.IsOpen
btnRx.Enabled = moRS232.IsOpen
btnCheck.Enabled = moRS232.IsOpen
End Try
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|