Introduction

Add to My manuals
704 Pages

advertisement

Introduction | Manualzz

Chapter 7 Move/Logical Instructions (MOV, MVM, BTD, MVMT, BTDT, CLR, SWPB, AND, OR, XOR, NOT, BAND, BOR, BXOR, BNOT) postscan

Enter an immediate mask value

When you enter a mask, the programming software defaults to decimal values.

If you want to enter a mask using another format, precede the value with the correct prefix.

Prefix

16#

8#

2#

Description

hexadecimal for example; 16#0F0F octal for example; 8#16 binary for example; 2#00110011

Arithmetic Status Flags

Arithmetic status flags are affected.

Fault Conditions

none

Execution:

Condition

prescan rung-condition-in is false rung-condition-in is true

Relay Ladder Action

The rung-condition-out is set to false.

The rung-condition-out is set to false.

The instruction passes the Source through the Mask and copies the result into the Destination. Unmasked bits in the Destination remain unchanged.

The rung-condition-out is set to true.

The rung-condition-out is set to false.

286

Publication 1756-RM003K-EN-P - July 2008

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Move/Logical Instructions (MOV, MVM, BTD, MVMT, BTDT, CLR, SWPB, AND, OR, XOR, NOT, BAND, BOR, BXOR, BNOT) Chapter 7

Example:

Copy data from value_a to value_b, while allowing data to be masked (a 0 masks the data in value_a).

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0

0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1

The shaded boxes show the bits that changed in value_b.

Relay Ladder

Structured Text

value_b := (value_b AND NOT (mask_2)) OR

(value_a AND mask_2);

Publication 1756-RM003K-EN-P - July 2008

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

287

advertisement

Related manuals

advertisement

Table of contents