Technical Forum

STEP 7 / STEP 7 Lite

L Memory

Thread Starter: Saradhi   Started: 6/25/2012 12:30 PM   Replies: 4

« Previous thread Next thread »
Page 1 of 1 (5 items)
  6/25/2012, 12:30 PM
Joined 5/11/2011
Last visit: 5/18/2013
Posts: 165
Rating:
Rated: Good [1 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Dear All,
            How to use of l Memory for IM151-8 CPU, Is the L memory is global like M memory area (or) we can create multiple L memory areas.

that means if i use L0.0 in FC1 and again I use L0.0 in FC2. is this give any conflict or not.
Top
  6/25/2012, 4:40 PM
Joined 10/31/2005
Last visit: 5/24/2013
Posts: 2092
Rating:
Rated: Excellent [4.08 out of 5 / rated 200 time(s)]. (200) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 

L area is local area. This area stores local data of OB and all FC/FB called from this OB. Assume you have OB1 (20 bytes of temp variables) and 2 FC each containing 2 bytes of local data. You call FC1 from OB1 and FC2 from FC1. Then local variable of FC would have absolute address LW22.

OB are grouped in priority classes. Each priority class has it's own L-stack.

Top
Thank you for this post from:
  6/27/2012, 10:55 AM
Joined 5/11/2011
Last visit: 5/18/2013
Posts: 165
Rating:
Rated: Good [1 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
I understood like this,

In OB i used L Memory upto L19.7
If i call FC1 from OB. FC1 automatically take L memory address from L20.0.
In FC1 i used L Memory upto L24.7
If i call FC2 from FC1. FC2 automatically take L memory address from L25.0.

Is this correct. 

I have one more doubt. is it possible call L Memory just like M memory
Top
  6/27/2012, 12:58 PM
Joined 10/31/2005
Last visit: 5/24/2013
Posts: 2092
Rating:
Rated: Excellent [4.08 out of 5 / rated 200 time(s)]. (200) 
Users with special expertise supervising conferences
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 

Quite correct if your FC1 and FC2 contain 4 bytes of TEMP variables each.

You can use absolute addressing to L area from inside of block. From outside this is strongly not recommended unless you know exactly what are you doing and why not to make it in more ordinary ways - like passing via IN/OUT.

Top
Thank you for this post from:
  6/29/2012, 6:43 AM
Joined 5/11/2011
Last visit: 5/18/2013
Posts: 165
Rating:
Rated: Good [1 out of 5 / rated 1 time(s)]. (1) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Thank You
Top
Page 1 of 1 (5 items)
Actions