本拉力試驗(yàn)機(jī)控制系統(tǒng)屬于計(jì)算機(jī)實(shí)時(shí)控制系統(tǒng),其核心在于計(jì)算機(jī)上試驗(yàn)機(jī)控制軟件。該軟件在Windows平臺(tái)上利用vC++ MFC進(jìn)行開發(fā)。MFC是微軟公司提供的基配獎(jiǎng)庫(kù),雄版夭量的器面用發(fā)相關(guān)類,大大簡(jiǎn)化頂界面新發(fā)的過(guò)程致使得開發(fā)者能夠?qū)⒅饕性趩?wèn)題處理上。下面在界面設(shè)計(jì)、程序架構(gòu)分析以及類的設(shè)計(jì)這三個(gè)方面對(duì)軟件進(jìn)行分析。
試驗(yàn)機(jī)軟件功能分析與界面設(shè)計(jì)
英斯特力儀器是一家集研發(fā)、生產(chǎn)及銷售于一體的 影像測(cè)量?jī)x,拉力試驗(yàn)機(jī), 硬度計(jì) ,探傷儀, 粗糙度儀, 測(cè)厚儀, 金相設(shè)備廠家, 致力于為客戶提供更好的檢測(cè)儀器。
拉力試驗(yàn)機(jī)控制軟件的設(shè)計(jì)必須服從拉力試驗(yàn)機(jī)需求,與此同時(shí),設(shè)計(jì)的控制軟件界面能夠被用戶接受,則必須遵循人機(jī)界面設(shè)計(jì)的一般規(guī)則。這里首先給出拉力試驗(yàn)機(jī)軟件主界面,如圖2所示。下面敘述拉力試驗(yàn)機(jī)控制軟件需要實(shí)現(xiàn)的功能,然后根據(jù)其功能來(lái)具體分析界面的設(shè)計(jì)。
拉力試驗(yàn)機(jī)控制軟件的設(shè)計(jì)必須服從拉力試驗(yàn)機(jī)需求,與此同時(shí),設(shè)計(jì)的控制軟件界面能夠被用戶接受,則必須遵循人機(jī)界面設(shè)計(jì)的一般規(guī)則。這里首先給出拉力試驗(yàn)機(jī)軟件主界面,如圖2所示。下面敘述拉力試驗(yàn)機(jī)控制軟件需要實(shí)現(xiàn)的功能,然后根據(jù)其功能來(lái)具體分析界面的設(shè)計(jì)。
試驗(yàn)機(jī)控制軟件功能分析
根據(jù)工業(yè)現(xiàn)場(chǎng)對(duì)拉力試驗(yàn)機(jī)功能的要求,可得試驗(yàn)機(jī)控制軟件必須實(shí)現(xiàn)實(shí)時(shí)監(jiān)控功能、材料試驗(yàn)功能以及試驗(yàn)總結(jié)功能,現(xiàn)具體敘述如下。
1)實(shí)時(shí)監(jiān)控功能↓
在進(jìn)行材料試驗(yàn)時(shí)門試駿者雷要清味的查蠶當(dāng)前材料試驗(yàn)的情況。拉力試驗(yàn)機(jī)掠制軟件-岐提供兩種監(jiān)控試驗(yàn)的方式,一種是實(shí)時(shí)數(shù)據(jù)顯示面板,一種是實(shí)時(shí)曲線顯示面板。實(shí)時(shí)數(shù)據(jù)顯示面板顯示試件形變量、承受拉力以及承受拉力最大值信息,實(shí)時(shí)曲線顯示面板顯示試件承受拉力-試驗(yàn)時(shí)間的曲線信息。通過(guò)這兩種方式,用戶可對(duì)當(dāng)前試驗(yàn)情況有比較清晰的認(rèn)識(shí)。
2)材料試驗(yàn)功能
拉力試驗(yàn)機(jī)控制軟件一般需要提供手動(dòng)試驗(yàn)和自動(dòng)試驗(yàn)兩種試驗(yàn)方式。其中,手動(dòng)試驗(yàn)下,用戶可以自己選擇拉伸材料的方向和速度。該試驗(yàn)方式比較靈活,也可以用于自動(dòng)試驗(yàn)之前的拉頭位置調(diào)整。自動(dòng)試驗(yàn)方式是在用戶設(shè)定好試驗(yàn)?zāi)繕?biāo)之后,軟件可以不在用戶干預(yù)下自動(dòng)進(jìn)行試驗(yàn)。自動(dòng)試驗(yàn)方式包括兩種十分普遍的試驗(yàn)方式:拉伸試驗(yàn)和耐受試驗(yàn)。拉伸試驗(yàn)為多段拉伸,是一種最基本的試驗(yàn)方式。該方式下,用戶需要設(shè)定每一段的拉伸起始力、結(jié)束力以及拉伸時(shí)間。耐受試驗(yàn)用于測(cè)試材料的可靠性,試驗(yàn)時(shí)間一般比較長(zhǎng)。該方式下,用戶需要設(shè)定力加載速率、力保持負(fù)荷以及保持時(shí)間參數(shù)。
3)試驗(yàn)總結(jié)功能
試驗(yàn)完成后,用戶一般需要記錄材料試驗(yàn)相關(guān)信息。該軟件需要提供的試驗(yàn)總結(jié)功能包括實(shí)時(shí)曲線保存和打印功能、試驗(yàn)報(bào)表填寫以及打印功能。
試驗(yàn)機(jī)控制軟件界面設(shè)計(jì)
在明確了試驗(yàn)機(jī)軟件需要實(shí)現(xiàn)的功能后,需要合理的設(shè)計(jì)界面。拉力試驗(yàn)機(jī)界面設(shè)計(jì)需要遵循界面友好、信息直觀呈現(xiàn)、符合現(xiàn)場(chǎng)操作人員使用習(xí)慣、安全性提示以及界面一致性等原則。結(jié)合拉力試驗(yàn)機(jī)功能和界面設(shè)計(jì)原則,拉力試驗(yàn)機(jī)控制軟件主界面設(shè)計(jì)可如圖2所示。
拉力試驗(yàn)機(jī)計(jì)算機(jī)控制軟件主界面中包括顯示面板實(shí)時(shí)曲線面板以及材解試驗(yàn)面板。其中,顯示面板和實(shí)時(shí)曲線面板可以直觀的將當(dāng)前材料試驗(yàn)信息呈現(xiàn)給里戶。[試監(jiān)面板處顯示的試驗(yàn)方式根據(jù)用戶在菜單欄-輕制方式中選擇的材科試驗(yàn)方式的不同而不同。限于篇幅,這里律細(xì)的界面設(shè)于使不再給出。
試驗(yàn)機(jī)軟件架構(gòu)分析
本拉力試驗(yàn)機(jī)控制軟件采用多線程技術(shù)實(shí)現(xiàn)。雖然,多線程比單線程要復(fù)雜,但是引入多線程后,可以使得程序模塊化更好、程序并發(fā)執(zhí)行,執(zhí)行效率也更高。用戶交互模塊單獨(dú)設(shè)置一個(gè)線程,也保證了界面操作的流暢。該控制軟件需要實(shí)現(xiàn)的任務(wù)有人機(jī)界面交互、材料試驗(yàn)控制、與下位機(jī)PLC通信功能等。因此,這里將該試驗(yàn)機(jī)控制軟件劃分為三個(gè)線程:界面線程(主線程)、試驗(yàn)控制線程、通信線程。
下面分別對(duì)以上三個(gè)線程進(jìn)行介紹:
界面線程:也就是主線程,負(fù)責(zé)人機(jī)交互,實(shí)現(xiàn)用戶配置、試驗(yàn)監(jiān)控功能等。該線程是控制線程與通信線程交互的媒介,其承接了控制線程與通信線程??刂凭€程將控制信息傳遞給主線程后,主線程生成通信任務(wù),并傳遞給通信線程。通信線程將與PLC通信返回的數(shù)據(jù)傳遞給主線程,主線程利用該數(shù)據(jù)- -方面進(jìn)行顯示,完成試驗(yàn)監(jiān)控功能:另- .方面?zhèn)鬟f給控制線程,進(jìn)行閉環(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.