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.
Use Cases
Section titled “Use Cases”- Encoding an alarm code as a light flash sequence on a single lamp output.
- Communicating a device state without requiring multiple output signals.
Dependencies
Section titled “Dependencies”| Type | Name | Version |
|---|---|---|
function | TON_TIME | Siemens FB |
Parameters
Section titled “Parameters”Function
Section titled “Function”| Parameter | Declaration | Type | Init. value | Description |
|---|---|---|---|---|
code | Input | UInt | — | IR: 0= No alarm; 1..65535= Alarm code to encode |
opt_clearWhenNoAlarm | Input | Bool | 1 | IR: 1= Reset state machine when code returns to 0; 0= Let it finish the current cycle |
startTime | Input | Time | T#3s | IR: Duration of the initial ON period before pulses |
pulseTime | Input | Time | T#1s | IR: Duration of each individual pulse (ON and OFF) |
endTime | Input | Time | T#2s | IR: Duration of the final OFF period after all pulses |
Q | Output | Bool | — | OR: Coded output signal |
Timing Diagram
Section titled “Timing Diagram”code = 2
Start: ON Pulse: OFF Pulse 1: ON Pulse: OFF Pulse 2: ON End: OFF ___________________ ______________ ______________Q => __| |______________| |______________| |__________________
< startTime > < pulseTime > < pulseTime > < pulseTime > < pulseTime > < endTime >