Error RLI when I try to tranfer code from S5 to S7,STL Siemen PLC

rtiger

Member
Join Date
Jan 2014
Location
TP Ho Chi Minh
Posts
14
FUNCTION FC 34 : VOID
AUTHOR: _48011
NAME: DATUMW // DAT UM W
VAR_INPUT
DBQL :word; // DBQL
AAQL :word; // AAQL
EAQL :word; // EAQL
DBZL :word; // DBZL
AAZL :word; // AAZL
END_VAR
VAR_TEMP
conv_ret_val :int;
END_VAR
BEGIN
NETWORK
L 0;
T MB 220;
L #DBQL;
T MW 222;
L 2;
L MB 223;
>I;
S M 220.0;
JC M001;
L #DBZL;
T MW 224;
L 2;
L MB 225;
>I;
S M 220.3;
JC M001;
L #EAQL;
L #AAQL;
-I;
L 254;
>I;
= M 220.7;
JC M001;
TAK;
L 0;
<I;
= M 220.6;
JC M001;
TAK;
INC 1;
T MW 254;
L W#16#E;
T MW 230;
AN M 222.0;
JC M002;
L W#16#EE00;
T MW 232;
JU M003;
M002:L W#16#EC00;
T MW 232;
M003:L MD 230;
L MB 223;
+D;
// LIR 1;
// *** Error in Line 2167 (FB 217): Command not defined. ***
T MW 240;
L 0;
==I;
= M 220.1;
JC M001;
L MW 240;
SLD 4;
+ L#-1;
// LIR 1;
// *** Error in Line 2177 (FB 217): Command not defined. ***
+ -6;
L #EAQL;
<I;
= M 220.2;
JC M001;
L MW 240;
SLD 4;
+D;
T MD 226;
AN M 224.0;
JC M004;
L W#16#EE00;
T MW 232;
JU M005;
M004:L W#16#EC00;
T MW 232;
M005:L MD 230;
L MB 225;
+D;
// LIR 1;
// *** Error in Line 2198 (FB 217): Command not defined. ***
T MW 240;
L 0;
==I;
= M 220.4;
JC M001;
L MW 240;
SLD 4;
+ L#-1;
// LIR 1;
// *** Error in Line 2208 (FB 217): Command not defined. ***
+ -5;
T MW 242;
L #AAZL;
L MW 254;
+I;
T MW 244;
L MW 242;
>I;
= M 220.5;
JC M001;
L MW 244;
+ -1;
L MW 240;
SLD 4;
+D;
T MD 236;
L MD 226;
L MD 236;

//CALL SFC 20 (
// SRCBLK := P#????? WORD 0,
// RET_VAL := conv_ret_val,
// DSTBLK := P#????? WORD 0
// );
// *** Error in Line 2233 (FB 217): CALL SFC20 generated. Please complete parameter list. ***

M001:NOP 0;

END_FUNCTION
I try to tranfer code from S5 to S7,and I received the code below,
I can not fix it
error LRI
 
Last edited:
The LIR instruction does not exist in step 7. You have to analyze the program.

L MD230 / / load in ACCU1 the contents of MD230 (32-bit)
L MB223
+D / / sum the content of MB223 (8 bits)

in ACCU 1 is the result of the sum.

LIR 1 / / Load the from memory addressed by the high word of ACCU 1
 
