Mitsubishi MELSEC-Q Series User Manual page 520

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

Advertisement

10
FUNCTIONS AND PROGRAMMING
(4) Example of script file description
<Stored files>
Files in standard ROM
/ROM
"STARTUP.CMD"
/DirA
"fileA.out"
/DirB
"fileB.out"
<Task settings>
Startup
Task name
order
1
Default: tN (N=1, 2, ...)
2
taskB
<Example of script file description >
ld (1, 0, "/ROM/DirA/fileA.out")
ld (1, 0, "/ROM/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, 0)
1) The "fileA.out" file is loaded from the standard ROM "DirA" directory.
2) The "fileB.out" file is loaded from the standard ROM "DirB" directory.
3) The "funcA" function is generated under the default task name (t1).
4) The "funcB" function is generated under the task name "taskB".
10
- 33
10.2 Programming Using Bus Interface Functions
10.2.8 Creating script file "STARTUP.CMD"
The following provides an example of describing the script file to start user programs.
(a) When loading user programs from script file in standard ROM
The following gives an example of loading user programs ("fileA.out", "fileB.out")
in the standard ROM from the script file in the standard ROM.
*1
*2
*1 "funcA" function already included in fileA.out
*2 "funcB" function already included in fileB.out
C Controller module
Priority
Stack size (byte)
Default: 100
Default: 20000
120
5000
Figure 10.16 Example of script file description (loaded from standard ROM)
POINT
Since the maximum number of arguments that can 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 taskSpawn (funcB in the above example).
Function
Argument specification
name
funcA
None
Specified (First argument: 10)
funcB
1)
2)
3)
4)
File storage location
/ROM/DirA/fileA.out
/ROM/DirB/fileB.out

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec q06ccpu-vMelsec q06ccpu-v-bMelsec sw3pvc-ccpu-e

Table of Contents