15.07.2013 Views

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

Automatic control function programming manual ladder language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

General Purpose Functions<br />

6.7 Copy One or More Bytes cpyb<br />

Syntax<br />

cpyb(&dest, &source, n)<br />

&dest: Destination address.<br />

&source: Source address.<br />

n: Number of bytes to be copied.<br />

Copies n bytes from the source to the destination.<br />

Direction of Transfer<br />

To allow transfers to memory areas which overlap, the order of copying depends on the &dest and &source addresses.<br />

- If &dest < &source, the copy is made from the beginning to the end (increasing addresses)<br />

- If &dest > &source, the copy is made from the end to the beginning (decreasing addresses).<br />

Example<br />

cpyb(%M120.&, %M20.&, 3)<br />

%M120.B<br />

%M121.B<br />

%M122.B<br />

Return code<br />

If OK<br />

0<br />

Error<br />

-1: n negative or zero<br />

Bit 7 Bit 0<br />

Bit 7 Bit 0<br />

Bit 7 Bit 0<br />

Bit 7 Bit 0<br />

Bit 7 Bit 0<br />

Bit 7 Bit 0<br />

%M20.B<br />

%M21.B<br />

%M22.B<br />

en-938846/7 6 - 9<br />

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!