ÄãºÃ£¬»¶Ó­À´µ½¾­¹ÜÖ®¼Ò [µÇ¼] [×¢²á]

ÉèΪÊ×Ò³ | ¾­¹ÜÖ®¼ÒÊ×Ò³ | Êղر¾Õ¾

»ùÓÚwindowsµÄ´®¿ÚͨÐÅÈí¼þÉè¼Æ_ͨÐŹ¤³ÌרҵÂÛÎÄ·¶ÎÄ

·¢²¼Ê±¼ä£º2015-01-24 À´Ô´£ºÈË´ó¾­¼ÃÂÛ̳
ͨÐŹ¤³ÌרҵÂÛÎÄ Ä¿ ¼ µÚÒ»Õ ´®¿ÚͨѶµÄ¸ÅÄî¡¢±³¾°¼°ÒâÒå 1 1.1±¾¿ÎÌâÑо¿µÄÖ÷ÒªÄÚÈÝ 1 1.2±¾¿ÎÌâÑо¿µÄ±³¾°ÒâÒå 1 1.3´®ÐÐͨÐÅ»ù±¾¸ÅÄî 2 1.3.1´®ÐÐͨПÅÊö 2 1.3.2´®¿Ú֪ʶ 3 1.3.3 RS-232-C½Ó¿Ú 4 1.3.4Êý¾ÝУÑé·½·¨ 5 1.4´®ÐÐͨÐÅЭÒé 6 1.4.1 Ó²¼þЭÒé 6 1.4.2¡¢Èí¼þЭÒé 8 µÚ¶þÕ Éè¼Æ·½°¸µÄÑ¡ÔñºÍ½éÉÜ 11 2.1³£Óô®ÐÐͨÐÅÈí¼þÉè¼Æ·½°¸ 11 2.1.1ÀûÓÃMSCOMM¿Ø¼þ 11 2.1.2ÀûÓÃWINAPIº¯Êý½øÐбà³Ì 11 2.1.3ÀûÓõÚÈý·½´®¿ÚͨѶ¿Ø¼þ½øÐбàд 11 2.2ÀûÓõÚÈý·½CSerialPortÀà½øÐд®¿ÚͨÐűà³Ì 12 2.2.1 CSerialPortÀà½éÉÜ 12 2.2.2 CSerialPortÀàµÄ¸Ä½ø 12 2.3 ÀûÓÃCSerialPortÀà½øÐд®ÐÐͨÐÅ 15 2.4 С½á 16 µÚÈýÕ ´®ÐÐͨÐÅÈí¼þÉè¼Æ 17 3.1±àÖÆÍ¨ÐÅЭÒéºÍÉ趨Èí¼þÁ÷³Ìͼ 17 3.2Èí¼þÉè¼Æ 19 3.3 VCÏ´®ÐÐͨÐÅÈí¼þÉè¼Æ 24 3.4 С½áÓëϵͳÀ©Õ¹ 25 µÚËÄÕ ӦÓÃʵÀý£ºÂ¥ÓîζȿØÖÆÏµÍ³ 27 4.1 Â¥ÓîζȿØÖÆÏµÍ³·ÖÎö 27 4.2 ϵͳÏêϸÉè¼Æ 28 4.3 ϵͳ¸÷Ä£¿é½éÉÜ 29 4.4 Êý¾ÝÖÐÐijÌÐòÉè¼Æ 31 4.4.1Êý¾ÝÖÐÐÄÓëζȴ«¸ÐÆ÷ͨÐÅ 31 4.4.2Êý¾ÝÖÐÐÄÓëÖÐÑë¿Õµ÷ͨÐÅ 32 4.4.3´®ÐÐͨÐÅÓëTCP/IPÏà½áºÏ 33 4.4..4Êý¾ÝÖÐÐijÌÐòÉè¼Æ 33 4.5 С½á 35 ½áÊøÓï 37 ²Î¿¼ÎÄÏ× 38 ÖÂл 39 ¸½Â¼Ò»£ºÐ޸ĺóµÄCSerialPortÀà 40 ¸½Â¼¶þ£º³ÌÐòºËÐÄ´úÂë 47 Õª Òª ´®ÐÐͨОßÓÐÁ¬½Ó¼òµ¥¡¢Ê¹ÓÃÁé»î·½±ã¡¢Êý¾Ý´«µÝ¿É¿¿µÈÓŵ㣬ÔÚ¹¤Òµ¼à¿Ø¡¢Êý¾Ý²É¼¯ºÍʵʱ¿ØÖÆÏµÍ³Öеõ½Á˹㷺ӦÓá£Í¨¹ý»ùÓÚÏ̺߳ÍÏûÏ¢µÄ¶àÈÎÎñ´¦Àí±à³Ì¿ÉÒÔÓÐЧµØ½â¾ö´®ÐÐͨÐÅʵʱÐԺͿɿ¿ÐÔ¶¼µÃ²»µ½±£Ö¤µÄÎÊÌ⣬ÇÒÄÜÌá¸ßÊý¾Ý´«ÊäµÄÍÌÍÂÁ¿ºÍÓ¦ÓóÌÐòµÄ¿É¿¿ÐÔ¡£ ±¾ÎÄÔÚÑо¿Òì²½´®ÐÐͨÐÅÈí¼þÒÔ¼°Í¨ÐÅЭÒéµÄ»ù´¡ÉÏ,¸ø³öÁË»ùÓÚwindowsµÄ´®ÐпÚͨÐÅÈí¼þÉè¼Æ£¬ÅäºÏ¶àÏ̵߳ijÌÐòÉè¼ÆÊµÏÖÁË´®¿ÚͨÐźÍÊý¾ÝµÄʵʱ²É¼¯£¬±¾ÎÄÀûÓÃCSerialPortÀà½øÐд®ÐÐͨÐÅ£¬Éè¼ÆÁËÖ±½ÓºÍÁé»îµØ¶Ô´®¿Ú¿ØÖƲÙ×÷µÄÈí¼þ¡£CSerialPortÀàÊÇÓÉRemon SpekreijseÌṩµÄÃâ·Ñ´®¿ÚÀà,CSerialPortÀàÖ§³ÖÏßÁ¬½Ó£¨·ÇMODEM£©µÄ´®¿Ú±à³Ì²Ù×÷£¬±àдµÄ³ÌÐòÄÜÔÚwindows»·¾³ÏºܺõÄÔËÐС£²¢ÇÒCSerialPortÀàÄÜ·½±ãµÄÀûÓÃwindows API¶ÔÆä½øÐÐÀ©Õ¹ºÍ¸Ä½ø,²»µ«¿ÉÒÔ·½±ãµÄʵÏÖ»ù±¾´®ÐÐͨÐŹ¦ÄÜ£¬¶øÇÒ¿ÉÒÔËæÒâ½øÐй¦ÄÜÀ©Õ¹¡£ ×îºóÒÔ´ËΪ»ù´¡¸ø³öÒ»¸öÂ¥ÓîζȿØÖÆÏµÍ³¡£Â¥ÓîζȿØÖÆÍ¨¹ý´®ÐÐÊý¾Ý×ÜÏßÁ¬½Óζȴ«¸ÐÆ÷ºÍÖÐÑë¿Õµ÷ϵͳ£¬Õû¸öϵͳ¼ò½à¸ßЧ¡£ ¹Ø¼ü´Ê£º ´®ÐÐͨÐÅ£¬Ò첽ͨÐÅ£¬Â¥ÓîζȿØÖÆ ABSTRACT Serial communication is flexible and easy to use , Data transmission by the serial communication is security and stability. It is widely used in industrial control, Real-time data acquisition and control system and so on.Using the thread through information and the multi-task processing program we can solve the problem that the Real-time and reliability are not guaranteed, but also improve the throughput of data transmission and application reliability. Based on the study of asynchronous serial communication software and communication protocol,it give out a serial communication software design.Based on the windows and Real-time data acquisition. By using CSerialPort class Implement the serial communication and give a design of serial operating software CSerialPort is a free class provided by Remon Spekreijse which is support th serial programming operation well.It¡¯s easy to Using windows API to upgrade. Finally It made a building temperature control system, which connected temperature sensors and the central air-conditioning system through serial data bus. The whole system is simple and efficient. KEY WORDS serial communication, asynchronous ommunication, building temperature control
¾­¹ÜÖ®¼Ò¡°Ñ§µÀ»á¡±Ð¡³ÌÐò
  • ɨÂë¼ÓÈë¡°¿¼ÑÐѧϰ±Ê¼ÇȺ¡±
ÍÆ¼öÔĶÁ
¾­¼ÃѧÏà¹ØÎÄÕÂ
±êÇ©ÔÆ
¾­¹ÜÖ®¼Ò¾«²ÊÎÄÕÂÍÆ¼ö