Automatically detect serial entry in VB

xiaoxiao2021-03-06  38

In VB6.0, communication controls are in "Project" - "Part", select Microsoft Comm Control6.0

Its file is MScomm32.ocx

One of the only events of the control is the oncomm event. As the COMMEVENT attribute value changes, the following Case program code is triggered. This is automatically detected. (Different from timing detection)

ON Community

Select Case Mscomm1.commmevent

Case COMEVCD 'CD line status changes

If mscomm1.cdholding then 'If the DCD foot potential is high

Else

.

END IF

Case ComeVcts' CTS line status changes

Case Comevdsr 'DSR line status changes

Case comVRING 'Ring Indicator Change

Case comVReceive 'receives a minimum acceptance of characters

Case comvsend 'Transfer buffer has a minimum transfer character number character

Case ComeveOf 'Enter the data stream to discover EOF characters

End SELECT

转载请注明原文地址:https://www.9cbs.com/read-65273.html

New Post(0)