Automationdirect.com DirectLOGIC DL205 Series User Manual page 479

Table of Contents

Advertisement

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

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF