Move data to different address(Siemens S7-300)

Eric.shen

Member
Join Date
Dec 2009
Location
asa
Posts
4
Hello all,

If I wanna move a value (20) to DB200.DBW10, DB200.DBW20.....DB200.DBW200

how can I make it happen by using a ladder or STL ??
what instruction do I need to use??

I got a 100 step recipes in DB200, I need to updated the values when the MP377 (HMI) give me 4 values as below
1. Item number (1~12)
2. Step initial(1~100) and Step end (1~100)
3. Value ( this contains Int or Real, depend on which item been selected)
Thank you ~~
 
Here's the source code for an FC that will do the job and an example call.

Code:
FUNCTION FC 1 : VOID
TITLE =
VERSION : 0.1

VAR_INPUT
  iFillValue : INT ; 
  pStartPoint : POINTER ; 
  iBytesBetweenEntries : INT ; 
  iNoOfEntries : INT ; 
END_VAR
VAR_TEMP
  iDBNumber : INT ; 
  iLoopCount : INT ; 
  dwOffset : DWORD ; 
END_VAR
BEGIN
NETWORK
TITLE =
      L     #iBytesBetweenEntries; 
      SLD   3; 
      T     #dwOffset; 
      L     P##pStartPoint; 
      LAR1  ; 
      L     W [AR1,P#0.0]; 
      T     #iDBNumber; 
      OPN   DB [#iDBNumber]; 
      L     D [AR1,P#2.0]; 
      LAR1  ; 
      L     #iNoOfEntries; 
L:    T     #iLoopCount; 
      L     #iFillValue; 
      T     W [AR1,P#0.0]; 
      L     #dwOffset; 
      +AR1  ; 
      L     #iLoopCount; 
      LOOP  L; 
      SET   ; 
      SAVE  ; 
END_FUNCTION

fill009008.JPG
 
TO About L D[AR2,P#0.0]

Thank you About L D[AR2,P#0.0]

I found it very useful, and how can I make the 100 step automatic put the input value into DB200 , if I choose 1 ~ 20 step , then it will put the input value into DB200.DBD0, DB200.DBD32, DB200.DBD64......DB200.DBD640 , automaticlly
How can I do this

Best Regards,

Eric
 

Similar Topics

How can I do this?? If I receive a initial step figure 10 and end step figure 20 from a HMI, how can I point these step into my DB200's step (100...
Replies
5
Views
3,135
there is another problem when I use the Function below: there are 100 step in the DB200 there are 12 items for each step: Step 1------------...
Replies
10
Views
4,421
RE:Another Q for Move data to different address(Siemens S7-300) Thank you again for this, However I wanna to ask about: If I receive a initial...
Replies
1
Views
2,584
Thank you About L D[AR2,P#0.0] I found it very useful, and how can I make the 100 step automatic put the input value into DB200 , if I choose 1 ~...
Replies
1
Views
1,851
Afternoon, I have a DB in TIA Portal V16 that is optimised. I cannot change this. There is an array inside that block which consists of 3000...
Replies
9
Views
1,156
Back
Top Bottom