Description
1771-W Task Management System
The 1771-W was developed based on Cygnal’s C8051f040 chip, so the secondary programme was developed in 51 assembly language. The compiler chosen for development is KEIL C51 because it can generate the .HEX files we need. The kernel leaves seven user-embedded programme interfaces, we only need to fully understand the function of each interface on the secondary development, need to be familiar with the following: a, kernel function b, kernel structure c, kernel task management d, kernel storage space allocation.
The 1771-W system software has already added the functions of 232 communication, 485 communication and CAN communication, so the development of the secondary driver software of the 16-channel analogue PLC mainly focuses on the analogue AD conversion and the real-time refreshment of the AD values in the resource area of the PLC. Adopting relays to realise its related interlocking logic functions, the means of realisation is not only backward and the maintenance workload is large, but also the unexplained accidental stopping often occurs, and the operation of the anti-surge control system is not ideal.
1771-W programme planning
T4 interrupt: complete the AD conversion and 16-channel switching procedures
USER_SCAN: Refresh AD value in PLC resource area.
The AD conversion process is as follows: each channel is sampled continuously for 16 times, after sampling, the sum is obtained, and then the AD conversion of the next channel is started.
The process of refreshing the AD values in the PLC resource area is as follows: at the end of the ladder scan cycle, the sum of the AD values of each channel is averaged and put into the corresponding position in the PLC resource area.