本拉力試驗機控制系統(tǒng)屬于計算機實時控制系統(tǒng),其核心在于計算機上試驗機控制軟件。該軟件在Windows平臺上利用vC++ MFC進行開發(fā)。MFC是微軟公司提供的基配獎庫,雄版夭量的器面用發(fā)相關類,大大簡化頂界面新發(fā)的過程致使得開發(fā)者能夠將主要精力集中在問題處理上。下面在界面設計、程序架構分析以及類的設計這三個方面對軟件進行分析。
試驗機軟件功能分析與界面設計
英斯特力儀器是一家集研發(fā)、生產及銷售于一體的 影像測量儀,拉力試驗機, 硬度計 ,探傷儀, 粗糙度儀, 測厚儀, 金相設備廠家, 致力于為客戶提供更好的檢測儀器。
拉力試驗機控制軟件的設計必須服從拉力試驗機需求,與此同時,設計的控制軟件界面能夠被用戶接受,則必須遵循人機界面設計的一般規(guī)則。這里首先給出拉力試驗機軟件主界面,如圖2所示。下面敘述拉力試驗機控制軟件需要實現(xiàn)的功能,然后根據其功能來具體分析界面的設計。
拉力試驗機控制軟件的設計必須服從拉力試驗機需求,與此同時,設計的控制軟件界面能夠被用戶接受,則必須遵循人機界面設計的一般規(guī)則。這里首先給出拉力試驗機軟件主界面,如圖2所示。下面敘述拉力試驗機控制軟件需要實現(xiàn)的功能,然后根據其功能來具體分析界面的設計。
試驗機控制軟件功能分析
根據工業(yè)現(xiàn)場對拉力試驗機功能的要求,可得試驗機控制軟件必須實現(xiàn)實時監(jiān)控功能、材料試驗功能以及試驗總結功能,現(xiàn)具體敘述如下。
1)實時監(jiān)控功能↓
在進行材料試驗時門試駿者雷要清味的查蠶當前材料試驗的情況。拉力試驗機掠制軟件-岐提供兩種監(jiān)控試驗的方式,一種是實時數據顯示面板,一種是實時曲線顯示面板。實時數據顯示面板顯示試件形變量、承受拉力以及承受拉力最大值信息,實時曲線顯示面板顯示試件承受拉力-試驗時間的曲線信息。通過這兩種方式,用戶可對當前試驗情況有比較清晰的認識。
2)材料試驗功能
拉力試驗機控制軟件一般需要提供手動試驗和自動試驗兩種試驗方式。其中,手動試驗下,用戶可以自己選擇拉伸材料的方向和速度。該試驗方式比較靈活,也可以用于自動試驗之前的拉頭位置調整。自動試驗方式是在用戶設定好試驗目標之后,軟件可以不在用戶干預下自動進行試驗。自動試驗方式包括兩種十分普遍的試驗方式:拉伸試驗和耐受試驗。拉伸試驗為多段拉伸,是一種最基本的試驗方式。該方式下,用戶需要設定每一段的拉伸起始力、結束力以及拉伸時間。耐受試驗用于測試材料的可靠性,試驗時間一般比較長。該方式下,用戶需要設定力加載速率、力保持負荷以及保持時間參數。
3)試驗總結功能
試驗完成后,用戶一般需要記錄材料試驗相關信息。該軟件需要提供的試驗總結功能包括實時曲線保存和打印功能、試驗報表填寫以及打印功能。
試驗機控制軟件界面設計
在明確了試驗機軟件需要實現(xiàn)的功能后,需要合理的設計界面。拉力試驗機界面設計需要遵循界面友好、信息直觀呈現(xiàn)、符合現(xiàn)場操作人員使用習慣、安全性提示以及界面一致性等原則。結合拉力試驗機功能和界面設計原則,拉力試驗機控制軟件主界面設計可如圖2所示。
拉力試驗機計算機控制軟件主界面中包括顯示面板實時曲線面板以及材解試驗面板。其中,顯示面板和實時曲線面板可以直觀的將當前材料試驗信息呈現(xiàn)給里戶。[試監(jiān)面板處顯示的試驗方式根據用戶在菜單欄-輕制方式中選擇的材科試驗方式的不同而不同。限于篇幅,這里律細的界面設于使不再給出。
試驗機軟件架構分析
本拉力試驗機控制軟件采用多線程技術實現(xiàn)。雖然,多線程比單線程要復雜,但是引入多線程后,可以使得程序模塊化更好、程序并發(fā)執(zhí)行,執(zhí)行效率也更高。用戶交互模塊單獨設置一個線程,也保證了界面操作的流暢。該控制軟件需要實現(xiàn)的任務有人機界面交互、材料試驗控制、與下位機PLC通信功能等。因此,這里將該試驗機控制軟件劃分為三個線程:界面線程(主線程)、試驗控制線程、通信線程。
下面分別對以上三個線程進行介紹:
界面線程:也就是主線程,負責人機交互,實現(xiàn)用戶配置、試驗監(jiān)控功能等。該線程是控制線程與通信線程交互的媒介,其承接了控制線程與通信線程??刂凭€程將控制信息傳遞給主線程后,主線程生成通信任務,并傳遞給通信線程。通信線程將與PLC通信返回的數據傳遞給主線程,主線程利用該數據- -方面進行顯示,完成試驗監(jiān)控功能:另- .方面?zhèn)鬟f給控制線程,進行閉環(huán)反饋控制。
The tension test rod control system belongs to the computer real-time support system, its core lies in the control software of the testing machine. The software is developed on Windows platform using vC++ MFC. MFC is Microsoft provided by the base of the award library, the male version of the machine surface with hair related classes, greatly simplifies the top interface of the new process so that developers can focus on the problem. The software is analyzed in the following three aspects: interface design, program architecture analysis and class design.
Testing machine software function analysis and interface design
Tension testing machine control software design must comply with the requirements of tension testing machine, at the same time, the design of the control software interface can be accepted by the user, it must follow the general rules of human-machine interface design. The main interface of tensile testing machine software is presented here, as shown in Figure 2. The following description of the tensile testing machine control software needs to achieve the function, and then according to its functions to specific analysis of the interface design.
Tension testing machine control software design must comply with the requirements of tension testing machine, at the same time, the design of the control software interface can be accepted by the user, it must follow the general rules of human-machine interface design. The main interface of tensile testing machine software is presented here, as shown in Figure 2. The following description of the tensile testing machine control software needs to achieve the function, and then according to its functions to specific analysis of the interface design.
Testing machine control software function analysis
According to the functional requirements of the tensile testing machine in the industrial field, the control software of the testing machine must realize the functions of real-time monitoring, material testing and test summary, which are described as follows.
1) Real-time monitoring function ↓
In the material test door test jun lei to clear the taste of the silkworm current material test situation. Tensile testing machine sweep software - to provide two monitoring test methods, one is a real-time data display panel, a real-time curve display panel. The real-time data display panel displays the specimen shape variable, tensile strength and maximum tensile strength information, while the real-time curve display panel displays the specimen tensile strength - test time curve information. In these two ways, users can have a clear understanding of the current experimental situation.
2) Material test function
Tensile testing machine control software generally need to provide manual test and automatic test two test methods. In manual test, the user can choose the direction and speed of the stretching material. The test method is flexible and can also be used to adjust the position of puller before automatic test. The automatic test mode is that after the user sets the test target, the software can carry out the test automatically without user intervention. Automatic test methods include two very common test methods: tensile test and tolerance test. Tensile test is the most basic test method for multi-section stretching. In this mode, the user needs to set the starting force, ending force and stretching time of each stretch. Tolerance test is used to test the reliability of materials, and the test time is generally long. In this mode, the user needs to set force loading rate, force holding load and hold time parameters.
3) Test summary function
After the completion of the test, users generally need to record the material test related information. The test summary function provided by the software includes real-time curve saving and printing function, test report filling and printing function.
Testing machine control software interface design
In the clear testing machine software needs to achieve the function, need a reasonable design interface. Tensile testing machine interface design needs to follow the principles of friendly interface, intuitive presentation of information, in line with the use of site operators, safety tips and interface consistency. Combined with the function and interface design principles of the tensile testing machine, the main interface design of the control software of the tensile testing machine can be shown in Figure 2.
Tensile testing machine computer control software main interface includes display panel real-time curve panel and material solution test panel. Among them, display panel and real-time curve panel can intuitively present the current material test information to the inside. [The test mode shown on the test panel varies according to the material test mode selected by the user in the menu bar - Lightweight mode. Due to the limitation of space, the detailed interface is not given here.
Software architecture analysis of testing machine
The tension testing machine control software using multi-thread technology. Although multithreading is more complex than single threading, the introduction of multithreading can make programs more modular, concurrent execution, and more efficient. The user interaction module sets a thread separately to ensure the smooth operation of the interface. The control software needs to realize the tasks of man-machine interface interaction, material test control, and PLC communication with the lower computer, etc. Therefore, the testing machine control software is divided into three threads: interface thread (main thread), test control thread, communication thread.
The above three threads are introduced as follows:
Interface thread: that is, the main thread, responsible for human-computer interaction, user configuration, test monitoring, etc. The thread is the medium of interaction between the control thread and the communication thread, and it takes over the control thread and the communication thread. After the control thread passes the control information to the main thread, the main thread generates the communication task and passes it to the communication thread. Communication thread will communicate with PLC returned data to the main thread, the main thread uses the data - - to display, complete the test monitoring function: other -. The aspect is passed to the control thread for closed-loop feedback control.