date:23.07.2015 file:mc-smo-sys_07.1 simotion siemens ag 2008. all rights reserved. sitrain training...
TRANSCRIPT
Date: 04/19/23File: MC-SMO-SYS_07.1
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
The SIMOTION Execution System
Date: 04/19/23File: MC-SMO-SYS_07.2
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Automating Technical Processes
Machine/plant SIMOTION execution system
Motion/part processes TasksMultitaskingReal-time
Date: 04/19/23File: MC-SMO-SYS_07.3
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
The SIMOTION Execution System
Servo level
DP level
IPO level
Interrupt level
Round robin level
Priority
Date: 04/19/23File: MC-SMO-SYS_07.4
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Task Structure of the Execution System (1)
Time-controlledexecution levels
Event-controlledexecution levels
Free-runningexecution level
System startup/stop
Pri
ori
ty
High
Medium
Low
T5 DccAux Task
IPO_2 TaskIPOSynchronousTask_2T3 (DCC) Task
Motion Tasks
Timer Interrupt Tasks
System Interrupt Tasks
System level DP/PN Comm. boardor
Servo Task
System Interrupt Tasks
User Interrupt Tasks
Motion Tasks
System startup System shutdown
Timer Interrupt Tasks
Wait For Condition
Background Task
ServoSynchronousTaskT1 (DCC) Task
IPO TaskIPOSynchronousTaskT2 (DCC) Task
Temp. Control
T4 DccAux Task
Date: 04/19/23File: MC-SMO-SYS_07.5
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Task Structure of the Execution System (2)
Time-controlledexecution levels
Event-controlledexecution levels
Free-runningexecution level
System startup/stop
Pri
ori
ty
High
Medium
Low
T5 DccAux Task
IPO_2 TaskIPOSynchronousTask_2T3 (DCC) Task
Motion Tasks
Timer Interrupt Tasks
System Interrupt Tasks
System level DP/PN Comm. boardor
Servo Task
System Interrupt Tasks
User Interrupt Tasks
Motion Tasks
System startup System shutdown
Timer Interrupt Tasks
Wait For Condition
Background Task
ServoSynchronousTaskT1 (DCC) Task
IPO TaskIPOSynchronousTaskT2 (DCC) Task
Temp. Control
T4 DccAux Task
Date: 04/19/23File: MC-SMO-SYS_07.6
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Clock Synchronization on the PROFIBUS
SIMOTION
DPcommunicaton
GC GCSl. 1
Sl. 2
Sl. 3
PCT1 PCT2 PCT3
Acycl.part
Res.
T i
T o
Sl. 1
Sl. 2
Sl. 3
T dx
GC: Global control frameT i: read in process valuesTo: output process valuesT dx: Sum of transfer time for all slavesT dp: DP cycle timePCT: Position controllerBT: BackgroundTask
T dp
Drives
Position controlinterrupt
Actual valuesSetpoints
IPO
. . .. . .
BT
Date: 04/19/23File: MC-SMO-SYS_07.7
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Setting the System Cycles Clocks
System Cycle Clocks
Date: 04/19/23File: MC-SMO-SYS_07.8
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Overview of the User Tasks
Task
IPOSynchronousTask T2/T3
Anzahl
2
TimeFaultTask 1
TimeFaultBackgroundTask 1
TechnologicalFaultTask 1
PeripheralFaultTask 1
ExecutionFaultTask 1
TimerInterruptTask 5
2
BackgroundTask 1
MotionTask 32 (with V4.0)
StartupTask 1
ShutdownTask 1
Task
Event-controlled (system)
Round robin level
Time-controlled
Startup /Shutdown
Event-controlled (user) UserInterruptTask
ServoSynchronousTask T1 1
DccAuxTask T4/T5 2(with V4.1)
Date: 04/19/23File: MC-SMO-SYS_07.9
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Time-Controlled Task Processing (1)
Example 1: No InterruptTask active
Default setting: DP cycle Servo cycle IPO cycle 1 1 2
DP cycle
PCT cycle
IPO cycle
Servo task
IPO-Task
SystemInterruptTask
TimerInterruptTask_1
TimerInterruptTask_2
Round robin level
UserInterruptTask
Tdx
GC
cyclic acyclic
Date: 04/19/23File: MC-SMO-SYS_07.10
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Time-Controlled Task Processing (2)
Example 1: No InterruptTask active
Default setting: DP cycle Servo cycle IPO cycle 1 1 2
DP cycle
PCT cycle
IPO cycle
IPO-Task
SystemInterruptTask
TimerInterruptTask_1
TimerInterruptTask_2
Round robin level
UserInterruptTask
Tdx
GC
Servo task
cyclic acyclic
Date: 04/19/23File: MC-SMO-SYS_07.11
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Cycles at the Round Robin Level
MotionTask_1
MotionTask_20
Internal tasks
BackgroundTask
Date: 04/19/23File: MC-SMO-SYS_07.12
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Task Time unit
Background n
Motion 1 1
Motion 2 1
....
Communication 1
Example: n=5 n=2
Example of Time Slice Allocation at the Round Robin Level
n=1n=10n=20
Tim
e
Date: 04/19/23File: MC-SMO-SYS_07.13
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Assigning Programs to Tasks
1. Open execution system
2. Select task
3. Select program
4. Assign program
5.Use task in the executionsystem
Date: 04/19/23File: MC-SMO-SYS_07.14
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Example: Setting Task Parameters for UserInterruptTask
Start condition
Date: 04/19/23File: MC-SMO-SYS_07.15
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Task Runtimes and Task Status Information
Date: 04/19/23File: MC-SMO-SYS_07.16
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Task Handling Operations in MCC
Start Task
Interrupt Task
Continue Task
Reset Task
Task State
Determine TaskId
Date: 04/19/23File: MC-SMO-SYS_07.17
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
e.g.: _task.MotionTask_1
Start task
Restart a task
Operations for Starting Tasks in LAD/FBD
_startTaskId
EN ENO
id OUT
BOOL
StructTaskId
BOOL
DWORD
_restartTaskId
EN ENO
id OUT
BOOL
StructTaskId
BOOL
DWORD
Assign input parameter "id":
Date: 04/19/23File: MC-SMO-SYS_07.18
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Starting and Stopping Tasks in LAD/FBD
_resetTaskId
EN ENO
id OUT
BOOL
StructTaskId
BOOL
DWORD
Reset task
_resumeTaskId
EN ENO
id OUT
BOOL
StructTaskId
BOOL
DWORD
Resume task
_suspendTaskId
EN ENO
id OUT
BOOL
StructTaskId
BOOL
DWORD
Interrupt task
Date: 04/19/23File: MC-SMO-SYS_07.19
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
Returning the Task State in LAD/FBD
_getStateOfTaskId
EN ENO
id OUT
BOOL
StructTaskId
BOOL
DWORD
Determine task state
Return value "OUT" indicates ORing of the following states:• 16#0000: Specified task does not exist (TASK_STATE_INVALID)• 16#0001: Transition RUN to STOP (TASK_STATE_STOP_PENDING)• 16#0002: Task is stopped (TASK_STATE_STOPPED)• 16#0004: Task running (TASK_STATE_RUNNING)• 16#0010: Task waiting (TASK_STATE_WAITING)• 16#0020: Task is suspended (TASK_STATE_SUSPENDED)• 16#0040: TimerInterruptTask waiting for next cycle
(TASK_STATE_WAIT_NEXT_CYCLE)• 16#0080 UserInterruptTask or SystemInterruptTask waiting for
next event (TASK_STATE_WAIT_NEXT_INTERRUPT)• 16#0100 Task disabled by _disablescheduler (TASK_STATE_LOCKED)
Date: 04/19/23File: MC-SMO-SYS_07.20
SIMOTIONSiemens AG 2008. All rights reserved.
SITRAIN Training for Automation and Drives
State Model for Tasks
TS_STOP_PENDING
TS_WAIT_NEXT
_CYCLE TS_WAIT_NEXT_INTERRUPT
TS_LOCKED
TS_STOPPED
_resetTask()
_restartTask()
• WAITFORCONDITION• _waitTime()
TS_RUNNING
TS_WAITING
Condition fulfilled
TS_SUSPENDED
_suspe
ndTask
()
_resum
eTask(
)
MT completed
terminated
Next interrupt
_disableScheduler_enableScheduler
TS_INVALID