S7 SIMATIC MANAGER TRAINING CHAPTER
-08
Siemens
S7-300 Logic For FIND HIGHET VALUE IN DATA .
These
chapters explain detail logic and all logical step for find Highest value in given Data .also helps to you for array pointer logic in simatic manager.
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 write data hare15 dec for our program.
Inseart Data Block.
Create Data Value In Data Block.
Inseart Fuction.
Step 2: 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
Step 3: Start serch cammand by make hi bit M40.2
You
can gate Highest value of given data in mw56
No comments:
Post a Comment