Example Program - Omron CJ - INSTRUCTIONS Reference Manual

Table of Contents

Advertisement

3. Instructions

Example Program

Example: The following example shows how to use CMND(490) to create a subdirectory in the Memory
Card.
0.00
A202.07
Network Instruction
Enabled Flag
(for port 7)
S:
D6
S+1:
D7
S+2:
D8
S+3:
D9
S+4:
D10
S+5:
D11
S+6:
D12
S+7:
D13
S+8:
D14
S+9:
D15
S+10:
D16
S+11:
D17
S+12:
D18
C:
D0
C+1:
D1
C+2:
D2
C+3:
D3
C+4:
D4
C+5:
D5
Hint
There are other FINS commands that can be sent to the local PLC in addition to the ones related to file
memory operations that are listed in the table above. The File Memory Operation Flag must be used to
prevent simultaneous execution of these other FINS commands, too.
Procedure
Reading/Writing a Data File on a Memory Card or Performing a File Memory
Operation
1.
Place a formatted Memory Card into the CPU Unit.
2.
Using the FWRIT(701) instruction, name a file in the specified I/O memory area and save the
data in the Memory Card.
Note To use the TXT or CSV data that was written to a Memory Card in spreadsheet software on a computer,
insert the Memory Card into an HMC-AP001 Memory Card Adapter mounted in a PC card slot of the
computer and used Windows to read the data.
Use the FREAD(700) instruction to read the data file from the Memory Card to I/O memory in the
CPU Unit and then manipulate the file in the Memory Card by using the CMND(490) to send a com-
mand to the local CPU Unit.
980
A343.13
File Memory
Operation Flag
Command code: 2215 Hex (CREATE/DELETE SUBDIRECTORY)
Disk number: 8000 Hex (Memory Card)
Parameter: 0000 Hex (Create subdirectory.)
Subdirectory name: CS1
(
: a space)
Directory length: 0006 Hex (6 characters)
Directory path: \OMRON
Number of bytes of command data: 001A Hex (26 bytes)
Number of bytes of response data: 0004 Hex (4 bytes)
Destination address: 0000 Hex (local network)
00 Hex (local node) and 00 Hex (CPU Unit)
Response requested, communications port 7, 0 retries
Response monitor time: FFFF Hex (6,553.5 s)
When 0 and A202.07 are ON and A343.13 is OFF,
CMND(490) issues FINS command 2215
(CREATE/DELETE SUBDIRECTORY) is sent to
D6
the local CPU Unit and the response is stored in
D100 and D101.
D100
In this case, the FINS command creates a
subdirectory named "CS1" within the OMRON
D0
directory in the CPU Unit's Memory Card. The
response is composed of the 2-byte command code
(2215) and the 2-byte response code.
.
CS/CJ/NSJ Series Instructions Reference Manual (W474)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents