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.

6.22 Flag sema<br />

Syntax<br />

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

sema(&flag)<br />

&flag: Address of the flag byte.<br />

Used for an uninterruptible instruction such as Test and Set to set the byte at address & flag to 0x80 (-128).<br />

This <strong>function</strong> is used when several tasks share the same resource (e.g. keyboard, screen, etc.).<br />

Return code<br />

Flag State<br />

0: The flag was free.<br />

1: The flag was already set.<br />

Programming error causing a CPU fault<br />

Access to a prohibited address:<br />

- &flag parameter error.<br />

6.23 Set One or More Bytes setb<br />

Syntax<br />

setb(&dest, b, n)<br />

&dest: Destination address.<br />

b: Value of the byte to be set.<br />

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

Sets n bytes to the value b starting at address &dest.<br />

Example of Use<br />

setb(%M120.&, %V100.B & Ox7f, 3)<br />

%V100.B & 0x7F<br />

Bit 7 Bit 0<br />

Bit 7 Bit 0<br />

Bit 7 Bit 0<br />

%M120.B<br />

%M121.B<br />

%M122.B

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

Saved successfully!

Ooh no, something went wrong!