Electric Hoist PLC Control Programming (S7-1200 Ladder Logic + SCL)
Electric Hoist PLC Control Program Development (S7-1200 in Practice) This article uses the Siemens S7-1200 (CPU 1212C DC/DC/DC) as the core controller, with the TIA Portal V17 development environment and a hybrid LAD (Ladder Logic) + SCL (Structured Control Language) programming approach. It implements hoist logic control for hoisting/lowering/traversing, overload protection, limit switch protection, emergency stop interlocking, remote/pendant switching, and fault self-diagnostics. The complete program consists of 4 FC blocks, 1 DB block, and 1 OB1 main cycle, and can be imported directly into real-world projects.
For decades, traditional electric hoist control has relied primarily on cam controllers, relays, and contactors. The resulting electrical schematics are built around dozens of intermediate relays and time delay relays, making fault diagnosis a tedious process and leaving no practical way to integrate the equipment into a plant-wide information system. As Industry 4.0 gains momentum, more and more factories now require lifting equipment to be connected to MES/SCADA systems for equipment status monitoring, operational data collection, and predictive fault alerts. Replacing relay logic with PLC control is the inevitable direction. Drawing on Kelude's hands-on experience delivering a centralized control system for 68 electric hoists at an automotive parts plant, this article walks through the entire PLC control program development process—from the I/O allocation table and ladder logic to SCL fault-handling routines, HMI screen planning, and program download and commissioning.
Hardware Configuration and I/O Allocation
1.1 Hardware Selection
| Equipment | Model | Quantity | Remarks |
|---|---|---|---|
| PLC CPU | S7-1200 1212C DC/DC/DC | 1 | 6ES7 212-1AE40-0XB0,8DI/6DO |
| Digital Input Expansion Module | SM 1223 DI 8×24VDC / DO 8×24VDC | 1 | 6ES7 223-1BH32-0XB0 |
| Analog Input Expansion Module | SM 1231 AI 4×13bit | 1 | 6ES7 231-4HD32-0XB0,4~20mA |
| HMI Touch Screen (HMI) | KTP400 Basic PN | 1 | 6AV6 647-0AD11-3AX0,4.3inch |
| Intermediate Relay | RIM 24VDC 2CO | 6 | PLC DOContactor Coil Isolation |
| Switching Power Supply | EDR-120-24 | 1 | AC220VDC24V 5A |
1.2 I/O Assignment Table
| Address | Symbol | Function | Type | Description |
|---|---|---|---|---|
| %I0.0 | SB1_UP | Raise Button | DI | Joystick Raise, Normally Open (NO) |
| %I0.1 | SB2_DN | Lowering Button | DI | Joystick Lowering, Normally Open (NO) |
| %I0.2 | SB3_LT | Left Travel Button | DI | Joystick Left, Normally Open (NO) |
| %I0.3 | SB4_RT | Right Travel Button | DI | Joystick Right, Normally Open (NO) |
| %I0.4 | SQ1_UL | Upper Limit Switch | DI | Travel Switch / Proximity Switch, Normally Closed (NC) |
| %I0.5 | SQ2_DL | Lower Limit Switch | DI | Travel Switch / Proximity Switch, Normally Closed (NC) |
| %I0.6 | SB0_EST | Emergency Stop Button | DI | NC Contact,0=Trigger |
| %I0.7 | FR_OL | Thermal Overload Relay | DI | Thermal Overload Relay, Normally Closed (NC) |
| %I1.0 | OL1_OVLD | Overload Signal | DI | Overload Limiter Output, Normally Open (NO) |
| %I1.1 | RC_SEL | Remote Control/Joystick Switchoverr | DI | 0=Joystick 1=Remote Control |
| — | Analog Input: overload sensor(4~20mA0~20t) | |||
| Address | Symbol | Function | Type | Description |
|---|---|---|---|---|
| %Q0.0 | KM1_UP | Raise Contactor | DO | Raise Main Circuit Control Contactor |
| %Q0.1 | KM2_DN | Lowering Contactor | DO | Control Lowering Raise Main Circuit Control Contactor |
| %Q0.2 | KM3_LT | Left Travel Contactor | DO | Left Travel Main Circuit Control Contactor |
| %Q0.3 | KM4_RT | Right Travel Contactor | DO | Right Travel Main Circuit Control Contactor |
| %Q0.4 | KA1_ALM | Fault Alarm | DO | Drive Audible & Visual Alarm |
| %Q0.5 | KA2_RUN | running indicator light | DO | Greenrunning indicator light |
2. Ladder Logic Program Design
2.1 Main Program OB1 Architecture
OB1 is the main cyclic organization block, with a default scan time of 10 ms. The following function blocks (FCs) are called in sequence:
| Call Order | FCBlock | Function | Programming Language |
|---|---|---|---|
| 1 | FC100_Safety | safety interlock(Emergency Stop/Upper Limit Switch/Thermal Overload Relay/Overload) | LAD |
| 2 | FC200_Hoist Ctrl | Hoisting / Lifting Control Logic(Joystick Raise/Lowering/Interlock) | LAD |
| 3 | FC300_Travel Ctrl | Operation Control Logic(Joystick Left/Joystick Right/Interlock) | LAD |
| 4 | FC400_Fault Diag | Fault Diagnosis AND Alarm(SCL) | SCL |
2.2 Safety Interlock FC100 (LAD Ladder Diagram)
// FC100: Safety Interlock Logic // All Safety Conditions in Series——Operation Inhibited if Any Condition Not Met "SB0_EST" "SQ1_UL" "SQ2_DL" "FR_OL" "SafetyOK" ----|/|-------------|/|-------------|/|-------------|/|------------------------( ) // Overload Interlock:Only Lowering Allowed During Overload "OL1_OVLD" "SB2_DN" ----| |------------| |-----------------------------------------------------------( "Overload_DN_Only" ) // Overload Signal Reset(Manual Acknowledgment) "Overload_DN_Only" "SB1_UP" "Overload_Latch" ----| |-------------------| |----------------------------------------------------( )
2.3 Hoisting Control FC200 (LAD Ladder Diagram)
// FC200: Hoisting Control Logic // Hoisting Up:SafetyOK + Upper Limit Switch Not Triggered + Not Overloaded + Lowering Not Running + Hoist Up Button // Lowering:SafetyOK + Lower Limit Switch Not Triggered + Hoisting Not Running + Lowering Button(Only Lowering Permitted During Overload) "SafetyOK" "SQ1_UL" "Overload_Latch" "KM2_DN" "SB1_UP" "KM1_UP" ----| |-------------| |-------------|/|----------------|/|-----------| |----------( ) | | "KM1_UP" | ----| |----------------------------------------------------------------------------+ "SafetyOK" "SQ2_DL" "KM1_UP" "SB2_DN" "KM2_DN" ----| |-------------| |-------------------------------|/|-----------| |----------( ) | | "KM2_DN" | ----| |----------------------------------------------------------------------------+ // electrical interlock:KM1AndKM2Simultaneous Output Strictly Prohibited "KM1_UP" "KM2_DN" "Interlock_OK" ----| |-----------| |--------------( ) // For Fault Detection,Normally Open (Non-Conductive)
2.4 Delay Protection — Preventing Frequent Starts
// Frequent Starting Protection:Delay After Each Stop500msBefore Next Start is Permitted // Prevent Contactor from Chattering in Short Intervals(Contact Chatter/Arcing) "KM1_UP" ----|/|----------------------------------------------------------------------------- "KM2_DN" TON_Start_Delay ----|/|----------------[TON: #Temp_StartDelay ] PT= T#500MS Q= "Start_Allowed" // Incorporate into Main Control Circuit "Start_Allowed" "SB1_UP" "KM1_UP" // Hoisting Up ----| |----------------| |-----------( )
SCL Fault Diagnosis Code
3.1 FC400_FaultDiag (SCL Structured Text)
// FC400: Fault Diagnosis and Alarm // Language:SCL(Structured Text (ST)) // Function:Real-Time Equipment Status Monitoring,Detection13Fault Types,Output Fault Code toHMI FUNCTION FC400_FaultDiag : Void VAR_INPUT I_SafetyOK : Bool; // Safety Interlock Status I_KM1_UP : Bool; // Hoisting Contactor Feedback I_KM2_DN : Bool; // Lowering Contactor Feedback I_Overload_Latch : Bool; // Overload Lockout I_OL1_OVLD : Bool; // Overload Sensor Signal I_RunHours : Real; // Accumulated Running Time(Hours) END_VAR VAR_OUTPUT Q_FaultCode : Int; // Fault Code Output toHMI Q_FaultMsg : String[40]; // Fault Description Q_Alarm_Output : Bool; // Drive Audible & Visual Alarm Q_TotalRunHours : Real; // Total Running Time END_VAR VAR vFaultCount : Int; // Fault Counter vPrev_KM1 : Bool; // Hoisting Contactor Edge Detection vPrev_KM2 : Bool; // Lowering Contactor Edge Detection vOverloadTimer : Time; // Overload Duration END_VAR // === Fault Detection List === Q_FaultCode := 0; // Default No Fault Q_Alarm_Output := FALSE; vFaultCount := 0; // Default No Fault1:Emergency Stop Pressed IF I_SafetyOK = FALSE AND "SB0_EST" = FALSE THEN Q_FaultCode := 1; Q_FaultMsg := 'Emergency Stop Button Activated'; vFaultCount := vFaultCount + 1; END_IF; // Default No Fault2:Upper Limit Switch Triggered IF "SQ1_UL" = FALSE THEN Q_FaultCode := 2; Q_FaultMsg := 'Upper Limit Switch Triggered(Hook Distance to Drum Insufficient)'; vFaultCount := vFaultCount + 1; END_IF; // Default No Fault3:Lower Limit Switch Triggered IF "SQ2_DL" = FALSE THEN Q_FaultCode := 3; Q_FaultMsg := 'Lower Limit Switch Triggered(Insufficient Drum Wire Rope3Wraps)'; vFaultCount := vFaultCount + 1; END_IF; // Default No Fault4:Thermal Overload Relay Tripped IF "FR_OL" = FALSE THEN Q_FaultCode := 4; Q_FaultMsg := 'Motor Overload Protection(Thermal Overload Relay Activated)'; vFaultCount := vFaultCount + 1; END_IF; // Default No Fault5:overload IF I_Overload_Latch THEN Q_FaultCode := 5; Q_FaultMsg := 'Overload Limiter Activated(Load>110%)'; vFaultCount := vFaultCount + 1; END_IF; // Default No Fault6:KM1/KM2Simultaneous Energization(Contactor Welding/Sticking) IF I_KM1_UP AND I_KM2_DN THEN Q_FaultCode := 6; Q_FaultMsg := 'Critical Fault:High/Low Speed Contactors Simultaneously Energized'; vFaultCount := vFaultCount + 1; END_IF; // Default No Fault7:Contactor Feedback Mismatch(Output Command vs Feedback Mismatch) IF ("KM1_UP" = TRUE AND I_KM1_UP = FALSE) OR ("KM2_DN" = TRUE AND I_KM2_DN = FALSE) THEN Q_FaultCode := 7; Q_FaultMsg := 'Contactor Response Abnormal(Possible Mechanical Jamming/Coil Burnout)'; vFaultCount := vFaultCount + 1; END_IF; // If Any Fault Occurs,Drive Alarm Output IF vFaultCount > 0 THEN Q_Alarm_Output := TRUE; END_IF; // === Accumulated During Operation === Q_TotalRunHours := I_RunHours + (TIME_TO_REAL(TIME_NOW() - "Start_Time")) / 3600000.0; END_FUNCTION HMI Monitoring Screens and Communication Setup
4.1 HMI Variable Table and Screen Layout
| HMIScreen | Display Content | Link DBVariable |
|---|---|---|
| Main Screen | Equipment Status/Current Load/Running Time | DB1.Status / DB1.Load / DB1.Run Hours |
| Control Screen | Joystick Raise/Lowering/Joystick Left/Right Travel Virtual Button | Used for Manual/Auto Switchover |
| Fault Screen | Fault code/Description/Occurrence Time/Reset Button | DB1.Fault Code / DB1.Fault Msg |
| Parameter Screen | Overload Setpoint/Running Time Reset/Password Change | DB1.Overload_Set / DB1.Password |
4.2 PROFINET Communication Configuration (TIA Portal)
// Device Configuration Network Parameters // 1. S7-1200 CPU 1212C // IP: 192.168.0.10 // Subnet Mask: 255.255.255.0 // PROFINETDevice Name: plc-hoist-01 // 2. KTP400 Basic HMI // IP: 192.168.0.20 // Subnet Mask: 255.255.255.0 // Device Name: hmi-hoist-01 // 3. HMIConnection Configuration(InHMISet in Configuration) // Connection Type type: PROFINET (S7-1200) // HMIDevice: HMI_1 [192.168.0.20] // Controller: plc-hoist-01 [192.168.0.10] // Access Point: S7ONLINE // Subnet: PN/IE_1 // 4. HMIVariable Connection Example(PLC tag HMI tag) // "DB1".FaultCode "FaultCode" (Int, Acquisition Cycle500ms) // "DB1".Load_Current "Current Load"(Real, Acquisition Cycle200ms) // "DB1".Status_Running "IsRunning" (Bool, Acquisition Cycle100ms)
Program Download and Commissioning
5.1 Download Procedure
// Download Procedure(TIA Portal V17) // 1. Compile Entire Project(Project Build Rebuild All) // Ensure"0 errors, 0 warnings" // 2. Select Target Device(Select target device) // Online Access DetectedPLC AssignIP 192.168.0.10 // 3. Download Hardware Configuration(Download HW config) // Will Automatically RestartPLC(Approximately15Seconds) // 4. Download Software Program(Download SW) // Select"Download all blocks" Overwrite Existing Program // 5. Online Monitoring(Go online) // Click"Glasses"Icon to Enter Online Monitoring Mode // Observe Ladder Diagram Green Paths Conduct as Expected // 6. Force Variables(Force table)—— For Commissioning // Can Force Changes Without Physical Button OperationDIReal-Time Equipment Status Monitoring // e.g., Force%I0.0=1Simulate Hoist Up Button Pressed // Note:Clear All Forced Values After Commissioning
5.2 Commissioning Checklist
With the emergency stop pressed, all KM outputs read 0 and the Q0.4 alarm output reads 1.
With the emergency stop reset and the upper limit switch not triggered, pressing SB1 energizes KM1 and the motor lifts the load.
Releasing SB1 de-energizes KM1 and the motor stops.
During lifting, triggering the SQ1 upper limit switch immediately drops KM1.
While KM1 is energized, pressing SB2 must not energize KM2 (interlock confirmed).
With an overload signal present, lifting is inhibited; only lowering is permitted.
If start/stop commands arrive less than 500 ms apart, the second command is ignored (delay protection active).
The HMI fault screen displays the correct fault code and description.
The PROFINET connection remains stable (no alarm pop-ups on the HMI).
Frequently Asked Questions about Kelude Cranes
Q: What is the typical lead time for a custom overhead crane?
A: Standard cranes typically ship within 30-45 days. Custom-engineered solutions may require 60-90 days, depending on the complexity of the configuration and the current production schedule.
Q: Do you provide installation and commissioning services?
A: Yes, we offer full installation and commissioning services, either through our own technical team or through our certified local partners in the US and Europe. We also provide operator training and comprehensive after-sales support.
Q: What is the warranty period for Kelude cranes?
A: We provide a standard 12-month warranty from the date of commissioning, covering all manufacturing defects. Extended warranty options are available upon request.
Q: Can you supply spare parts for cranes from other manufacturers?
A: While our primary focus is on our own equipment, we do offer compatible spare parts for many common crane models. Please contact us with your specific requirements, and we will assess the feasibility.