Siemens S7-300 Logic For Sorting Data Increment Order .
S7 SIMATIC MANAGER TRAINING CHAPTER -09
These chapters explain detail logic and all logical step for logic of sorting data in increment order .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 hare10 dec for our program.
Step 2: Create Function and write code in STL as given below.
STL CODE FOR SORTING DATA IN INCREMENT ORDER
A M 40.2 /// START SORTING CMD
JCN END
L 0
T MW 50 // STARTINNG LOCATION OF DATA
REOP: NOP 0
L MW 50
SLW 3
LAR1
OPN "DATA"
L DBB [AR1,P#0.0] // DATA 1ST LOCATIO
T MB 54
L DBB [AR1,P#1.0] /// DATA NEXT LOCATION
T MB 55
L MB 54
L MB 55
>I
JC CHNG //// DATA GREATER THENG CHENG
INC: L MW 50
L 1 // INCREASE LOACTION
+I
T MW 50
L MW 50
L 20 // IF DATA LOCATION IS EXCCED
<I // CHECK FOR NEXT LOCATION
JC REOP
JU END
CHNG: NOP 0
L MB 55
OPN "DATA"
T DBB [AR1,P#0.0] // INTER CHENG DATA
L MB 54
OPN "DATA"
T DBB [AR1,P#1.0]
JU INC
END: NOP 0
Step 3: write data in Data Block And Make Sort Start Cammand Hi.
Step 4: Use code as you required.
No comments:
Post a Comment