Skip to content

Commit 4411cb4

Browse files
committed
feat: add multiple examples for batch processing testing
1 parent cbe9a46 commit 4411cb4

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
File renamed without changes.

example.scl

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FUNCTION_BLOCK "FB_Messages"
2+
{ S7_Optimized_Access := 'TRUE' }
3+
VERSION : 0.1
4+
VAR_INPUT
5+
errorActive : Bool;
6+
ErrorActive : Bool;
7+
Error_Active : Bool;
8+
sensor1 : Bool;
9+
warningActive : Bool;
10+
END_VAR
11+
12+
VAR
13+
ALM_Error {InstructionName := 'Program_Alarm'; LibVersion := '1.0'} : Program_Alarm;
14+
ALM_Warning {InstructionName := 'Program_Alarm'; LibVersion := '1.0'} : Program_Alarm;
15+
instance { S7_SetPoint := 'True'} : String[30] := 'Ruehrer F1 Sicherung';
16+
bmk { S7_SetPoint := 'True'} : String[10] := 'B1';
17+
"counter" : UInt;
18+
acknowledgeAlarms : Bool;
19+
test : UInt;
20+
END_VAR
21+
22+
VAR_TEMP
23+
messageTextIdx : UInt;
24+
source : String[10];
25+
ackAlarmsError : Bool;
26+
ackAlarmsStatus : Word;
27+
END_VAR
28+
29+
30+
BEGIN
31+
32+
#messageTextIdx := "MSG_TEST_ERROR";
33+
#source := 'B1';
34+
#ALM_Error(SIG := #errorActive,
35+
SD_1 := #instance,
36+
SD_2 := #bmk,
37+
SD_3 := #messageTextIdx,
38+
SD_4 := #source);
39+
40+
#messageTextIdx := "MSG_TEST_WARNING";
41+
#ALM_Warning(SIG := #warningActive,
42+
SD_1 := #instance,
43+
SD_2 := #bmk,
44+
SD_3 := #messageTextIdx,
45+
SD_4 := #source);
46+
47+
48+
IF #acknowledgeAlarms THEN
49+
#acknowledgeAlarms := FALSE;
50+
51+
Ack_Alarms(MODE := 1,
52+
ERROR=>#ackAlarmsError,
53+
STATUS => #ackAlarmsStatus);
54+
55+
END_IF;
56+
57+
58+
59+
#counter := #counter + 1;
60+
END_FUNCTION_BLOCK

0 commit comments

Comments
 (0)