Hi All,
which the best way to do the indirect addressing in an optimize DB?
Ccurrently this is my partial code inside an FB:
#StartMotorCommand.%X0 := #MotorsDelay[0].Q;
#StartMotorCommand.%X1 := #MotorsDelay[1].Q;
#StartMotorCommand.%X2 := #MotorsDelay[2].Q;
........ and so on till
#StartMotorCommand.%X31 := #MotorsDelay[31].Q
All data are declared as static inside the FB........
Now I'm looking to reduce this part of code by means a loop like this:
FOR i:= 0 TO 31 DO:
#StartMotorCommand.%X:=#MotorsDelay.Q;
END_FOR;
Obviously the syntax .%X is unacceptable.
What could be the solution to do this?
Is necessary use the PEEK/POKE instructions or there are other way
to avoid making 32 moves?
Thanks in advance for your reply and tips
which the best way to do the indirect addressing in an optimize DB?
Ccurrently this is my partial code inside an FB:
#StartMotorCommand.%X0 := #MotorsDelay[0].Q;
#StartMotorCommand.%X1 := #MotorsDelay[1].Q;
#StartMotorCommand.%X2 := #MotorsDelay[2].Q;
........ and so on till
#StartMotorCommand.%X31 := #MotorsDelay[31].Q
All data are declared as static inside the FB........
Now I'm looking to reduce this part of code by means a loop like this:
FOR i:= 0 TO 31 DO:
#StartMotorCommand.%X:=#MotorsDelay.Q;
END_FOR;
Obviously the syntax .%X is unacceptable.
What could be the solution to do this?
Is necessary use the PEEK/POKE instructions or there are other way
to avoid making 32 moves?
Thanks in advance for your reply and tips