Waiting for signals (#WAIT)

Analogously to sending signals, it is possible with the WAIT command to wait for a corresponding SIGNAL. A broadcast WAIT waits only for a broadcast SIGNAL with the same signal number. A WAIT synchronised at decoder/interpolator level uses up one separate SIGNAL in each case.

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. While waiting for signals, parameters can also be sent by the signal sender. Parameters can also originate from different channels. They are assigned to the specified parameters or variables (<param>).

<idx>: Range for maximum possible number of parameters: 0 .. 11 (Max. number of coupling pairs(1))

After complete acknowledgement of the waiting condition (reception of all required signals), a check is made whether all programmed parameters were written. An error message is generated if id not the case.

Attention

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.
1...max. number of channels (2)

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

prg_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)

(1st signal parameter V.P.SIGNAL, 2nd signal parameter P200)

N250 P100 = 911

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

prg_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