Mitsubishi Electric MELSEC iQ-R Series User Manual page 55

Controller module
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Example of script file description
The following shows an example to load a user program in the program memory and SD memory card using a script file in the
program memory.
■Storage file
Memory
File storage
destination path
Program memory
/0
/0/DirA
SD memory card
/2/DirB
■Task contents
Activation
Task name
order
1
Default: tN (N=1, 2, ...)
2
taskB
■Example of script file (STARTUP.CMD) description
ld(1,0,"/0/DirA/fileA.out")
ld(1,0,"/2/DirB/fileB.out")
sp(funcA,0,0,0,0,0,0,0,0,0)
taskSpawn("taskB",120,0,5000,funcB,10,0,0,0,0,0)
(1) Load the "fileA.out" file from "DirA" directory in the program memory.
(2) Load the "fileB.out" file from "DirB" directory in the SD memory card.
(3) Generate the "funcA" function under the default task name (t1). (The "funcA" function is already included in the fileA.out file.)
(4) Generate the "funcB" function under the task name, "taskB". (The "funcB" function is already included in the fileB.out file.)
Up to 12 arguments can be specified for one command. Therefore, in the example of script file description
above, up to seven arguments can be passed to the function entry specified for taskSpawn (example: funcB).
If eight or more arguments are specified, the task will not be activated.
File name
Description
STARTUP.CM
Script file to load a user program
D
fileA.out
User program ("funcA" function has already been included.)
fileB.out
User program ("funcB" function has already been included.)
Priority
Stack size
Default: 100
Default: 20000 bytes
120
5000 bytes
/*(1)*/
/*(2)*/
/*(3)*/
/*(4)*/
Function
Argument
name
specification
funcA
None
funcB
Specified (First argument:
10)
6 PROCEDURE BEFORE OPERATION
6.12 Creating Script File
6
53

Advertisement

Table of Contents
loading

This manual is also suitable for:

R12ccpu-v

Table of Contents