Macro Operation; Arithmetic Operation - Delta Electronics A10 User Manual

Dop series hmi
Hide thumbs Also See for A10:
Table of Contents

Advertisement

Chapter 4 Macro Function|ScrEdit Software User Manual
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
$0 = $2 + $4 (DW)
$4 = FADD($4, 1.9) (Signed DW)

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
+
-
*
/
%
4-14
Equation
V1=V2 + V2
V1=V2 - V3
V1 = V2 * V3
V1 = V2 / V3
V1 = V2 % V3
16 Bit data operation, no polarity
32 Bit data operation, no polarity
32 Bit data operation, with polarity
Description
The calculation result
Addition
can be stored as signed
or unsigned WORD and
DWORD.
Subtraction
When the data exceeds
the length of designated
unit, the data out of
Multiplication
range will be discarded.
V1 can be internal
Division
memory only.
V2 and V3 can be
internal memory or
Get Remainder
constant.
Revision Apr. 30th, 2007, 2007PDD23000002
Remark

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents