P3: Basic PLC Program for SINUMERIK 840D sl
13.13 Block descriptions
Basic Functions
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
957
PI service: MMCSEM
Semaphores for various PI services
For use by HMI and PLC
10 semaphores are provided for each channel. These protect critical functions for the HMI/PLC. By setting the
semaphore for the corresponding function number, several HMI/PLC units can be synchronized with it in cases
where a function contains a critical section with respect to data to be fetched by the NCK. Semaphores are
managed by the HMI/PLC. A semaphore value of 1stipulates a Test & Set operation for the semaphore of the
specified function number. The return value of the PI service represents the result of this operation:
• Checkback value Done := TRUE: Semaphore has been set, critical function can be called
• Checkback value Error := TRUE with state = 3: Semaphore was already set, critical function cannot be called
at the present time. The operation must be repeated later.
Parameter:
WVar1 = FunctionNumber
This function number represents a PI service:
WVar2=SemaphorValue
NOTICE
On completion of the operation (reading data of this PI service) it is essential that the
semaphore is enabled again.
Function number PI service
1 TMCRTO (create tool)
2 TMFDPL (search for empty location for loading):
3 TMMVTL (prepare magazine location for loading, unload tool)
4 TMFPBP (search for location)
5 TMGETT (search for tool number)
6 TSEARC (search for tool)
7 ... 10 Reserved
Value Meaning
0: Reset semaphore
1: Test and set semaphore
Parameterization
Signal Type Value range Meaning
PIService ANY PI.MMCSEM Set semaphore
Unit INT 1, 2 to 10 Channel
WVar1 INT 1 ... 10 FunctionNumber
WVar2 WORD 0, 1 SemaphoreValue