leflek
Member
Hello,
I have created the following code in step7
OPN "L1_Stage"
L P#810.0
T #Temp1
L 405
Stag: T #Count1
L #Temp1
L P#2.0
-D
T #Temp2
L DBW [#Temp2]
T DBW [#Temp1]
L #Temp2
T #Temp1
L #Count1
LOOP Stag
With this code i transfer all values in datablock "L1_Stage"
one position down and later in my program i put a new value in
the first position of this datablock. The datablock "L1_Stage"
contains int values.
I want to do the same thing with the following data block
Address Name Type
+0.0 C1 STRING[20]
+22.0 C2 STRING[20]
+44.0 C3 STRING[20]
+66.0 C4 STRING[20]
+88.0 C5 STRING[20]
+110.0 C6 STRING[20]
+132.0 C7 STRING[20]
+154.0 C8 STRING[20]
+176.0 C9 STRING[20]
+198.0 C10 STRING[20]
I have used the BLKMOV function because i can not use load
transfer instruction with data type string and it works
CALL "BLKMOV"
SRCBLK :="L1_ProfilCode".C1
RET_VAL:=#ret
DSTBLK :="L1_ProfilCode".C2
My question is how can i can use indirect addressing with the
funtion BLKMOV, so that i can use a loop to transfer all values of my datablock one position down.
Thanks
Lefteris
I have created the following code in step7
OPN "L1_Stage"
L P#810.0
T #Temp1
L 405
Stag: T #Count1
L #Temp1
L P#2.0
-D
T #Temp2
L DBW [#Temp2]
T DBW [#Temp1]
L #Temp2
T #Temp1
L #Count1
LOOP Stag
With this code i transfer all values in datablock "L1_Stage"
one position down and later in my program i put a new value in
the first position of this datablock. The datablock "L1_Stage"
contains int values.
I want to do the same thing with the following data block
Address Name Type
+0.0 C1 STRING[20]
+22.0 C2 STRING[20]
+44.0 C3 STRING[20]
+66.0 C4 STRING[20]
+88.0 C5 STRING[20]
+110.0 C6 STRING[20]
+132.0 C7 STRING[20]
+154.0 C8 STRING[20]
+176.0 C9 STRING[20]
+198.0 C10 STRING[20]
I have used the BLKMOV function because i can not use load
transfer instruction with data type string and it works
CALL "BLKMOV"
SRCBLK :="L1_ProfilCode".C1
RET_VAL:=#ret
DSTBLK :="L1_ProfilCode".C2
My question is how can i can use indirect addressing with the
funtion BLKMOV, so that i can use a loop to transfer all values of my datablock one position down.
Thanks
Lefteris