VC编写串口程序 - 百度文库 ر

ݷʱ : 2024/12/23 1:31:56һ µȫĶ

ֵCDHolding ԵֵΪ

True Carrier Detect Ϊߵƽ False Carrier Detect Ϊ͵ƽ

˵ע⵱ Carrier Detect Ϊߵƽ (CDHolding = True) ҳʱʱMSComm ؼCommEvent Ϊ comEventCDTOCarrier Detect ʱ󣩣 OnComm ¼

ע ӦóвһʧĴرҪģһ壬Ϊ߿ʱ𣨷䣩

Carrier Detect ҲΪ Receive Line Signal Detect (RLSD) Boolean

DSRHolding ԣȷ Data Set Ready (DSR) ߵ״̬Data Set Ready źɵƽ͵ָʾò׼ʱЧʱΪֻ

﷨object.DSRHolding

object ڴʾʽֵǡӦڡбеĶ DSRHolding Էֵ ֵ

True Data Set Ready ߸ False Data Set Ready ߵ ˵ Data Set Ready Ϊߵƽ (DSRHolding = True) ҳʱʱMSComm ؼ CommEvent Ϊ comEventDSRTO׼ʱ OnComm ¼

Ϊ Data Terminal Equipment (DTE) д Data Set Ready/Data Terminal Ready ʱʮõġ ͣBoolean

Settings : òزʡżУ顢λֹͣλ

﷨: object.Settings[ = value]

˵˿ڴʱ value Ƿ MSComm ؼ 380Ƿֵ

Value ĸֵɣµĸʽ \

BBBB ΪʣP ΪżУ飬D ΪλS Ϊֹͣλvalue ȱʡֵǣ

\

InputLen ԣò Input Դӽջȡַ

﷨ object.InputLen [ = value]

InputLen ﷨в֣

value ͱʽ˵ Input Դӽջжȡַ

˵InputLen Եȱʡֵ 0 InputLen Ϊ 0 ʱʹ Input ʹ MSComm ؼȡջȫݡ

ջ InputLen ַЧInput Էһ㳤ַ (\ʹ Input ǰûѡ InBufferCount ȷǷҪĿַڴʽΪݵĻȡʱdzá

EOFEnable ԣȷ MSComm ؼǷѰļβ (EOF) ַҵ EOF ַֹͣ벢 OnComm ¼ʱ CommEvent Ϊ comEvEOF

﷨object.EOFEnable [ = value ] EOFEnable ﷨в֣ value ʽȷҵ EOF ַʱOnComm ¼Ƿ񱻼硰ֵ value ֵ

True EOF ַҵʱ OnComm ¼

False ȱʡ EOF ַҵʱ OnComm ¼ ˵ EOFEnable Ϊ FalseOnComm ؼѰ EOF ַ

ϢMS Comm ؼ

±г MSComm ؼԲĴ

ֵ

380 Чֵ comInvalidPropertyValue 383 Ϊֻ comSetNotSupported 394 Ϊֻ comGetNotSupported 8000 ˿ڴʱϷ comPortOpen 8001 ʱֵ 0

8002 Ч˿ں comPortInvalid 8003 ֻʱЧ 8004 ʱΪֻ

8005 ˿Ѿ comPortAlreadyOpen 8006 豸ʶЧָ֧ñʶ 8007 ֧豸IJ 8008 ָֽڴСЧ 8009 ȱʡ

8010 Ӳã豸 8011 ܷ

8012 豸ûд comNoOpen 8013 豸Ѿ

8014 ʹ comm ֪ͨ

8015 comm ״̬ comSetCommStateFailed 8016 comm ¼

8018 ˿ڴʱЧ comPortNotOpen 8019 豸æ

8020 comm 豸 comReadError

8021 Ϊö˿ڼ豸ƿʱڲ comDCBError