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
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