Article View: be.comp.programming
Article #16923Re: com poort via visual basic
From: Waldo Smets
Date: Wed, 15 Mar 2000 00:00
Date: Wed, 15 Mar 2000 00:00
65 lines
2551 bytes
2551 bytes
In principe MSComm Control 6.0, gemaakt voor VB 6.0
Als je VB 6.0 hebt, ga meteen naar Help - Contents fiche - Visual Basic
Documentation - Reference - Controls Reference - ActiveX Controls -
MSComm Control
Hier heb je alvast het voorbeeld uit de MSDN lib:
The following simple example shows basic serial communications using a
modem:
Private Sub Form_Load ()
' Buffer to hold input string
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 = 0
' 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
Loop Until InStr(Buffer$, "OK" & vbCRLF)
' Read the "OK" response data in the serial port.
' Close the serial port.
MSComm1.PortOpen = False
End Sub
Note The MSComm control can use polling or an event-driven method to
retrieve data from the port. This simple example uses the polling
method. For an example of the event-driven method, see help for the
OnComm event.
----
OPGEPAST: Een pak ActiveX controls die theoretisch ook in Access
bruikbaar zijn, gedragen zich er bijzonder hardnekkig en/of labiel.
HTH,
Waldo Smets
SOFTWARE SOLUTIONS
Heverlee - Leuven (BEL)
Stevy Vreys wrote:
>
> Hallo,
>
> kan ik in Access via Visual Basic for Applications data binnenhalen van de
> seriele poort??
> Zo ja, kan iemand alstublieft mij vertellen hoe dat dan gedaan wordt?
>
> Dank bij voorbaat,
> Stevy
>
> stevy.vreys@village.uunet.be
Technical Details
Message-ID:
<38CF9D83.BFE978B5@tvd.be>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8altrg$c0o$1@newnews1.news.nl.uu.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcea4,b170fe30b7a824bf X-Google-Attributes: gidfcea4,public From: Waldo Smets <waldo.smets@tvd.be> Subject: Re: com poort via visual basic Date: 2000/03/15 Message-ID: <38CF9D83.BFE978B5@tvd.be> X-Deja-AN: 597809524 Content-Transfer-Encoding: 7bit References: <8altrg$c0o$1@newnews1.news.nl.uu.net> X-Accept-Language: en,nl-BE,nl Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@chello.be X-Trace: news.chello.be 953130234 195.162.216.140 (Wed, 15 Mar 2000 15:23:54 MET) Organization: Chello Usenet Service MIME-Version: 1.0 NNTP-Posting-Date: Wed, 15 Mar 2000 15:23:54 MET Newsgroups: be.comp.programming