In many practical applications such as tunnel kiln temperature control system and self-service storage cabinet, we use the high-level C language programming application to meet the different requirements of users for various performance parameters. The following is an example to introduce the advantages of C language in application design.
2 system structureThe system consists of two parts: electrical and mechanical. The mechanical part is composed of the storage cabinet box and the electric control lock; the electrical part is composed of the single chip microcomputer, the control relay, the operation panel and the working status indication. The system structure is shown in Figure 1.
3 system function programmingThe system program consists of the following components: main program, access program, monitoring management program, control output program, cabinet bin sorting program and keyboard interrupt, clock timing interrupt and alarm program. The following mainly introduces the box sorting program, the access program, and the password repetitive program. The software design adopts the modular structure design method, and all programs are written in the high-level C language of the single chip microcomputer.
The main program completes the initialization of each peripheral interface, and then enters the keyboard sampling processing display program, and the display scan update and sampling processing are completed by the clock interrupt program. Below is the bin number initialization subroutine.
The jICunnum[] variable in the above program is used to save the bin number of the bin. The initial jicunnum[i]=i(i=1,2,...,32), that is, all 32 bins are set to 1 respectively. , 2, ..., 32, in order to facilitate the box status indication and the output control of the receiving relay, complete the locking control of the cabinet position, because the opening of the electric lock of the box is operated according to the box number corresponding to the box position. For example, the initial number corresponding to the No. 5 box is jicunnum[5]=5, and so on.
Butt Connector,Lugs Insulated Female Connectors,Insulated Female Connectors,Non-Insulated Spade Terminals Wire Connector
Taixing Longyi Terminals Co.,Ltd. , https://www.longyiterminals.com