Another Q for Move data to different address(Siemens S7-300)

Eric.shen

Member
Join Date
Dec 2009
Location
asa
Posts
4
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
what do I need to add into the below Program
Best Regards,

Eric


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
 
See below in red:

Code
___________________________________________
FUNCTION FC 2 : VOID
TITLE =
VERSION : 0.1

VAR_INPUT
rFillValue : REAL ;
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 #rFillValue;
T D [AR1,P#0.0];
L #dwOffset;
+AR1 ;
L #iLoopCount;
LOOP L;
SET ;
SAVE ;
END_FUNCTION
 

Similar Topics

Hello, I am trying to move a data DB2.DB Type String [10] to another DB1.DB Data Type String [10] in LAD or STL. Have anybody done this? Move/...
Replies
1
Views
1,826
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,422
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,586
Good Morning , I appreciate your help on a previous post.Your advice helped me understand more. My next question involves the same project...
Replies
8
Views
3,562
Good Morning , I am still trying to understand motion . I have a Kinetix 6000 system with about 14 Axis . This machine has a pusher that...
Replies
2
Views
2,381
Back
Top Bottom