Skip to content

FB: Coded Light Signal - v1.0

This function block encodes a numeric code value as a timed pulse train on output Q. The number of pulses equals the value of code.

  • Encoding an alarm code as a light flash sequence on a single lamp output.
  • Communicating a device state without requiring multiple output signals.
TypeNameVersion
functionTON_TIMESiemens FB
ParameterDeclarationTypeInit. valueDescription
codeInputUIntIR: 0= No alarm; 1..65535= Alarm code to encode
opt_clearWhenNoAlarmInputBool1IR: 1= Reset state machine when code returns to 0; 0= Let it finish the current cycle
startTimeInputTimeT#3sIR: Duration of the initial ON period before pulses
pulseTimeInputTimeT#1sIR: Duration of each individual pulse (ON and OFF)
endTimeInputTimeT#2sIR: Duration of the final OFF period after all pulses
QOutputBoolOR: Coded output signal
code = 2
Start: ON Pulse: OFF Pulse 1: ON Pulse: OFF Pulse 2: ON End: OFF
___________________ ______________ ______________
Q => __| |______________| |______________| |__________________
< startTime > < pulseTime > < pulseTime > < pulseTime > < pulseTime > < endTime >