Kkula
Browse Questions » SIMATIC S5 / STEP 5: s5 Towards s7 (LIR 2/TIR) Conversion Fault

About User

Questions Asked: 37.9K

Answers Given: 32

0
  • Open

SIMATIC S5 / STEP 5: s5 Towards s7 (LIR 2/TIR) Conversion Fault

S5 to S7 conversion.
Please help me.
S5 ProgramConversion S7 Program
L KH E410 L W#16#E410
CDB 4 OPN DB 4;
//;
LIR 2// LIR 2;
// *** Error in Line 2304 (FB 20): Command not defined. ***
TAK TAK;
T DW 3 T DBW 6;
=====================================================================
C DB 4 OPN DB 4;
L DW 0 L DBW 0;
L KH 00FF L W#16#FF;
AW AW;
SLW 1 SLW 1;
L DW 3 L DBW 6;
+F+I;
L DW 1L DBW 2;
TAK TAK;
//;
TIR 2 // TIR 2;
// *** Error in Line 2392 (FB 20): Command not defined. ***
//;
R F 90.2R M 90.2;
JU=M007JU M007;

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

S5 to S7 Conversion Assistance

Based on the provided S5 code snippet and error messages, here's a breakdown of common conversion issues and potential solutions:

Identified Issues & Corrections

  • CDB 4 OPN DB 4;: In S7, use CALL DB4 to access the data block.
  • LIR 2// LIR 2; & TIR 2 // TIR 2;: These are likely intended as immediate loading/transferring instructions. S7 uses LIR 2 and TIR 2 directly – the double slash (//) is unnecessary and may cause issues.
  • TAK TAK;: This instruction is generally correct in both S5 and S7.
  • T DW 3 T DBW 6;: This instruction appears valid for transferring data, double-check addressing.
  • L KH E410 L W#16#E410: This instruction appears valid for loading a constant, double-check addressing.
  • R F 90.2R M 90.2; & JU=M007JU M007; : These instructions appears valid but double-check addressing.

General Conversion Notes

  • Addressing Differences: S5 uses symbolic addressing (like `KH`, `DW`), while S7 often uses absolute addressing (like `W#16#...`, `DBW...`). Ensure correct translation.
  • Data Types: Verify data types are compatible during conversion (e.g., `INT`, `REAL`, `BOOL`).
  • Function Block Calls: S7 requires explicit `CALL` instructions for function block execution.

Resources

For detailed conversion guidance, refer to the Siemens documentation:

Disclaimer: This is a general assessment. A complete conversion requires a thorough analysis of the entire S5 program and careful consideration of the target S7 hardware and software configuration.

0