Omron SYSMAC CS Series Instruction & Reference Manual page 546

Hide thumbs Also See for SYSMAC CS Series:
Table of Contents

Advertisement

3. Instructions
Flags
Name
Error Flag
Equals Flag
Negative Flag
Function
MAXF(176) searches the range of memory from R1 to R1+(2W-1) for the maximum single-precision
floating-point value (32-bit according to IEEE 754) in the range and outputs that maximum value to D
and D+1.
When bit 14 of C+1 has been set to 1, MAXF(176) writes the PLC memory address of the lower word of
the words containing the maximum value to IR0. (If two or more double words within the range contain
the same maximum value, the address of lower word of the first double word containing the maximum
value is written to IR0.)
Hint
Refer to the description of MAXL(174) for information on saving and restoring values in Index Registers
and information on background processing.
Example Programming
When CIO 0.00 turns ON in the following example, a table of four single-precision floating-point values
starting at D0 is searched for the maximum value.
The maximum value is stored in W0 and W1.
512
Label
P_ER
• ON if the length of the table specified in C (bits 00 to 15) is not between 0001 and FFFF hex.
• ON if the table data is nonnumeric.
• OFF in all other cases.
P_EQ
• ON if the maximum value is 0.
• OFF in all other cases.
P_N
• ON if the maximum value is negative.
• OFF in all other cases.
PLC memory address
R1
R1+1
Lower 16 bits of A
m
Upper 16 bits of A
R1+ (2W−1)
R1+ (2W−2)
0.00
MAXF
Table length: 4
#00000004
PLC memory address not output to IR0
D0
W0
D1-D0
+9.18
D3-D2
-3000.0
D5-D4
+10000.0
D7-D6
-12.15
W1-W0
Operation
C
W
W × 2 words (W = bits 00 to 15 of C)
Lower 16 bits of A
D
D+1
Upper 16 bits of A
IR0
m
Maximum value
+10000.0
CS/CJ/NSJ Series Instructions Reference Manual (W474)

Advertisement

Table of Contents
loading

Table of Contents