计算机与现代化
計算機與現代化
계산궤여현대화
COMPUTER AND MODERNIZATION
2013年
11期
100-103
,共4页
LabVIEW%被动接收型%轮询串口通信%触发串口通信%共享变量
LabVIEW%被動接收型%輪詢串口通信%觸髮串口通信%共享變量
LabVIEW%피동접수형%륜순천구통신%촉발천구통신%공향변량
LabVIEW%passive receiving%polling serial ports communication%triggering serial ports communication%shared var-iables
被动接收型串口通信的特点是下位机不断地向上位机发送数据,而上位机在不知道下位机何时发送的情况下被动接收。研究LabVIEW被动接收型串口通信的应用问题,并根据被动接收型串口通信的特点,设计2种应用于串口数据的采集系统。其中,轮询串口通信系统采用循环结构不断查询缓冲区来读取数据,为解决串口数据有时接收不全的问题,该系统先将所有的串口数据全部接收到临时文件,然后再读取临时文件,获得数据;触发串口通信系统则是通过共享变量与外界通信,改变共享变量的值来分别触发串口来获得数据,可避免因使用循环结构不断查询所有串口数据缓冲区而占用大量系统资源的问题。两系统只需设置相应串口参数即可显示、回放和实时存储由硬件采集的数据,方便以后对采集数据进行研究。实验结果表明,系统的稳定性和可靠性较高。
被動接收型串口通信的特點是下位機不斷地嚮上位機髮送數據,而上位機在不知道下位機何時髮送的情況下被動接收。研究LabVIEW被動接收型串口通信的應用問題,併根據被動接收型串口通信的特點,設計2種應用于串口數據的採集繫統。其中,輪詢串口通信繫統採用循環結構不斷查詢緩遲區來讀取數據,為解決串口數據有時接收不全的問題,該繫統先將所有的串口數據全部接收到臨時文件,然後再讀取臨時文件,穫得數據;觸髮串口通信繫統則是通過共享變量與外界通信,改變共享變量的值來分彆觸髮串口來穫得數據,可避免因使用循環結構不斷查詢所有串口數據緩遲區而佔用大量繫統資源的問題。兩繫統隻需設置相應串口參數即可顯示、迴放和實時存儲由硬件採集的數據,方便以後對採集數據進行研究。實驗結果錶明,繫統的穩定性和可靠性較高。
피동접수형천구통신적특점시하위궤불단지향상위궤발송수거,이상위궤재불지도하위궤하시발송적정황하피동접수。연구LabVIEW피동접수형천구통신적응용문제,병근거피동접수형천구통신적특점,설계2충응용우천구수거적채집계통。기중,륜순천구통신계통채용순배결구불단사순완충구래독취수거,위해결천구수거유시접수불전적문제,해계통선장소유적천구수거전부접수도림시문건,연후재독취림시문건,획득수거;촉발천구통신계통칙시통과공향변량여외계통신,개변공향변량적치래분별촉발천구래획득수거,가피면인사용순배결구불단사순소유천구수거완충구이점용대량계통자원적문제。량계통지수설치상응천구삼수즉가현시、회방화실시존저유경건채집적수거,방편이후대채집수거진행연구。실험결과표명,계통적은정성화가고성교고。
The characteristics of passive receiving serial communication are the lower machine is always sending data to upper computer , but the upper computer receives data passively in the case of not knowing when the machine sending data .This paper studies the application of passive receiving serial communication based on LabVIEW , and designs two serial collection systems for data acquisition on the basis of the characteristics of passive receiving serial communication .Polling serial ports communication can obtain data by using the loop structure querying buffer continuously .Because of the incomplete received date at times , the system saves all the data received from upper computer to temporary files , and we can obtain data by reading the temporary files . To prevent using the loop structure querying buffers of all the serial ports continuously , which result in the waste of the system re-sources, triggering serial ports communication can obtain data by communicating with outside through shared variables , and trig-ger serial ports separately by the change value of shared variables .Only need to set some serial port parameters , the two systems can display , playback and real-time storage the data collected by hardware , and can provide convenience for the future research of the collected data .The actual experiment verifies the system is stability and reliability .