Omron CJ - PROGRAMMING MANUAL 12-2009 Programming Manual page 254

Programmable controllers
Table of Contents

Advertisement

File Memory
1,2,3...
Item
Converting unsigned decimal to 4-digit
Function
DEC2HEX(cell_location,4)
used
Example
Input 10 in decimal and convert to 000A in 4-digit
hexadecimal.
Item
Converting signed decimal to 4-digit hexadecimal
Function
DEC2HEX(IF(0<=cell_location,cell_location,65536+
used
cell_location),4)
Example
Input -10 in decimal and convert to FFF6 in 4-digit
hexadecimal.
Data Files Transferred
Automatically at Startup
214
• Input 4 characters in each cell if single-word fields are being used or 8
characters if double-word fields are being used. For example, if single-
word fields are being used input 000A, not just A.
• Be sure to input only hexadecimal characters (0 to 9, A to F, or a to f) in
the cells. Other characters and codes cannot be used.
When you want to store hexadecimal digits in I/O memory, it is helpful to con-
vert the spreadsheet's decimal inputs to hexadecimal. Use the following pro-
cedure to convert to hexadecimal.
1. Select Add-Ins... from the Tools Menu.
2. Select Analysis ToolPak in the Add-Ins Menu.
3. Select Function from the Insert Menu at the cell where the function will be
used.
4. Select DEC2HEX (number, digits) from Engineering in the Category
Field.
5. When converting to 4-digit hexadecimal, input the following at the number
variable: IF(0<=cell location,cell location,65535+cell location)
When converting to 8-digit hexadecimal, input the following at the number
variable: IF(0<=cell location,cell location,4294967296+cell location)
• Example 1: Inputting non-negative decimal values.
hexadecimal
• Example 2: Inputting signed decimal values.
<
There are 6 kinds of files that are transferred automatically at startup when
the automatic transfer at startup function is being used.
Data file
Data file starting at
D20000 (See note.)
Data file starting at
D00000
Data file starting at
E@_20000
Converting unsigned decimal to 8-digit
DEC2HEX(cell_location,8)
Input 10 in decimal and convert to 0000000A in
8-digit hexadecimal.
Converting signed decimal to 8-digit hexadecimal
DEC2HEX(IF(0<=cell_location,cell_location,
4294967296+cell_location),8)
Input -10 in decimal and convert to FFFFFFF6 in 8-
digit hexadecimal.
Transferring with the
parameter file
AUTOEXEC.IOM
ATEXECDM.IOM
ATEXECDM.IOM
Section 5-1
hexadecimal
<
Transferring without the
parameter file
REPLACE.IOM
REPLCDM.IOM
REPLCDM.IOM

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents