本系統采用MFC編程方法,MFC是把串口作為文件設備來處理的,它用CreateFile()打開串口,并獲得一個串口句柄,用SetCommState()進行端口配置,包括緩沖區設置,超時設置和數據格式等。然后調用函數ReadFile()和WriteFile()進行數據的讀寫,用WaitForSingleObject()監視通信事件。在用ReadFile()和WriteFile()讀寫串口時,一般采用重疊方式。因為同步I/O方式是當程序執行完畢才返回,這樣會阻塞其他線程,降低程序執行效率。而重疊方式能使調用的函數立即返回,I/O操作在后臺進行,這樣線程就可以處理其他事務,同時也實現了線程在同一串口句柄上實現讀寫操作。 
  =======================================================
    姓名:蘇烈格
    手機:15359408275
    企業QQ:3004859263    
    傳真0592-5165561   
    電子郵箱:3004859263@qq
  =======================================================
  【15天包退換】【一年質保】【大量現貨】【順豐包郵】
   ——————-專業銷售進口PLCDCS備件系列模塊。
   ——————-PLC模塊,可編程控制器,CPU模塊,IO模塊,DO模塊,AI模塊,DI模塊,網通信模塊
   ——————-有詢價的沖我來
   ——————-不要為難我同行
   ——————-他們很辛苦
   15天包退換 一年質保 大量現貨
   AB/施耐德/ABB/GE/本特利/西屋/英維思/霍尼韋爾/黑馬/福克斯波羅                  
  
 =====================================================
ELIANCEELECTRIC608831-4RCOIL110/120V,50/60HZ,505C806G01
EGSSCR1032PTLGROUNDSCREWSW/PIGTAILCOPPERWIRESRDC-038238
DALERESISTORNH-5050W6.19OHMS1%8948
DALENH-250POWERRESISTOR250W,249OHM,1%,8948 
SQUAREDC1861S1R35BCOIL140/380V50/60CY
PARKERK593-302COILWITHLAMP110/120V50/60HZ
DALENH-250POWERRESISTOR250W,10KOHM,1%,8949 
RIEDONRESISTORS(1)RAI-302-UAL-50(1)RAI-3N1-UAL-50 
RELIANCEELECTRIC63481-2URESISTORS 
DALENH-250POWERRESISTOR250W,243OHM,1%,8948 
DALENH-250POWERRESISTOR250W,232OHM,1%,8949 
SCHAFFNERFS4869-12-07 
CUTLERHAMMER1891-1COILS120V
OHMITERH-50RESISTORS50W
PRX58-22C06-9408THYRISTOR S8-22C06-9408
HEWLETTPACKARD12005-69012I/OPC 
PRXT9G004120-30H-8049 
SQUAREDL1707-S1-T26A 
POTTER&BRUMFIELDCLB-51-70010TIME 
SPRAGUE9804LPOWERLYTICCAPACITOR36D,95DEG.C,18000UF25V 
BUSSMANNHFABUSSFUSEHOLDERSFUSEHOLDERS20A250V,1/4"x1-1/4"
GENERALELECTRIC55-501463G4COIL440/480VAC50/60HZNEMA4
NIBGENERALELECTRIC2N1414 
TOSHIBA160Q2G41 
FLEXCOREVT8-016EY04TRANSDUCER0-1VAC4-20MADC 
WATERMANI2SFSOLENOIDCOIL120VAC,14WATT
SEMIKRONTMCC91/12THYRISTOR 
ALLENBRADLEY85A86COILS120V60HZ,110V50HZ
NIBCUTLERHAMMER10177H-1218AMANUAL 
NIBRELIANCEELECTRIC63481-6GRESISTOR15OHM,200W
EATONCUTLERHAMMER1323-1COIL110V,60CYW/ASSEMBLY,13231
MOTOROLAMCL1302GOLDLEADDIODES
MITSUBISHIELECTRICQM75DY-HBTRANSISTORHIGHPOWERSWITCHINGNO.505AD3
NIBTELEMECANIQUELX1LC0249 
LUCIFERR48F155/4940CYLINDERCOIL115V60HZ9W 
NIBMALLORYHES301G450V3CCAPACITORTYPEHES300MFD450VDC
OHMITEC300K1R0LUGRESISTORS300W,1OHM,9202
CRYDOMM505012FVTHYRISTOR 
OHMITEL50J10RRESISTORS50WATTS,10OHMS,5%TOLERANCE
NIBALLENBRADLEY21-A244 
EC-26-11-1COIL90VEC26111 
GE2489RECTIFIERTHYRISTORS24898252
GENERIC27-490-1COIL274901,115/60
JOSLYNCLARKTB1138COIL440V60CYC,TB113-8
FURNASD50833-92COIL208-220/440V,208-240/480V,50/60HZ
GENERICXL-3-2 
SCHAFFNERFN393-1-05-11 
DECCO9-680COILS115V60CY
FUJIELECTRICEV1265MPOWERTRANSISTORMODULE2D1100B-90
CD4012BE14PINLOTOF4CD4029AE16PINLOTOF4CD4017AE16PINCHIPS
ASCO103-832-5-DCOIL24DC-12/DCSPEC,MP-C-015
VOLTRONICS144922POTENTIOMETER3.5K
MURRELEKTRONIK85600DC/DCCONVERTERGLS1-24/524VDCINPUT,GLS1245
ARCOLHS5020KFRESISTORS 
OHMITE65B9917RESISTORS18OHMS5%
OHMITEL225J100LUGRESISTORS225WATT,100OHM
ALLENBRADLEYJA1L040S103UC 
NIBRELIANCEELECTRIC69932-13RCAPACITOR26F6808FC
OHMITEDIVIDHOM210-175P-46NO.1159RESISTOROHMS50175WATT 
NAMCOEB551COILEB55171083,115/125/60
RELIANCEELECTRIC08006INFINEON410403-24AWL10E9THYRISTOR 
ALLENBRADLEY85A288 
ASTRODYNEASD15-48S5DC/DCCONVERTER050812
NUMATICS228-837BSOLENOIDCOIL100-115/50,110-120/60,.15AMPS
ALLENBRADLEY802M-XZJ9LF
NIBSQUARED9998X62SER.AMAGNETCOIL480V60HZ/440V50HZ
KLEMMENSEITEPOTENTIOMETERPARTNO.7-789-90-055-5
PHILIPSECGECG6404 
BECKMANINSTRUMENTS402374-K,A-RIK-L.25 
PRXTHYRISTORDIODEMOD,90A,1.6KV,CM431690
GENERALELECTRICSTMCL-101 
DALERESISTORSNH-5050W.064OHMS1%8949
ROSSDECCO183B04SOLENOIDCOIL125VDC,183B04-19
NIBRELIANCEELECTRIC63481-55AG 
RCACD4066BEQUADANALOGUESWITCHES1C14PIN
JRMGR-200-10KWIREWOUNDRESISTOR9100V
GESK3949PNP-DARLINGTONPOWERTRANSISTORSGE-358,ECG248
MALLORYC21FD3720CAPACITOR370VAC/B,50/60HZ
GENERICCA111COIL440V60CY
OKUMAE3020-397-102 
NIBRELIANCEELECTRIC66057-16B 
MONARCHREFLEXTRUMPETHORNDH-110 
DECCO9-113M-056COIL 
NIBOHMITED225K3R0LUGRESISTOR225WATT3OHMS
IRCGBT-1CARBONCOMPOSITION1WRESISTORS 
EPCOSB32656S8125K565CAPACITORS1.2UF850VMKP10%V2
NIBAEROVOXZ50P3702MRESISTOR,BECK14-2840-02,565796