<< Click to Display Table of Contents >> TASK_NAME |
mapp Services V5.16
Pragma TASK_NAME defines the current PLC task name.
#pragma TASK_NAME 'taskname'
#pragma TASK_NAME
The specified task name is used in variable declaration sections with PLC_GLOBAL storage to map task-local process variables. If no task name parameter is specified, the current task name is cleared and global process variables are mapped (default behavior).
PLC task declaration files "ITask.typ" and "ITask.var" must be transferred from the AS project to the Structured Text program file device.
#pragma TASK_NAME 'ITask' // Current task name is ITask
#pragma SCOPE PLC_GLOBAL // The declared elements must then be on the PLC
#include 'ITask.typ' // PLC task declaration file
#include 'ITask.var' // PLC task declaration file
#pragma SCOPE DEFAULT
#pragma TASK_NAME
PROGRAM _MAIN
...
END_PROGRAM