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.

Electric hoist S7-1200 PLC control program architecture diagram

Hardware Configuration and I/O Allocation

1.1 Hardware Selection

EquipmentModelQuantityRemarks
PLC CPUS7-1200 1212C DC/DC/DC16ES7 212-1AE40-0XB0,8DI/6DO
Digital Input Expansion ModuleSM 1223 DI 8×24VDC / DO 8×24VDC16ES7 223-1BH32-0XB0
Analog Input Expansion ModuleSM 1231 AI 4×13bit16ES7 231-4HD32-0XB0,4~20mA
HMI Touch Screen (HMI)KTP400 Basic PN16AV6 647-0AD11-3AX0,4.3inch
Intermediate RelayRIM 24VDC 2CO6PLC DOContactor Coil Isolation
Switching Power SupplyEDR-120-241AC220VDC24V 5A

1.2 I/O Assignment Table

AddressSymbolFunctionTypeDescription
%I0.0SB1_UPRaise ButtonDIJoystick Raise, Normally Open (NO)
%I0.1SB2_DNLowering ButtonDIJoystick Lowering, Normally Open (NO)
%I0.2SB3_LTLeft Travel ButtonDIJoystick Left, Normally Open (NO)
%I0.3SB4_RTRight Travel ButtonDIJoystick Right, Normally Open (NO)
%I0.4SQ1_ULUpper Limit SwitchDITravel Switch / Proximity Switch, Normally Closed (NC)
%I0.5SQ2_DLLower Limit SwitchDITravel Switch / Proximity Switch, Normally Closed (NC)
%I0.6SB0_ESTEmergency Stop ButtonDINC Contact,0=Trigger
%I0.7FR_OLThermal Overload RelayDIThermal Overload Relay, Normally Closed (NC)
%I1.0OL1_OVLDOverload SignalDIOverload Limiter Output, Normally Open (NO)
%I1.1RC_SELRemote Control/Joystick SwitchoverrDI0=Joystick 1=Remote Control
Analog Input: overload sensor(4~20mA0~20t)
AddressSymbolFunctionTypeDescription
%Q0.0KM1_UPRaise ContactorDORaise Main Circuit Control Contactor
%Q0.1KM2_DNLowering ContactorDOControl Lowering Raise Main Circuit Control Contactor
%Q0.2KM3_LTLeft Travel ContactorDOLeft Travel Main Circuit Control Contactor
%Q0.3KM4_RTRight Travel ContactorDORight Travel Main Circuit Control Contactor
%Q0.4KA1_ALMFault AlarmDODrive Audible & Visual Alarm
%Q0.5KA2_RUNrunning indicator lightDOGreenrunning 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 OrderFCBlockFunctionProgramming Language
1FC100_Safetysafety interlock(Emergency Stop/Upper Limit Switch/Thermal Overload Relay/Overload)LAD
2FC200_Hoist CtrlHoisting / Lifting Control Logic(Joystick Raise/Lowering/Interlock)LAD
3FC300_Travel CtrlOperation Control Logic(Joystick Left/Joystick Right/Interlock)LAD
4FC400_Fault DiagFault 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

HMIScreenDisplay ContentLink DBVariable
Main ScreenEquipment Status/Current Load/Running TimeDB1.Status / DB1.Load / DB1.Run Hours
Control ScreenJoystick Raise/Lowering/Joystick Left/Right Travel Virtual ButtonUsed for Manual/Auto Switchover
Fault ScreenFault code/Description/Occurrence Time/Reset ButtonDB1.Fault Code / DB1.Fault Msg
Parameter ScreenOverload Setpoint/Running Time Reset/Password ChangeDB1.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.

Related News

contact

contact us

phone:
+86 13903802779

mail:3915269@qq.com

Working hours: Monday to Friday

Wechat
Wechat
SHARE
TOP