Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: Statement List (STL) to Find Highest Value
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > Statement List (STL) to Find Highest Value

Statement List (STL) to Find Highest Value

Last updated: March 4, 2021 12:07 pm
Editorial Staff
PLC Tutorials
No Comments
Share
4 Min Read
SHARE

This article explains the detail logic and all steps involved to find the Highest value in given Data block using the Statement List (STL). Also helps to you in array pointer logic in simatic manager.

Statement List (STL) to Find Highest Value

Follow the below setps.

Step 1:

Create Global Data Block write no of data in DB and save it.

Data you can save in dec, bin, int, real format.

We have written data here in dec for our program.

Insert Data Block as shown below.

Insert Data Block in Siemens S7 300

Step 2:

Create Data Value in the Data Block.

Create Data Value In Data Block

Step 3:

Insert Function

Insert Function in Siemens S7 300
FC1 Object Name

Step 4:

Create Function and write code in STL as given below.

      A     M     40.2                  /// START Search  CMD

      JCN   END

      L     0

      T     MW    50                    // STARTINNG LOCATION OF DATA

      T     MW    56

REOP: NOP   0

      L     MW    50

      SLW   3

      LAR1  

      OPN   "DATA"

      L     DBB [AR1,P#0.0]             // DATA 1ST LOCATIO

      L     MB    56

      >I    

      JC    STR                         //// DATA GREATER THEN CHENG

INC:  L     MW    50

      L     1                           // INCREASE LOACTION 

      +I    

      T     MW    50

      L     MW    50

      L     21                          // IF DATA LOCATION IS EXCCED

      <I                                // CHECK FOR NEXT LOCATION

      JC    REOP

      JU    END

STR:  NOP   0

      L     MW    50

      SLW   3

      LAR1  

      OPN   "DATA"

      L     DBB [AR1,P#0.0]

      T     MB    56

      JU    INC

END:  NOP   0

Statement List (STL) to Find Highest Value in the Data Block

Statement List (STL) to Find Highest Value in the Data Block

Step 5:

Start search command by using bit M40.2 = True

You can gate Highest value of given data in MW56

STL Code to find Maximum Value

Author: Rahul khaladkar

If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

  • Memory Structure of Siemens
  • Function Block for Motor Logic
  • FIFO Instruction in Allen Bradley
  • Troubleshoot Siemens Program
  • Types of Interrupt OB in Siemens
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !

Continue Reading

PLC Selective Execution of the Application – Example Program
PLC Packing Machine Control System Program in XG5000
Typical HMI Screen Design for Water Treatment Plant
PLC FBD Programming for Burglar Alarm Security System
T-Junction Traffic Control System – PLC Programming
Configuration of Siemens VFD Using TIA Portal Start drive
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

Conveyor Speed Logic using Structured Text in PLC
PLC SCL Program for Marking Machine
What is Profinet and How to Configure in Siemens PLC?
How to Configure PID in Siemens PLC?
Types of SCADA System Architecture
Why 24 Volts DC Power Supply is used? – Industrial Automation Systems
Toggle Switch & Sensor: Conveyor and Puncher PLC Program
Factory I/O PLC Automation Training Course (Free)

Keep Learning

How to Select a SCADA for New Project

How to Select a SCADA for New PLC Project?

Car Parking System PLC Program Example

Schneider Electric: Car Parking System with Calculations in PLC

Free Omron PLC Programming Course in HINDI

Free Omron PLC Programming Course in HINDI

Basics of PID Controllers

PID Controllers in Closed Loop Control Systems – PLC Basics

DC Circuit

Main differences between Sinking and Sourcing Circuits

JMP instruction in PLC Programming

How to use JUMP Instruction in PLC Ladder Logic?

Introduction to PLC

#9 PLC Best Practices – Validate indirections

Ladder Logic Example of Two Motors

Ladder Logic Example of Two Motors Interlinked with another Motor

Learn More

What is Zero Trust Security

How a Single ZTNA Solution Can Help Overcome Cybersecurity Issues?

PID control block located in fieldbus transmitter

Foundation Fieldbus Device addressing

Gas Turbine Temperature Control using Siemens Tia Portal

Gas Turbine Temperature Alarms using Siemens TIA Portal

Basic Terms used in SIL Verification

Basic Terms used in SIL Verification

Sensors & Transducers Questions and Answers

Top 100 Sensors & Transducers Questions and Answers for Freshers

Electrical Machines Questions and Answers

Synchronous Machines EMF Polygon Questions

Levels in Industrial Automation

Five Levels in Industrial Automation

PLC Logic to identify empty bottles in Packing

Automatic Empty Bottle detection using PLC Logic

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?