beautypg.com

3 macro operation – Delta Electronics Human Machine Interface DOP-A Series User Manual

Page 235

background image

Chapter 4 Macro Function|ScrEdit Software User Manual

4-14

Revision Apr. 30th, 2007, 2007PDD23000002

4.3 Macro

Operation

„

Definition

WORD

16 Bit data (It is made up of continuous 2 bytes, i.e. 16 bits, b15~b0. It can be used to

represent 0000~FFFF of hexadecimal system.

DWORD, DW 32 Bit data (It is made up of continuous 2 words, i.e. 32 bits, b31~b0. It can be used to

represent 00000000~FFFFFFFF of hexadecimal.)

BYTE

8 Bit data (It is made up of continuous 2 nibbles, i.e. 8 bits, b7~b0. It can be used to

represent 00~FF of hexadecimal system.)

Signed

A signed value is a numeric value with polarity. It means that the value is interpreted as

essentially the 'plus' sign that can be found in front of a positive number and the

'minus' sign that can be found in front of a negative number.

If DW shows after the macro command, it indicates that the command is 32 Bit data, if DW doesn’t

display, it indicates that the command is 16 Bit data. When the user set the format of the device as

Double Word, there will be two registers used actually. It means that if the user set the format of $0 as

Double Word, $0 and $1 will be used for storing data.

If Signed shows after the macro command, it indicates that the command is a numeric value with

polarity. If Signed doesn’t display, it indicates that it is a numeric value without polarity.

$10 = $13 + $15

16 Bit data operation, no polarity

$0 = $2 + $4 (DW)

32 Bit data operation, no polarity

$4 = FADD($4, 1.9) (Signed DW)

32 Bit data operation, with polarity

„

Arithmetic Operation

Arithmetic Operation divides into three parts: Integer Operation, Floating Point Operation and

Trigonometric Function Operation.

Each operand can be internal memory or constant. But it shall be internal memory only when outputting.

Please refer to following table 4.3.1 and examples below for more information.

Command

Equation

Description

Remark

+

V1=V2 + V2

Addition

-

V1=V2 - V3

Subtraction

*

V1 = V2 * V3

Multiplication

/

V1 = V2 / V3

Division

In

tege

r Op

era

tio

n

%

V1 = V2 % V3

Get Remainder

The calculation result
can be stored as signed
or unsigned WORD and
DWORD.
When the data exceeds
the length of designated
unit, the data out of
range will be discarded.
V1 can be internal
memory only.
V2 and V3 can be
internal memory or
constant.

This manual is related to the following products: