Sending signals (# SIGNAL)
Basically, a distinction is made between signals without a specified receiver (also called broadcast signals) and non-broadcast signals where a channel is explicitly specified as the receiver.
The signals are identified by a unique number, although it is permitted to send signals with identical signal numbers.
In the case of non-broadcast signals, one or more NC channels must be explicitly specified as receivers. If several receivers are specified for one signal, this acts in the same way as the multiple transmission of the same signals to single channels.
Example
Sending signals
#SIGNAL [ID4711 CH1 CH2 CH3] |
acts in the same way as |
#SIGNAL [ID4711 CH1] |
#SIGNAL [ID4711 CH2] |
#SIGNAL [ID4711 CH3] |
These signals are only valid for a WAIT of the addressed receiver and are used up if the consumption counter COUNT is not specified for a WAIT from the receiver channel. If a consumption counter is specified, the same number of WAIT requests are possible until the signal is used up.
As opposed to this situation, broadcast signals can be received by a WAIT from any channel.
If no consumption counter COUNT is specified for broadcast signals, they are not used up by a WAIT. This means that they remain until they are explicitly cleared (see #SIGNAL REMOVE). If a consumption counter COUNT is specified, the exact same number of WAIT requests is possible until the broadcast signal is used up as is the case with non-broadcast signals.
Syntax: |
#SIGNAL [<mode>] [ ID=.. [COUNT=..] { P[<idx>]=<param> } { CH=.. } [KEEP_AT_RESET] ] |
<mode> | Synchronisation mode. Permitted identifiers: ---: Synchronisation at decoding level (initial state) SYN: Synchronisation at interpolator level. |
ID=.. | Signal number; must be unique system-wide. Positive integer. |
COUNT=.. | Consumption counter; defines how many times a signal can be called with #WAIT. Positive integer. |
P[<idx>] = <param> | Signal parameter. The real values <param> are entered in the parameter array of the signal according to the specified index. <idx>: Range for maximum possible number of parameters: 0 .. 11 (Max. number of coupling pairs(1)) |
CH=.. | Number of the channel for which the signal is destined. If no channel number is specified, a so-called broadcast signal is sent to all available signal receivers in the system. |
KEEP_AT_RESET | Flagged signal (standard signal with receiver) is not removed at reset. This means that the signal remains retained even after the channel to be sent is reset until it is consumed by a #WAIT with the correct ID or removed by explicit programming (#SIGNAL REMOVE) |
(1) see [6]-6.45, (2) see [6]-2.4
Programing Example
Sending signals
(Signal 812, synchronisation at DEC level, broadcast)
N500 #SIGNAL [ID812]
(Signal 4711, synchronisation at DEC level, to channel 2)
N100 #SIGNAL [ ID4711 CH2 ]
(Signal 4711, synchronisation at DEC level,
for 10 #WAIT requests, broadcast)
N100 #SIGNAL [ ID4711 COUNT10 ]
(Signal 815, synchronisation at interpolator level,
twice to channel 2 and once to 3)
N200 #SIGNAL SYN [ ID815 CH2 CH2 CH3 ]
(Signal 911, synchronisation at decoder level, to channel 3)
(1St signal parameter V.A.MEAS.ACS.VALUE.X, 2nd signal parameter P200,
3rd signal parameter 94.4)
N260 P200 = 924
N300 #SIGNAL [ IDP100 CH3 P[0]=V.A.MEAS.ACS.VALUE.X P[1]=P200 P[2]=94.4 ]