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.

General Purpose Functions<br />

6.34 Swap the Four Bytes of a Long Word swapl<br />

Syntax<br />

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

&dest: Destination address.<br />

&source: Source address.<br />

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

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

Example<br />

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

%M120.L<br />

%M124.L<br />

%M128.L<br />

Return code<br />

If OK<br />

Not significant.<br />

High byte<br />

MSBs<br />

High byte<br />

MSBs<br />

High byte<br />

MSBs<br />

Error<br />

-1: n negative or zero<br />

High byte<br />

LSBs<br />

High byte<br />

LSBs<br />

High byte<br />

LSBs<br />

Low byte<br />

MSBs<br />

Low byte<br />

MSBs<br />

Low byte<br />

MSBs<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 />

Low byte<br />

LSBs<br />

Low byte<br />

LSBs<br />

Low byte<br />

LSBs<br />

High byte<br />

MSBs<br />

High byte<br />

MSBs<br />

High byte<br />

MSBs<br />

High byte<br />

LSBs<br />

High byte<br />

LSBs<br />

High byte<br />

LSBs<br />

Low byte<br />

MSBs<br />

Low byte<br />

MSBs<br />

Low byte<br />

MSBs<br />

Low byte<br />

LSBs<br />

Low byte<br />

LSBs<br />

Low byte<br />

LSBs<br />

%M20.L<br />

%M24.L<br />

%M28.L<br />

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

6

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

Saved successfully!

Ooh no, something went wrong!