计算机应用与软件
計算機應用與軟件
계산궤응용여연건
COMPUTER APPLICATIONS AND SOFTWARE
2015年
4期
30-32,62
,共4页
白渚铨%张晓明%王宇%赵鑫炉
白渚銓%張曉明%王宇%趙鑫爐
백저전%장효명%왕우%조흠로
LabWindows/CVI%多线程%线程安全队列%异步定时器
LabWindows/CVI%多線程%線程安全隊列%異步定時器
LabWindows/CVI%다선정%선정안전대렬%이보정시기
LabWindows/CVI%Multithreading%Thread-safe queue%Asynchronous timer
在某些情况下,工业现场的大量多路数据的处理分析工作需要在上位机中集中进行,上位机中的处理软件要能够实时完成通信、数据处理分析、存储及显示等多个任务。针对通过串口每秒上传2400个字节包含6路传感器信息的数据,单线程工作方式下,串口数据读取丢失,数据实时处理显示效果不佳的情况,在LabWindows/CVI编译环境下,运用包括线程池和异步定时器的多线程技术及线程安全队列等技术,实现了处理软件的可靠通信、数据快速处理和实时显示等多个任务的并行可靠执行。测试结果表明,运用以上的技术能够可靠地同时处理多个任务,快速准确地完成通信、处理的任务,数据的可视化流畅快速,为大量多路数据的集中处理分析显示提供了一种方便可靠的方法。
在某些情況下,工業現場的大量多路數據的處理分析工作需要在上位機中集中進行,上位機中的處理軟件要能夠實時完成通信、數據處理分析、存儲及顯示等多箇任務。針對通過串口每秒上傳2400箇字節包含6路傳感器信息的數據,單線程工作方式下,串口數據讀取丟失,數據實時處理顯示效果不佳的情況,在LabWindows/CVI編譯環境下,運用包括線程池和異步定時器的多線程技術及線程安全隊列等技術,實現瞭處理軟件的可靠通信、數據快速處理和實時顯示等多箇任務的併行可靠執行。測試結果錶明,運用以上的技術能夠可靠地同時處理多箇任務,快速準確地完成通信、處理的任務,數據的可視化流暢快速,為大量多路數據的集中處理分析顯示提供瞭一種方便可靠的方法。
재모사정황하,공업현장적대량다로수거적처리분석공작수요재상위궤중집중진행,상위궤중적처리연건요능구실시완성통신、수거처리분석、존저급현시등다개임무。침대통과천구매초상전2400개자절포함6로전감기신식적수거,단선정공작방식하,천구수거독취주실,수거실시처리현시효과불가적정황,재LabWindows/CVI편역배경하,운용포괄선정지화이보정시기적다선정기술급선정안전대렬등기술,실현료처리연건적가고통신、수거쾌속처리화실시현시등다개임무적병행가고집행。측시결과표명,운용이상적기술능구가고지동시처리다개임무,쾌속준학지완성통신、처리적임무,수거적가시화류창쾌속,위대량다로수거적집중처리분석현시제공료일충방편가고적방법。
In some of the circumstances,the processing and analysis work for large amount of multiplexed data in industry field have to be dealt with in concentration in upper computer.The processing software in upper computer needs to timely complete multiple tasks including communication,data processing and analysis,storage and display.For the data containing the massages of 6 sensors and uploading via serial port at 2400 bytes per second,while the software working in single thread,there has the problems of data lost when reading from serial port and poor effect in real-time data processing and display.Aiming at these,in LabWindows/CVI compilation environment we realise the parallel reliable execution of multiple tasks of the processing software including reliable communication,fast data processing and real-time display by employing the technologies of thread pool,multithreading technology of asynchronous timer and thread-safe queue,etc.Test result shows that it is able to reliably and simultaneously process multiple tasks by using the above mentioned technologies,to complete the tasks of communi-cation and processing quickly and accurately,the visualisation of data is smooth and fast as well.The new method provides for the concentrat-ed processing,analysis and display of large amount and multiplexed data a convenient and reliable approach.