10 - 33
10.2 Programming Using Bus Interface Functions
10.2.8 Creating script file "STARTUP.CMD"
10
FUNCTIONS AND PROGRAMMING
(b) When loading user programs from script file in CompactFlash card
The following gives an example of loading user programs ("fileA.out", "fileB.out")
in the standard ROM and CompactFlash card from the script file in the
CompactFlash card.
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).
Figure 10.17 Script file description example (loaded from CompactFlash card)
ld (1, 0, "/CF/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)
/ROM
/DirB "fileB.out"
*2
/CF "STARTUP.CMD"
/ DirA "fileA.out"
*1
*1 "funcA" function already included in fileA.out
*2 "funcB" function already included in fileB.out
1) The "fileA.out" file is loaded from the CompactFlash card "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".
<Stored files>
File in standard ROM
C Controller module
<Script file description example>
File in CompactFlash card
1)
2)
3)
4)
1
Default: 100
funcA /CF/DirA/fileA.out
2
taskB 120
5000
funcB /ROM/DirB/fileB.out
<Task settings>
Startup
order
Task name Priority Stack size (byte)
Function
name
Argument specification File storage location
Default: tN (N=1, 2, ...) Default: 20000
None
Specified (First argument: 10)