6.26. COP(Copy data) Copy
6.26. COP(Copy data):Copy
Symbol | |
Relay combination | |
Factor | src: Source relay or value to be filled with (const). dst: Destination relay len: Length relay (or Number). |
Description | If Rung is activated, copy the values from src to dst as many as the number of len. If src is a number, src value will be filled as many as the number of len from dst. In this case, when the dst is bit type, if src number is 0, OFF or else ON will be filled. If src is relay, the data type of src and dst should match. For example, if src is bit, dst should be bit, if src is byte(B), dst should be byte(B), if src is word(W) then dst should be word(w) as well. If src+len is greater than the maximum number of src relay, or if dst+len is greater than the maximum number of dst relay, copy will only progress until the maximum number of relay. |
Usage example | Example for designated number of copy) COP(X2,Y3,4): Y3=X2, Y4=X3, Y5=X4, Y6=X5 COP(XB2,YB3,3): YB3=XB2, YB4=XB3, YB5=XB4 COP(XW2,YW3,2): YW3=XW2, YW4=XW3
Example for filling up with the designated value(const) COP(0,Y3,4): Y3=OFF, Y4=OFF, Y5=OFF, Y6=OFF COP(1,Y3,4): Y3=ON, Y4=ON, Y5=ON, Y6=ON COP(25,Y3,4): Y3=ON, Y4=ON, Y5=ON, Y6=ON COP(25,YB3,3): YB3=25, YB4=25, YB5=25 COP(&H55AA,YW3,2): YW3=&H55AA, YW4=&H55AA COP(0,MW3,50): MW3=0, MW4=0, MW5=0, MW6=0, ~, MW52=0 |