Waiting for signals (#WAIT)
In analogy to sending signals, it is possible to wait for a corresponding #SIGNAL with the #WAIT command. A broadcast WAIT waits only for a broadcast SIGNAL with the same signal number. Each #WAIT uses its own #SIGNAL.
Syntax: |
#WAIT [<mode>] [ ID=.. { P[<idx>] = <param> } { CH=.. } [ AHEAD ] ] |
<mode> | Synchronisation mode. Permitted identifiers: ---: Synchronisation at decoding level (initial state) For example, this synchronisation is required if it is necessary to synchronise to parameters or variables. SYN: Synchronisation at interpolator level. This synchronisation is required in the case of real-time requests, e.g. synchronisation of two machining units on a multi-column machine |
ID=.. | Number of the signal for which the system is waiting. Positive integer. |
P[<idx>] = <param> | Signal parameter as real number. (Important: In the equation, the left-hand value is assigned to the right-hand value.) When a signal parameter is read, a check is made whether the transferred signal parameter at index <idx> was adopted in the ‘target variable (<param>). If this is not the case, error ID 21549 is output. <idx>: Range for maximum possible number of parameters: 0 .. 11 (max. number of coupling pairs (1)) |
Attention
Signal parameters can only be evaluated at decoder level. This means, for example, a #WAIT SYN [... P[0] = ... ] is not allowed.
CH=.. | Channel number from which a signal is expected. If no channel number is specified, the program waits for a broadcast signal from any user. |
AHEAD | Keyword for execution of a "flying” WAIT. Used to reduce waiting times because of the buffer effect of the look-ahead function (up to 70 blocks in advance). If synchronised at interpolator level, WAIT is output at once. As a result, the following acknowledgement check (SIGNAL) is flying, i.e. a change can be made immediately to the next motion block without interruption. |
(1) see [6]-6.45
(2) see [6]-2.4
Programing Example
Waiting for signals
(Wait flag 4711, synchronisation at DEC level, SIGNAL 4711 from
any channel)
N200 #WAIT [ID4711]
(Wait flag 815, synchronisation at interpolator level,
SIGNAL 815 from channels 2 and 3)
N100 #WAIT SYN [ID815 CH2 CH3]
(Wait flag 911, synchronisation at decoder level, from channel 3)
N250 P100 = 911
(P[0] is assigned to V.P.SIGNAL, P[1] is assigned to P200)
N300 #WAIT [IDP100 P[0]=V.P.SIGNAL P[1]=P200 CH3]
(The calculation below only takes place when)
(the signal is received)
N350 P20 = 10 * P200
Programing Example
Wait for signals with adoption of parameters (in channel 3):
%channel1
N10 #SIGNAL [ID 110014 P[0] = 1234 CH3]
N20 M30
%channel2
N10 #SIGNAL [ID 110014 P[1] = 200 CH3]
N20 M30
%channel3
N10 P1 = 1 (Stores value from channel 1
N20 P2 = 1 (Stores value from channel 2
N30 XP1 YP2
N40 #WAIT [ID 110014 P[0] = P1 P[1] = P2 CH1 CH2]
N50 XP1 YP2
N60 M30