SectionFlags
PROGRAM TEST_SectionFlags VAR USINT1: USINT; BOOL1,BOOL2,BOOL3,BOOL4,BOOL5,BOOL6,BOOL7: BOOL; END_VAR FB(Flags:=USINT1, InternalWarning:= BOOL1, ExternalWarning:= BOOL2 FireAlarm:= BOOL3, IntruderAlarm:= BOOL4, PanicAlarm:= BOOL5, EntryDelay:= BOOL6, Exithelay:= BOOL7); END_PROGRAM
LIB\JABLOTRON
V1.0
The block divides the Flags input value into individual bits. These bits are then represented on the output.
Input | Type | Description | Default value |
---|---|---|---|
Flags | USINT | Current flags of the section | 0 |
Output | Type | Description |
---|---|---|
InternalWarning | BOOL | Internal alarm horn message |
ExternalWarning | BOOL | External alarm horn message |
FireAlarm | BOOL | Fire alarm |
IntruderAlarm | BOOL | Intruder alarm |
PanicAlarm | BOOL | Panic alarm |
EntryDelay | BOOL | Entry delay |
ExitDelay | BOOL | Exit delay |
The block reads the section’s flag value containing info about all flags of the section. The read value is transformed into an individual bit according to a bitmask. Each bit is written onto the corresponding output. According to its position, the bit may have multiple meanings, as listed in the table below.
Bit position | Bit meaning |
---|---|
1 | Internal Warning |
2 | External Warning |
4 | Fire Alarm |
8 | Intruder Alarm |
16 | Panic Alarm |
32 | Entry Delay |
64 | Exit Delay |
0 | Default flag value |