I know LIR instruction does not exist in step 7,I try to find the way convert it to S7
:),How can I fix it and error CALL SFC 20 (?
thanks you
 
Dear rtiger,
I suggest you to use indirect addressing...
S5 S7
LIR [0..15] LAR 1 or 2
TIR [0..15] L "x" [AR1, P#"n","n"]
Where "x" can be I or M or DB, etc. and "n" is the start address on register..

Regards.
 
Dear rtiger,
I suggest you to use indirect addressing...
S5 S7
LIR [0..15] LAR 1 or 2
TIR [0..15] L "x" [AR1, P#"n","n"]
Where "x" can be I or M or DB, etc. and "n" is the start address on register..

Regards.

Code:
      L     0
      T     MB   220
      L     #DBQL
      T     MW   222
      L     2
      L     MB   223
      >I    
      S     M    220.0
      JC    M001
      L     #DBZL
      T     MW   224
      L     2
      L     MB   225
      >I    
      S     M    220.3
      JC    M001
      L     #EAQL
      L     #AAQL
      -I    
      L     254
      >I    
      =     M    220.7
      JC    M001
      TAK   
      L     0
      <I    
      =     M    220.6
      JC    M001
      TAK   
      INC   1
      T     MW   254
      L     W#16#E
      T     MW   230
      AN    M    222.0
      JC    M002
      L     W#16#EE00
      T     MW   232
      JU    M003
M002: L     W#16#EC00
      T     MW   232
M003: L     MD   230
      L     MB   223
      +D    
      LAR1                              // *** Error in Line 2167 Solved ***
      T     MW   240
      L     0
      ==I   
      =     M    220.1
      JC    M001
      L     MW   240
      SLD   4
      +     L#-1
      LAR1                              // *** Error in Line 2177 Solved ***
      +     -6
      L     #EAQL
      <I    
      =     M    220.2
      JC    M001
      L     MW   240
      SLD   4
      +D    
      T     MD   226
      AN    M    224.0
      JC    M004
      L     W#16#EE00
      T     MW   232
      JU    M005
M004: L     W#16#EC00
      T     MW   232
M005: L     MD   230
      L     MB   225
      +D    
      LAR1                              // *** Error in Line 2198 Solved ***
      T     MW   240
      L     0
      ==I   
      =     M    220.4
      JC    M001
      L     MW   240
      SLD   4
      +     L#-1
      LAR1                              // *** Error in Line 2208 Solved ***
      +     -5
      T     MW   242
      L     #AAZL
      L     MW   254
      +I    
      T     MW   244
      L     MW   242
      >I    
      =     M    220.5
      JC    M001
      L     MW   244
      +     -1
      L     MW   240
      SLD   4
      +D    
      T     MD   236
      L     MD   226
      L     MD   236

      CALL  "BLKMOV"
       SRCBLK :=P#M 236.0 WORD 10              // Insert the correct address of Source
       RET_VAL:=#conv_ret_val
       DSTBLK :=P#M 240.0 WORD 10              // Insert the correct address of destination.


M001: NOP   0
 
:rolleyes: Hold on a second!

I'm afraid that it is not that simple. The EE00 / EC00 are probably the RAM adresses of certain M/ DB / DX / IO areas in your S5CPU, and should NOT be used in the converted code.

If you post the original S5 project, we could have a look at it for you, and give better suggestions how you can replace this particular FB.


Kalle
 
Here is my original code S5 :)
thanks ku
# D 217
#BI 48011
#N DAT UM W
DBQL (D )
AAQL (D )
EAQL (D )
DBZL (D )
AAZL (D )
L KB 0
T FY 220
L = DBQL
T FW 222
L KB 2
L FY 223
>F
S F 220.0
JC = M001
L = DBZL
T FW 224
L KB 2
L FY 225
>F
S F 220.3
JC = M001
L = EAQL
L = AAQL
-F
L KB 254
>F
= F 220.7
JC = M001
TAK
L KB 0
<F
= F 220.6
JC = M001
TAK
I 1
T FW 254
L KH E
T FW 230
AN F 222.0
JC = M002
L KH EE00
T FW 232
JU = M003
M002 L KH EC00
T FW 232
M003 L FD 230
L FY 223
+D
LIR 1
T FW 240
L KB 0
!=F
= F 220.1
JC = M001
L FW 240
SLD 4
ADD DH FFFFFFFF
LIR 1
ADD BN -6
L = EAQL
<F
= F 220.2
JC = M001
L FW 240
SLD 4
+D
T FD 226
AN F 224.0
JC = M004
L KH EE00
T FW 232
JU = M005
M004 L KH EC00
T FW 232
M005 L FD 230
L FY 225
+D
LIR 1
T FW 240
L KB 0
!=F
= F 220.4
JC = M001
L FW 240
SLD 4
ADD DH FFFFFFFF
LIR 1
ADD BN -5
T FW 242
L = AAZL
L FW 254
+F
T FW 244
L FW 242
>F
= F 220.5
JC = M001
L FW 244
ADD BN -1
L FW 240
SLD 4
+D
T FD 236
L FD 226
L FD 236
DO FW 254
TNW 0
M001 BE
 
:rolleyes: Hold on a second!

I'm afraid that it is not that simple. The EE00 / EC00 are probably the RAM adresses of certain M/ DB / DX / IO areas in your S5CPU, and should NOT be used in the converted code.

If you post the original S5 project, we could have a look at it for you, and give better suggestions how you can replace this particular FB.


Kalle

Kalle is right,EE00/EC00 is ram address of certanin DB /DX areas in S5 CPU
This is link of CPU948 of S5
Code:
http://www.mediafire.com/view/12oa24236co488g/948U.pdf
 
I'd like to see the calling block and the parameter values.

Kalle

I didn't analyze this thoroughly, but to me it looks just like a blocktransfer between different
data areas. There's a lot of plausibility checking before the transfer (TNW) is done.

The parameter names indicates the same:
DBQL: DB Quelle (source)
AAQL: AnfangsAdresseQuelle (source area start)
DBZL: DB Ziel (sink)
AAZL: AnfangsAdresseZiel (sink start area)

So you should be able to replase THE CALL of this block with a SFC20 call.
 
Last edited:
Dear rtiger,
I suggest you to use indirect addressing...
S5 S7
LIR [0..15] LAR 1 or 2
TIR [0..15] L "x" [AR1, P#"n","n"]
Where "x" can be I or M or DB, etc. and "n" is the start address on register..

Regards.

How can I find
SRCBLK := P#M 236.0 WORD 10, // correct add source
RET_VAL := conv_ret_val,
DSTBLK := P#M 240.0 WORD 10 ); // correct add destination
Correct address source and the correct address destination
 

Similar Topics

I am kind of new to GE products, but we have several in my area. I made a minor logic change and it verified good, but when I tried to download I...
Replies
5
Views
44
Hi, I'm currently having issued with a PowerFlex 252. It was working fine last week, and suddenly decided to stop working. When I go into...
Replies
2
Views
118
Hi there, I'm new to plc programming and was wondering why I get this error code when I run my simulation for these temperature sensors? What I'm...
Replies
2
Views
88
Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
16
Views
400
Hello Everyone, I have a issue with communication between two different PLCs. So here is the facts, The Master PLC is Guard Logix 5069 with IP...
Replies
4
Views
124
Back
Top Bottom