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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.33 Swap the Even and Odd Bytes of a Word swapw<br />

Syntax<br />

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

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

&dest: Destination address.<br />

&source: Source address.<br />

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

Copies n words from &source into &dest, swapping the even and odd bytes of each word.<br />

Example<br />

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

%M120.W<br />

%M122.W<br />

%M124.W<br />

Return code<br />

If OK<br />

Not significant.<br />

Error<br />

-1: n negative or zero<br />

MSBs LSBs<br />

MSBs<br />

LSBs<br />

Programming error causing a CPU fault<br />

Access to a prohibited address:<br />

- &dest parameter error,<br />

- &source parameter error,<br />

- &dest+n outside authorised area,<br />

- &source+n outside authorised area.<br />

%M20.W<br />

%M22.W<br />

%M24.W

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

Saved successfully!

Ooh no, something went wrong!