DL205 User Manual, 4th Edition, Rev. B
5–262
Chapter 5: Intelligent Box (IBox) Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Math - Real (MATHR) (IB-541)
Math - Real Format lets you enter complex
mathematical expressions like you would in
Visual Basic, Excel, or C++ to do complex
calculations, nesting parentheses up to 4
levels deep. In addition to + - * /, you can do
Bit-wise And (&) Or (|) and Xor (^). The
DL260 also supports several Real functions -
Arc Cosine (ACOSR), Arc Sine (ASINR),
Arc Tangent (ATANR), Cosine (COSR),
Convert Radians to Degrees (DEGR), Invert
Bits (INV), Convert Degrees to Radians
(RADR), HEX to Seven Segment Display
(SEG), Sine (SINR), Square Root (SQRTR),
and Tangent (TANR).
Example: ((V2000 + V2002) / (V2004 - R2.5)) * SINR(RADR(V3000 / R10.0))
Every V-memory reference MUST be able to fit into a double-word Real formatted value.
MATHR Parameters
• Result (DWORD): specifies the location where the Real result of the mathematical expression will
be placed (result must fit into a double-word Real formatted location)
• Expression: specifies the mathematical expression to be executed and the result is stored in specified
Result (DWORD) location. Each V-memory location used in the expression must be in Real
format.
MATHR Example
In the following example, the MATHR instruction is used to calculate the math expression
which multiplies the REAL (floating point) value in V1200 by 10.5 then divides by 2.7 and
loads the resulting 32-bit value in V2000 and V2001 when C100 turns on.
Parameter
DL205 Range
DWORD Result . . . . . . . . . . . . . . . . . . . . . . . . V
See DL205 V-memory map - Data Words
Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Text
DS5 Used
HPP
N/A
ý
ý
þ
þ
230
240
2
5
0
-1
2
6
0