_CARD420_WriteAutoexecObj (1/3)
CARD Write Program File to be Transferred at Startup:
420
_CARD420_WriteAutoexecObj
Basic Automatically creates the [Link] program file (automatically transferred at startup) in the Memory
function Card.
Symbol Start Trigger _CARD420_WriteAutoexecObj
↑ (BOOL) (BOOL)
EN ENO
Busy Flag (BOOL)
FB Busy Flag
FB_BUSY
(BOOL)
FB Normal End
FB_OK
(BOOL) FB Error End
FB_NG
File name Lib\FBL\omronlib\PLC\Card\_CARD420_WriteAutoexecObj10.cxf
Applicable CPU Unit CS1*-CPU**H Unit version 3.0 or higher
models CJ1*-CPU**H Unit version 3.0 or higher
CJ1M-CPU** Unit version 3.0 or higher
CX-Programmer Version 5.0 or higher
Conditions CPU Unit Settings
for usage PLC Setup: Shared Settings for Communications Instructions in FBs
• Communications Instruction Response Timeout Time (default: 2 s)
• Number of retries (default: 3)
Shared Resources
• Memory Card
• Communications ports (internal logical ports)
Memory Card Status
• The Memory Card must be recognized by the CPU Unit.
The Memory Card Recognized Flag (A343.15) will be ON when CPU Unit has recognized the Memory
Card.
Function When the Start Trigger goes ON, the function saves the [Link] program file (automatically transferred
description at startup) to the Memory Card.
This function can be used to create the file that is automatically transferred at startup when the system is
set to automatically transfer the file from the Memory Card when the power is turned ON. When a file
already exists with the same name, that file will be overwritten.
After the file is created, its contents are verified.
FB • If the Memory Card is already being accessed when the FB is started, the operation will be performed
precautions after the completion of the access.
• The FB is processed over multiple cycles. The FB_BUSY output variable can be used to check whether
the FB is being processed.
• FB_OK or FB_NG will be turned ON for one cycle only after processing is completed. Use these flags to
detect the end of FB processing.
Timing Chart
Start Trigger ON
OFF
Busy Flag ON
OFF
Creating file Verifying file
Normal End or Error ON
End OFF
FB execution completed.
• It is not possible to start two of these function blocks at the same time. If this function block is used in
more than one place, be sure that the instances are not started simultaneously.
• Online editing cannot be performed while the file is being created.
• In order to use the Automatic Transfer at Startup function, the parameter file ([Link]) is required as
well as the program file ([Link]).
EN input Connect EN to an OR between an upwardly differentiated condition for the start trigger and the FB_BUSY
condition output from the FB.
Restrictions • Always use an upwardly differentiated condition for EN.
Input • If the input variables are out of range, the ENO Flag will turn OFF and the FB will not be processed.
variables
Output • This FB requires multiple cycles to process. Always connect an OR including the FB_BUSY output
variables variable to the EN input variable to ensure that the FB is processed to completion (see Symbol).
• Do not turn the FB_BUSY output variable ON or OFF outside the FB.
Other • If the Memory Card is missing or cannot be detected, the FB_NG Flag will be turned ON.
• Never turn OFF the Power Supply when the CPU Unit’s BUSY indicator (Accessing Memory Card
indicator) is lit.
Refer to the Related Manuals for other Memory Card precautions.
_CARD420_WriteAutoexecObj (2/3)
Application When bit A goes ON, the [Link] program file (transferred automatically at startup) is created in the
example Memory Card’s root directory.
Start Trigger
Bit A _CARD420_WriteAutoexecObj
(BOOL) (BOOL)
↑
EN ENO FB Busy Flag
FB Busy Flag (BOOL)
Bit B Bit B
FB_BUSY
FB Normal End
(BOOL)
Bit C
FB_OK
FB Error End
(BOOL)
Bit D
FB_NG
CPU Unit
User program
[Link]
Related Precautions when Using a Memory Card
manuals There are several precautions that must be observed when using Memory Cards.
This manual provides just an overview of the precautions.
For details, refer to 5-1 File Memory in the CS/CJ Series Programmable Controllers Programming Manual
(W394-E1).
1) Format
The Memory Card is already formatted when it is shipped, so it is not necessary to format a newly
purchased Card.
2) Number of Files allowed in Root Directory
There is a limit to the number of files that can be stored in the root directory of the Memory Card.
The maximum number of files depends on the Memory Card model and format, but it ranges between
128 and 512 files.
3) Maximum Number of Overwrites
A limit of 100,000 write operations has been set for warranty purposes. For example, if the Memory
Card is written to every 10 minutes, over 100,000 write operations will be performed within 2 years.
4) Turning the Power OFF
Never turn OFF the Power Supply when the CPU Unit’s BUSY indicator (Accessing Memory Card
indicator) is lit.
FINS Error code
CS/CJ Series Communications Commands Reference Manual (W342-E1)
5-1 Command Lists
5-1-3 End Codes
Variable Tables
Input Variables
Name Variable name Data type Default Range Description
EN EN BOOL 1 (ON): FB started
0 (OFF): FB not started.
Output Variables
Name Variable name Data type Range Description
ENO ENO BOOL 1 (ON): FB processed normally.
(May be omitted.) 0 (OFF): FB not processed or ended in an error.
FB Busy Flag FB_BUSY BOOL Automatically turns OFF when processing is
completed.
FB Normal end FB_OK BOOL Turns ON for one cycle when processing ends
normally.
FB Error end FB_NG BOOL Turns ON for one cycle when processing ends in an
error.
Turns ON when the result of the verification is FB_NG.
_CARD420_WriteAutoexecObj (3/3)
Internal Variables
Internal variables are not output from the FB.
If the FB_NG Flag turns ON, the following internal variables can be monitored to obtain information on the error.
Name Variable name Data type Range Description
FINS error code FINS_ErrorCode WORD The FINS error code is output. A code of #0000 is
output for a normal end. Refer to the Related Manuals
for details on the error codes.
Typical FINS Error Codes
Code Contents Meaning
#0000 Normal end ---
#2301 No file memory There is no Memory Card.
#2302
#3001 No access right The right to access the Memory Card is presently held by another device, so the
operation cannot be performed.
Version History
Version Date Contents
1.00 2005.2. Original production
Note
This manual is a reference that explains the function block functions.
It does not explain the operational limitations of Units, components, or combinations of Units and components. Always read
and understand the Operation Manuals for the system’s Units and other components before using them.