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.
Follow the below setps.
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.
Create Data Value in the Data Block.
Insert Function
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
Start search command by using bit M40.2 = True
You can gate Highest value of given data in MW56
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:
Learn an example PLC program to control a pump based on level sensors using ladder…
In the PLC timer application for security camera recording, when motion is detected then camera…
In this example, we will learn batch mixing with PLC ladder logic program using timer…
This PLC example on manufacturing line assembly is an intermediate-level PLC program prepared for the…
In this article, you will learn the PLC programming example with pushbutton and motor control…
This article teaches how to convert Boolean logic to PLC programming ladder logic with the…