Field fix / guidePLC / HMI Code & LogicVendor-agnostic (IEC 61131-3)Sorting Classificationindustrial-automation

Weight Classification — PLC Control Template

Shared by TSIMEREZIVO Team · 4 Oct 2026 · 45 views

# Weight Classification — Usage Guide ## Overview Simple three-band weight classification template using compare instructions and discrete route outputs. ## Commissioning 1. Set `SP_LOW` and `SP_HIGH` from product spec limits 2. Verify each weight band activates the expected route output 3. Add upstream scale diagnostics if the installation requires fault handling --- ## Control Logic — Vendor-Agnostic Pseudocode # Weight Classification — Logic ## Standards: IEC 61131-3 | ISA-5.1 | ISA-18.2 ## Scan Rate: 10ms | Pattern: compare instruction class assignment ``` ROUTINE: WeightClassification SCAN_RATE: 10ms // SECTION 1 — COMPARE BANDS IF SAMPLE_READY THEN IF WEIGHT_PV < SP_LOW THEN CLASS := 1 ELSIF WEIGHT_PV <= SP_HIGH THEN CLASS := 2 ELSE CLASS := 3 END_IF END_IF // SECTION 2 — ROUTE COMMANDS ROUTE_LOW_CMD := (CLASS = 1) ROUTE_OK_CMD := (CLASS = 2) ROUTE_HIGH_CMD := (CLASS = 3) // SECTION 3 — COUNTS IF SAMPLE_READY THEN CASE CLASS OF 1: COUNT_LOW := COUNT_LOW + 1 2: COUNT_OK := COUNT_OK + 1 3: COUNT_HIGH := COUNT_HIGH + 1 END_CASE END_IF // SECTION 4 — HMI HMI_CLASS := CLASS HMI_WEIGHT := WEIGHT_PV END_ROUTINE ``` --- ## Tag List ```csv Tag Name,Description,Data Type,Direction,Engineering Unit,Range Min,Range Max,Default Value,Address SAMPLE_READY,Sample Ready Pulse,BOOL,input,,,,FALSE,DI:0:0.0 WEIGHT_PV,Measured Weight,REAL,input,g,0,5000,0,AI:0:0.0 SP_LOW,Low Classification Threshold,REAL,internal,g,0,5000,90, SP_HIGH,High Classification Threshold,REAL,internal,g,0,5000,110, CLASS,Assigned Class,INT,internal,,0,3,0, ROUTE_LOW_CMD,Low Route Command,BOOL,output,,,,FALSE,DO:1:0.0 ROUTE_OK_CMD,OK Route Command,BOOL,output,,,,FALSE,DO:1:0.1 ROUTE_HIGH_CMD,High Route Command,BOOL,output,,,,FALSE,DO:1:0.2 COUNT_LOW,Low Count,DINT,internal,,0,999999,0, COUNT_OK,OK Count,DINT,internal,,0,999999,0, COUNT_HIGH,High Count,DINT,internal,,0,999999,0, HMI_CLASS,HMI: Assigned Class,INT,output,,0,3,0, HMI_WEIGHT,HMI: Weight,REAL,output,g,0,5000,0, ``` --- ## Alarm Matrix ```csv Alarm Tag,Condition,Setpoint,Priority,Type,Response,Delay,Auto Acknowledge ALM_NONE,No active alarms defined for compare-only template,N/A,low,diagnostic,Use upstream scale diagnostics if required.,0s,Yes ```

More like this

Rate, comment, and get full access

Members can download files, rate contributions, and discuss fixes with the engineers who posted them — free.

Join the library