In designing a small PLC control system, it's common to need to modify internal data such as counter values, timer settings, or data registers in order to meet the specific requirements of a production process. Additionally, it's crucial that this data can be retained after the system is powered down and then retrieved upon restart. Many small PLCs come with power-down holding registers, but often not enough for all user needs.
When the number of adjustable data points exceeds the available power-down registers, designers face a dilemma: either reduce the number of adjustable parameters or opt for a more expensive PLC model with more holding registers. This limitation reduces system flexibility and may lead to higher costs or lower product quality.
During the design of a hot-air sewing machine for a garment factory, I encountered this exact issue. The PLC used was the Panasonic FP0-C16T, which had 10 power-down holding registers: 8 data registers (DT1652–DT1659) and 2 internal relays (WR61, WR62). With 16 data points needing adjustment, this wasn’t sufficient if each required a full register.
Upon analysis, I found that most of the data only needed to range from 0 to 255, which fits within an 8-bit space. Since the holding registers are 16 bits, I could store two 8-bit values in one register by using the upper and lower 8 bits separately.
Here’s how the program works:
1. **Power-On Initialization**:
When the PLC starts, the upper and lower 8 bits of the holding register (DT1655) are split into two separate registers. A pulse relay (R9013) triggers a single scan cycle when the PLC transitions to run mode. Using instructions like F65 (word AND) and F120 (right shift), the lower 8 bits are extracted and stored in DT0, while the upper 8 bits are shifted right and stored in DT1.
2. **Data Merging**:
After booting, the two registers are merged back into the holding register. A second pulse relay (R9014) ensures this happens on the next scan cycle. Instructions like F121 (left shift) and F66 (word OR) combine the data from DT0 and DT1, then write it back to DT1655.
This approach allows for efficient use of limited memory, enabling more flexible adjustments without increasing hardware costs. It demonstrates how smart programming can overcome hardware limitations in small PLC systems.
Auto Rotation Cleaver,High Precision Optical Fiber Cleaver,Optical Fiber Cleaving,Auto Fiber Cleaver
Guangdong Tumtec Communication Technology Co., Ltd , https://www.gdtumtec.com