Mitsubishi Electric MELSEC Q Series User Manual page 349

Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

(5) Example of script file description
The following is an example of loading a user program in the standard ROM and SD memory card from the script
file in the standard ROM.
For Q12DCCPU-V, read the explanation in this section regarding SD memory card (/SD) as CompactFlash card (/CF).
C Controller module
(a) Stored files
Memory
File storage location
/ROM
Standard ROM
/ROM/DirA
SD memory card
/SD/DirB
(b) Task settings
Startup
Task name
order
1
Default: tN (N=1, 2, ...)
2
taskB
(c) Example of script file description
STARTUP.CMD
//The "fileA.out" file is loaded from the standard ROM "DirA" directory.
ld (1, 0, "/ROM/DirA/fileA.out")
//The "fileB.out" file is loaded from the SD memory card "DirB" directory.
ld (1, 0, "/SD/DirB/fileB.out")
//The "funcA" function is generated under the default task name (t1). ("funcA" function already included in fileA.out)
sp (funcA, 0, 0, 0, 0, 0, 0, 0, 0, 0)
//The "funcB" function is generated under the task name "taskB". ("funcB" function already included in fileB.out)
taskSpawn ("taskB", 120, 0, 5000, funcB, 10, 0, 0, 0, 0, 0 )
Since the maximum number of arguments to be specified for one command is 12, up to seven arguments can be given to the
function entry specified in taskSpawn (funcB in the above example).
The task will not start if eight or more arguments are specified for the function entry specified in task Spawn (funcB in the
above example).
Files in standard ROM
/ROM"STARTUP.CMD"
/DirA"fileA.out"
Q172LX
File name
STARTUP.CMD
fileA.out
fileB.out
Priority
Default: 100
120
Files in SD memory card
/SD
/DirB"fileB.out"
Script file to load the user program
User program ("funcA" function already included)
User program ("funcB" function already included)
Function
Stack size
name
Default: 20000
funcA
5000
funcB
CHAPTER 19 PROGRAMMING
Description
Argument specification
None
Specified (First argument: 10)
347
19

Advertisement

Table of Contents
loading

Table of Contents