-
Notifications
You must be signed in to change notification settings - Fork 5
/
VlvL.scl
2180 lines (1891 loc) · 97.3 KB
/
VlvL.scl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Name: VlvL
// Symbolic Name: VlvL
// Symbol Comment:
// Family: Drives
// Version: 1.3
// Author: AdvLib71
// Last modified:
// Use: SFB35,SFC20, SFC6, FC369, UDT61, UDT65
// Size: 8826byte
// Signature:
{
Scl_ResetOptions ;
Scl_OverwriteBlocks:= 'y' ;
Scl_GenerateReferenceData := 'y' ;
Scl_S7ServerActive:= 'y' ;
Scl_CreateObjectCode:= 'y' ;
Scl_OptimizeObjectCode:= 'y' ;
Scl_MonitorArrayLimits:= 'y' ;
Scl_CreateDebugInfo := 'n' ;
Scl_SetOKFlag:= 'n' ;
Scl_SetMaximumStringLength:= '254'
}
// DigVal UDT 61
TYPE DigVal
STRUCT
Value : BOOL : = false; // Value
ST : BYTE := 16#80; // Signal Status
END_STRUCT
END_TYPE
// AnaVal UDT 51
TYPE AnaVal
STRUCT
Value : Real := 0.0; // Value
ST : Byte := 16#80; // Signal Status
END_STRUCT
END_TYPE
// SBits32inDWORD UDT 65
TYPE SBits32inDWORD
STRUCT
// highest Byte in accu BYTE0 in memory
X24 : BOOL; // 0.0
X25 : BOOL;
X26 : BOOL;
X27 : BOOL;
X28 : BOOL;
X29 : BOOL;
X30 : BOOL;
X31 : BOOL; // 0.7
// second highest Byte in accu BYTE1 in memory
X16 : BOOL; // 1.0
X17 : BOOL;
X18 : BOOL;
X19 : BOOL;
X20 : BOOL;
X21 : BOOL;
X22 : BOOL;
X23 : BOOL; // 1.7
// third highest Byte in accu BYTE2 in memory
X8 : BOOL; // 2.0
X9 : BOOL;
X10 : BOOL;
X11 : BOOL;
X12 : BOOL;
X13 : BOOL;
X14 : BOOL;
X15 : BOOL; // 2.7
// lowest Byte in accu BYTE0 in memory
X0 : BOOL; // 3.0
X1 : BOOL;
X2 : BOOL;
X3 : BOOL;
X4 : BOOL;
X5 : BOOL;
X6 : BOOL;
X7 : BOOL; // 3.7
END_STRUCT
END_TYPE
FUNCTION_BLOCK VlvL
TITLE = 'Valve - Large'
{
S7_tasklist:= 'OB100';
S7_m_c:= 'true';
S7_alarm_ui:= '1'
}
AUTHOR: AdvLib71 // Disasembled by EvchSerg
NAME: VlvL //fb1899
VERSION: '1.3'
FAMILY: Drives
// KNOW_HOW_PROTECT
VAR_INPUT
OpenAut {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1=Open: Open Command in Auto Mode
CloseAut {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1=Close: Close Command in Auto Mode
(*
StopAut {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1=Stop: Stop Command in Auto Mode
*)
OpenMan {
S7_visible:='false';
S7_m_c:='true';
S7_link:='false';
S7_string_1:='';
S7_edit:='para'} : BOOL; // 1=Open: Open Command in Manual Mode
CloseMan {
S7_visible:='false';
S7_m_c:='true';
S7_link:='false';
S7_string_1:='';
S7_edit:='para'} : BOOL; // 1=Close: Close Command in Manual Mode
(*
StopMan {
S7_visible:='false';
S7_link:='false';
S7_m_c:='true';
S7_string_1:='';
S7_edit:='para'} : BOOL; // 1=Stop: Stop Command in Manual Mode
*)
ModLiOp {
S7_edit:='para';
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1=Link/Auto,0=Manual: Input to Auto/Manual Commands
AutModOp {
S7_visible:='false';
S7_m_c:='true';
S7_link:='false'} : BOOL; // 1=Auto Mode: Auto Mode by Operator
ManModOp {
S7_visible:='false';
S7_m_c:='true';
S7_link:='false'} : BOOL := TRUE; // 1=Manual Mode: Manual Mode by Operator
AutModLi {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1=Auto Mode: Auto Mode by Linked or SFC
ManModLi {
S7_dynamic:='true'} : DigVal; // 1=Manual Mode: Manual Mode by Linked or SFC
LocalLi {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} : DigVal; // 1=Local Mode: Local Operation by Field Signal
LocalOp {
S7_m_c:='true';
S7_link:='false';
S7_visible:='false'} : BOOL; // 1=Local Mode: Local Operation by Operator
MS_RelOp {
S7_m_c:='true';
S7_link:='false';
S7_visible:='false'} : BOOL; // Operator input for MS Release, 1: MS release requirement
OosOp {
S7_m_c:='true';
S7_link:='false';
S7_visible:='false'} : BOOL; // 1=Oos Mode: Oos Mode by Operator
OosLi {
S7_dynamic:='true'} : DigVal; // 1=Oos Mode: Oos Mode by Field Signal
OpenLocal {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} : DigVal; // 1=Open Local:Field Open Signal
CloseLocal {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} : DigVal; // 1=Close Local: Field Close Signal
(*
StopLocal {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} : DigVal; // 1=Stop Local: Field Stop Signal
*)
LocalSetting {
S7_visible:='false';
S7_link:='false'} : INT := 0; // Local Mode Behavior
FbkOpen {
S7_dynamic:='true'} :
STRUCT
Value : BOOL := FALSE; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // 1=Open: Feedback of Valve Opened
FbkClose {
S7_dynamic:='true'} :
STRUCT
Value : BOOL := FALSE; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // 1=Close: Feedback of Valve Closed
(*FbkOpening {
S7_dynamic:='true'} :
STRUCT
Value : BOOL := FALSE; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // 1=Opening,0=Stop: Feedback of Control Open
FbkClosing {
S7_dynamic:='true'} :
STRUCT
Value : BOOL := FALSE; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // 1=Closing,0=Stop: Feedback of Control Close
NoFbkOpen {
S7_dynamic:='true';
S7_edit:='para'} : DigVal; // 1=Open Feedback is not Present
NoFbkClose {
S7_dynamic:='true';
S7_edit:='para'} : DigVal; // 1=Close Feedback is not Present
*)
NoFbkOpen {
S7_edit:='para';
S7_visible:='false'} : BOOL; // 1=Open Feedback is not Present
NoFbkClose {
S7_edit:='para';
S7_visible:='false'} : BOOL; // 1=Close Feedback is not Present
Monitor {
S7_edit:='para';
S7_m_c:='true';
S7_link:='false';
S7_dynamic:='true'} : BOOL := TRUE; // 1=Monitor ON, 0=Monitor OFF: Feedback monitor
MonTiStatic {
S7_dynamic:='true';
S7_edit:='para';
S7_m_c:='true';
S7_link:='false'} : REAL := 3.0; // Monitoring time for unexpected change in any feedback [s]
MonTiDynamic {
S7_dynamic:='true';
S7_edit:='para';
S7_m_c:='true';
S7_link:='false'} : REAL := 3.0; // Monitoring time for expected change of feedback [s]
PulseWidth {
S7_edit:='para';
S7_visible:='false';
S7_link:='false'} : REAL := 3.0; // Control output pulse width [s]
MonSafePos {
S7_edit:='para';
S7_dynamic:='true'} : BOOL := TRUE; // 1=On monitoring error set valve to safe position
SafePos {
S7_visible:='false';
S7_edit:='para'} : BOOL; // 1=Open, 0=Close: Safe position of the valve
WarnTiMan {
S7_edit:='para';
S7_link:='false';
S7_visible:='false'} : REAL; // Warning time prior for valve motion in manual mode [s]
WarnTiAut {
S7_edit:='para';
S7_link:='false';
S7_visible:='false'} : REAL; // Warning time prior for valve motion in automatic mode [s]
RstOp {
S7_visible:='false';
S7_m_c:='true';
S7_link:='false'} : BOOL; // Operator reset signal
RstLi {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // Linked reset signal
BypProt {
S7_edit:='para';
S7_m_c:='true';
S7_visible:='false';
S7_link:='false'} : BOOL; // Bypass protection in simulation/local modes
Permit {
BLK_Jump:='1';
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} :
STRUCT
Value : BOOL := TRUE; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // 1=Permit is OK, 0=Not allowed to activate the valve
Perm_En {
S7_edit:='para';
S7_visible:='false'} : BOOL := 1; // 1=Permit enabled, 0=Permit disabled
Intlock {
BLK_Jump:='1';
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} :
STRUCT
Value : BOOL := TRUE; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // 1=Valve is not interlocked ,0=Valve is interlocked (no reset is required)
Intl_En {
S7_edit:='para';
S7_visible:='false'} : BOOL := 1; // 1=Interlock enabled, 0=Interlock disabled
Protect {
BLK_Jump:='1';
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} :
STRUCT
Value : BOOL := TRUE; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // 0=Protection is active, 1= Protection is not active
Prot_En {
S7_edit:='para';
S7_visible:='false'} : BOOL := 1; // 1=Protection enabled, 0=Protection disabled
OpenForce {
S7_dynamic:='true'} : DigVal; // 1=Open :Open Command in Forced Operation
CloseForce {
S7_dynamic:='true'} : DigVal; // 1=Close :Close Command in Forced Operation
(*
StopForce {
S7_dynamic:='true'} : DigVal; // 1=Stop: Stop Command in Forced Operation
*)
UserAna1 {
S7_visible:='false';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;';
S7_xshortcut:='Value,;'}:
STRUCT
Value : REAL; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // User analog input 1
UA1unit {
S7_visible:='false';
S7_m_c:='true';
S7_unit :=''} : INT; // Unit of UserAna1
UserAna2 {
S7_visible:='false';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;';
S7_xshortcut:='Value,;'}:
STRUCT
Value : REAL; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // User analog input 2
UA2unit {
S7_visible:='false';
S7_m_c:='true';
S7_unit :=''} : INT; // Unit of UserAna2
MsgLock {
S7_visible:='false'} : DigVal; // Inhibit process message
SampleTime {
S7_visible:='false';
S7_link:='false';
S7_sampletime:='true';
S7_param:='false'} : REAL := 0.1; // Sampling time [s]
SimOn {
S7_visible:='false';
S7_m_c:='true';
S7_link:='false'} : BOOL; // Simulation on/off
RunUpCyc {
S7_visible:='false';
S7_link:='false'} : INT := 3; // Number of cycles for which all messages are suppressed
MsgEvId1 {
S7_visible:='false';
S7_param:='false';
S7_link:='false';
S7_server:='alarm_archiv';
S7_a_type:='alarm_8p'} : DWORD := DW#16#FFFFFFFF; // Message event ID 01
BatchEn {
S7_visible:='false'} : BOOL; // Enable remote operation of controller by Batch recipe
BatchID {
S7_visible:='false';
S7_m_c:='true'} : DWORD; // Current Batch ID (number)
BatchName {
S7_visible:='false';
S7_m_c:='true'} : STRING[32]; // Current Batch name
StepNo {
S7_visible:='false';
S7_m_c:='true'} : DWORD; // Batch step number
Occupied {
S7_visible:='false'} : BOOL; // Occupied by Batch
CSF {
S7_dynamic:='true'} : DigVal; // Control system fault message - External error
ExtMsg1 {
S7_visible:='false'} : DigVal; // External message 1
ExtMsg2 {
S7_visible:='false'} : DigVal; // External message 2
ExtMsg3 {
S7_visible:='false'} : DigVal; // External message 3
ExtVa104 {
S7_visible:='false'} : ANY; // External value 4
ExtVa105 {
S7_visible:='false'} : ANY; // External value 5
ExtVa106 {
S7_visible:='false'} : ANY; // External value 6
ExtVa107 {
S7_visible:='false'} : ANY; // External value 7
ExtVa108 {
S7_visible:='false'} : ANY; // External value 8
UserStatus {
S7_m_c:='true';
S7_visible:='false'} : BYTE; // User status bits
SelFp1 {
BLK_Jump := '1';
S7_visible:='false'} : ANY; // Select Faceplate 1
SelFp2 {
BLK_Jump := '1';
S7_visible:='false'} : ANY; // Select Faceplate 2
OS_Perm {
S7_visible:='false'} :
STRUCT // Operator Permissions
Bit0 : BOOL := 1; // 1 = Operator can shift to automatic mode
Bit1 : BOOL := 1; // 1 = Operator can shift to manual mode
Bit2 : BOOL := 1; // 1 = Operator can shift to local mode
Bit3 : BOOL := 1; // 1 = Operator can shift to out of service mode
Bit4 : BOOL := 1; // 1 = Operator can open the valve
Bit5 : BOOL := 1; // 1 = Operator can close the valve
Bit6 : BOOL := 1; // 1 = Operator can reset the valve
Bit7 : BOOL := 1; // 1 = Operator can define the monitoring time for startup
Bit8 : BOOL := 1; // 1 = Operator can define the monitoring time for runtime
Bit9 : BOOL := 1; // 1 = Operator can activate the function monitoring time (bits 7 & 8)
Bit10 : BOOL := 1; // 1 = Operator can enable function simulation
Bit11 : BOOL := 1; // 1 = Operator can enable function maintenance release
Bit12 : BOOL := 1; // Reserved
Bit13 : BOOL := 1; // Reserved
Bit14 : BOOL := 1; // Reserved
Bit15 : BOOL := 1; // Reserved
Bit16 : BOOL := 1; // Reserved
Bit17 : BOOL := 1; // Reserved
Bit18 : BOOL := 1; // Reserved
Bit19 : BOOL := 1; // Reserved
Bit20 : BOOL := 1; // Reserved
Bit21 : BOOL := 1; // Reserved
Bit22 : BOOL := 1; // Reserved
Bit23 : BOOL := 1; // Reserved
Bit24 : BOOL := 1; // Reserved
Bit25 : BOOL := 1; // Reserved
Bit26 : BOOL := 1; // Reserved
Bit27 : BOOL := 1; // Reserved
Bit28 : BOOL := 1; // Reserved
Bit29 : BOOL := 1; // Reserved
Bit30 : BOOL := 1; // Reserved
Bit31 : BOOL := 1; // Reserved
END_STRUCT; // Operator permissions
dwOS_PermIn AT OS_Perm : DWORD;
ArrbOS_Perm AT OS_Perm :
STRUCT
BYTE0 : BYTE ; // BYTE 0
BYTE1 : BYTE ; // BYTE 1
BYTE2 : BYTE ; // BYTE 2
BYTE3 : BYTE ; // BYTE 3
END_STRUCT;
OpSt_In {
BLK_Jump:='1';
S7_visible:='false'} : DWORD; // Enabled operator stations
Feature {
S7_visible:='false';
S7_xedit:='Bit0,para;Bit1,para;Bit2,para;Bit3,para;Bit4,para;Bit9,para;Bit10,para;Bit11,para;Bit17,para;Bit22,para;Bit24,para;Bit30,para;Bit31,para;'} :
STRUCT
Bit0 : BOOL; // 0 = Start up with defined initializing in OB100; 1 = keep last stored values
Bit1 : BOOL; // 1 = OosLi can switch to Out of Service
Bit2 : BOOL; // 1 = Resetting the commands for changing the mode
Bit3 : BOOL; // 1 = Enabling resetting of commands for the control settings
Bit4 : BOOL; // 0 = Button mode; 1 = Switch mode
Bit5 : BOOL; // Reserved
Bit6 : BOOL; // Reserved
Bit7 : BOOL; // Reserved
Bit8 : BOOL; // Reserved
Bit9 : BOOL; // 1 = Resetting interlock via automatic input signals in automatic mode
Bit10 : BOOL; // 1 = Switch to the last setting of Auto/Man mode when switched from Local mode t
Bit11 : BOOL; // 1 = Tracking feedback signals in simulation mode with delay
Bit12 : BOOL; // Reserved
Bit13 : BOOL; // Reserved
Bit14 : BOOL; // Reserved
Bit15 : BOOL; // Reserved
Bit16 : BOOL; // Reserved
Bit17 : BOOL; // 1 = Enabling bumpless changeover to automatic mode for valves and motors
Bit18 : BOOL; // Reserved
Bit19 : BOOL; // Reserved
Bit20 : BOOL; // Reserved
Bit21 : BOOL; // Reserved
Bit22 : BOOL; // 1 = Enable message state actualization
Bit23 : BOOL; // Reserved
Bit24 : BOOL; // 1 = Local authorization active
Bit25 : BOOL; // Reserved
Bit26 : BOOL; // Reserved
Bit27 : BOOL; // Reserved
Bit28 : BOOL; // Reserved
Bit29 : BOOL; // Reserved
Bit30 : BOOL; // 1 = Resetting interlock via input signal in automatic via faceplate in manual m
Bit31 : BOOL; // 1 = Resetting interlock in manual mode
END_STRUCT; // Status of various features
EventTsIn :
STRUCT
Value : BYTE; // Value
ST : BYTE := 16#FF; // Signal Status
END_STRUCT; // Timestamp parameters
END_VAR
VAR_OUTPUT
MS_Release : DigVal; // 1: Maintenance status release
MonDynErr {
S7_dynamic:='true'} : DigVal; // Feedback Error on change in control output
MonStaErr {
S7_dynamic:='true'} : DigVal; // Feedback Error on unexpected feedback change
LockAct {
S7_dynamic:='true'} : DigVal; // 1 = Interlock (Permit, Interlock or Protect) is active
GrpErr {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1 = Group error is active
RdyToStart {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1 = ready to start
RdyToReset {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1 = ready to reset via RstLi or automatic commands
WarnAct {
S7_dynamic:='true'} : DigVal; // 1 = Warning prior before motion valve in auto/manual mode
(*
Open {
S7_contact:='true';
S7_dynamic:='true';
S7_edit:='para';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} : DigVal; // Control Output to Open the Valve
Close {
S7_contact:='true';
S7_dynamic:='true';
S7_edit:='para';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;'} : DigVal; // Control Output to Close the Valve
*)
Ctrl {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;';
S7_contact:='true';
S7_edit:='para'} : DigVal; // Control output (dependent from SafePos)
P_Open {
S7_visible:='false'} : DigVal; // Pulsive open control (independent from SafePos)
P_Close {
S7_visible:='false'} : DigVal; // Pulsive close control (independent from SafePos)
(*
P_Stop {
S7_visible:='false'} : DigVal; // Pulsive Control Output to Stop
*)
P_Rst {
S7_dynamic:='true';
S7_visible:='false'} : DigVal; // reserved
LocalAct {
S7_dynamic:='true'} : DigVal; // 1=Local operation mode is active
AutAct {
S7_dynamic:='true';
S7_contact:='true'} : DigVal; // 1=Automatic mode is active
ManAct {
S7_dynamic:='true'} :
STRUCT
Value : BOOL := TRUE; // Value
ST : BYTE := 16#80; // Signal Status
END_STRUCT; // 1: Manual mode is active
OosAct {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;'}: DigVal; // Out of service is active
FbkOpenOut {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;';
S7_contact:='true';
S7_edit:='para'} : DigVal; // 1=Valve is Opened
FbkCloseOut {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;';
S7_contact:='true';
S7_edit:='para'} : DigVal; // 1 = Valve is Closed
(*
FbkOpngOut {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;';
S7_contact:='true';
S7_edit:='para'} : DigVal; // 1=Opening, 0=Stop: Feedback of Control Open
FbkClsgOut {
S7_dynamic:='true';
S7_m_c:='true';
S7_xm_c :='Value,TRUE;';
S7_xqc :='Value,TRUE;';
S7_contact:='true';
S7_edit:='para'} : DigVal; // 1=Closing, 0=Stop: Feedback of Control Close
*)
// The output indicates whether an operation is generally enable at the block
OS_PermOut {
S7_visible:='false';
S7_m_c:='true'} :DWORD:=16#FFFFFFFF; // Operator permission: output for OS
ArrOS_PermOut AT OS_PermOut : ARRAY[0..3] OF BYTE;
OS_PermLog {
S7_visible:='false';
S7_m_c:='true'} :DWORD:=16#FFFFFFFF; // Operator permission: output for OS
ArrOS_PermLog AT OS_PermLog : ARRAY[0..3] OF BYTE;
OpSt_Out {
S7_visible:='false';
S7_m_c:='true'} :DWORD; // Enabled operator stations
// Worst signal status
ST_Worst {
S7_visible:='false';
S7_m_c:='true'} :BYTE := 16#80; // Worst Signal Status
// Status WORD
Status1 {
S7_dynamic:='true';
S7_visible:='false';
S7_m_c:='true'} :DWORD; // Status1 word
Status2 {
S7_dynamic:='true';
S7_visible:='false';
S7_m_c:='true'} :DWORD; // Status2 word
Status3 {
S7_dynamic:='true';
S7_visible:='false';
S7_m_c:='true'} :DWORD; // Status3 word
ErrorNum {
S7_dynamic:='true'} :INT := -1; // Error Number
MsgErr1 {
S7_visible:='false'} :BOOL; // 1=Messaging error occurs
MsgStat1 {
S7_visible:='false'} :WORD; // ALARM_8P: Status output
MsgAckn1 {
S7_visible:='false'} :WORD; // ALARM_8P: ACK_STATE output
END_VAR
VAR
ALARM_8P_1 : ALARM_8P; // Multiple instances of ALARM_8P
SbMsgEff1 : BYTE; // Effective message signal
SbMsgEff1Bits AT SbMsgEff1 : ARRAY [0..7] OF BOOL; //
SbMsgEff1Old : BYTE; // Effective message signal (Last cycle)
SarBatchName : ARRAY [1..32] OF BYTE := 32 (B#16#0); //
SnMsgToggle : INT; // Reduce frequencey of call of ALARM_8P waiting for ACK
SnErr : INT; // Error information.
SnRunUpCyc : INT; // Counters of run-up-cycle.
SdwPrevBatchId : DWORD; // Saved BA_ID
SdwStepNoLoc : DWORD; // Variable for STEPNO
SdwBatchId : DWORD; // Variable for BATCHID
SrWarnTime : REAL; // Counting warning Time
SrMonTime : REAL; // Previous value of MonTime.
srPulseTimeOpen : REAL; // Counter for pulse width
srPulseTimeClose : REAL; // Counter for pulse width
SxShowAlarm1 : BOOL := true; // Call instance of ALARM_8P
SxFirstStart : BOOL := true; // Initial run.
SxFbkOpen : BOOL; // Previous value for feedback Open
SxFbkClose : BOOL; // Previous value for feedback Close.
SxMonTiDynamicProcess : BOOL; // Variable for Time Monitoring in process.
SxMonTiStatic : BOOL; // Static monitoring error
SxResetNeededProtect : BOOL; // 1 = Reset is needed for protect signal
SxResetNeededMonErr : BOOL; // 1 = Reset is needed for monitoring error
SxRstLi : BOOL; // Previous value of RstLi.
SxPrevCtrl : BOOL; // Previous Value for controller output.
SxCommand : BOOL; // Memorize command
SxPrevCommand : BOOL; // Previous value of memorize command
SxLocalLi : BOOL; // Previous value for LocalLi
SxOpenAut : BOOL; //
SxCloseAut : BOOL; //
SxOosLi : BOOL; // Rising edge of OosLi
SxLastMode : BOOL; // Last Mode before switched to Local Mode 0 = Manual, 1 = Auto
SxOpenLocal : BOOL; // Previous value for OpenLocal
SxCloseLocal : BOOL; // Previous value for CloseLocal
_reserve : ARRAY [0..31] OF BYTE; // 32 bytes reserve
END_VAR
VAR_TEMP
stcTOP_SI :
STRUCT
EV_CLASS : BYTE; // Bits 0 to 3: Event ID· Bits 4 to 7: Event class
EV_NUM : BYTE; // Event number
PRIORITY : BYTE; // Number of the priority class (meaning OF B#16#FE: OB NOT available or locked)
NUM : BYTE; // OB number.
TYP2_3 : BYTE; // Data ID 2_3: identifies the information entered in ZI2_3
TYP1 : BYTE; // Data ID 1 : identifies the information entered in ZI1
ZI1 : WORD; // Additional information 1
ZI2_3 : DWORD; // Additional information 2_3
END_STRUCT;
stcSTART_UP_SI :
STRUCT
EV_CLASS : BYTE; // Bits 0 to 3: Event ID· Bits 4 to 7: Event class
EV_NUM : BYTE; // Event number
PRIORITY : BYTE; // Number of the priority class (meaning OF B#16#FE: OB NOT available or locked)
NUM : BYTE; // OB number.
TYP2_3 : BYTE; // Data ID 2_3: identifies the information entered in ZI2_3
TYP1 : BYTE; // Data ID 1 : identifies the information entered in ZI1
ZI1 : WORD; // Additional information 1
ZI2_3 : DWORD; // Additional information 2_3
END_STRUCT;
byTemp : BYTE; // Variable for temp byte.
// Worst signal status
stcInST :
STRUCT
b0 : BYTE;
b1 : BYTE;
b2 : BYTE;
b3 : BYTE;
b4 : BYTE;
b5 : BYTE;
b6 : BYTE;
b7 : BYTE;
b8 : BYTE;
b9 : BYTE;
b10 : BYTE;
b11 : BYTE;
b12 : BYTE;
b13 : BYTE;
b14 : BYTE;
b15 : BYTE;
END_STRUCT; // Input 0..15 Signal Status
xErrorNum : INT; // Variable for classification ErrorNum
dwStatus1 : DWORD; // Variable for status1
ArrdwStatus1 AT dwStatus1 : SBits32inDWORD;
(*
ArrdwStatus1 AT dwStatus1 :
STRUCT
Bit24 : BOOL; // SafePos
Bit25 : BOOL; // UserAna1 interconnected
Bit26 : BOOL; // UserAna2 interconnected
Bit27 : BOOL; // Not used
Bit28 : BOOL; // Not used
Bit29 : BOOL; // Not used
Bit30 : BOOL; // Not used
Bit31 : BOOL; // Not used
Bit16 : BOOL; // 1 = Intlock is active
Bit17 : BOOL; // 1 = Permit is active
Bit18 : BOOL; // 1 = Protect is active
Bit19 : BOOL; // OpenForce.Value
Bit20 : BOOL; // CloseForce.Value
Bit21 : BOOL; // Force
Bit22 : BOOL; // Automatic preview (1=open)
Bit23 : BOOL; // Bumpless switchover to automatic mode is active
Bit8 : BOOL; // Open/closed command (1 = Open)
Bit9 : BOOL; // FbkOpenOut.Value
Bit10 : BOOL; // FbkCloseOut.Value
Bit11 : BOOL; // Feedback error without control change
Bit12 : BOOL; // Feedback error due to control change
Bit13 : BOOL; // BypProt
Bit14 : BOOL; // Invalid signal status
Bit15 : BOOL; // Mode switchover error
Bit0 : BOOL; // Occupied
Bit1 : BOOL; // BatchEn
Bit2 : BOOL; // SimOn
Bit3 : BOOL; // OosAct.Value
Bit4 : BOOL; // OosLi.Value
Bit5 : BOOL; // AutoAct.Value
Bit6 : BOOL; // LocalAct.Value
Bit7 : BOOL; // 0: Open padlock in block icon, 1: Closed padlock in block icon
END_STRUCT;
*)
dwStatus2 : DWORD; // Variable for status2
ArrdwStatus2 AT dwStatus2 : SBits32inDWORD;
(*
ArrdwStatus2 AT dwStatus2 :
STRUCT
Bit24 : BOOL; // Not used
Bit25 : BOOL; // Not used
Bit26 : BOOL; // Not used
Bit27 : BOOL; // Not used
Bit28 : BOOL; // Not used
Bit29 : BOOL; // Not used
Bit30 : BOOL; // Bypass information from previous function block
Bit31 : BOOL; // MS_RelOp
Bit16 : BOOL; // 1 = Input parameter FbkClose is interconnected
Bit17 : BOOL; // 1 = Input parameter FbkOpen is interconnected
Bit18 : BOOL; // Reset request in automatic
Bit19 : BOOL; // 1 = No impact of input signals on local mode with LocalSetting = 2 and LocalSetting = 4
Bit20 : BOOL; // 1 = Valve open
Bit21 : BOOL; // 1 = Valve closed
Bit22 : BOOL; // 1 = Valve opening
Bit23 : BOOL; // 1 = Valve closing
Bit8 : BOOL; // Not used
Bit9 : BOOL; // Not used
Bit10 : BOOL; // Not used
Bit11 : BOOL; // Not used
Bit12 : BOOL; // Not used
Bit13 : BOOL; // Not used
Bit14 : BOOL; // Not used
Bit15 : BOOL; // Not used
Bit0 : BOOL; // MsgLock
Bit1 : BOOL; // Not used
Bit2 : BOOL; // Display for interlocks in block icon
Bit3 : BOOL; // Not used
Bit4 : BOOL; // Not used
Bit5 : BOOL; // Not used
Bit6 : BOOL; // Not used
Bit7 : BOOL; // Not used
END_STRUCT;
*)
dwStatus3 : DWORD; // Variable for status3
//ArrdwStatus3 AT dwStatus3 : SBits32inDWORD;
ArrdwStatus3 AT dwStatus3:
STRUCT
X24 : BOOL; // Not used
X25 : BOOL; // Not used
X26 : BOOL; // Show automatic preview in the standard view
X27 : BOOL; // Not used
X28 : BOOL; // GrpErr.Value
X29 : BOOL; // RdyToStart.Value
X30 : BOOL; // Not used
X31 : BOOL; // Not used
X16 : BOOL; // Not used
X17 : BOOL; // Not used
X18 : BOOL; // Not used
X19 : BOOL; // Not used
X20 : BOOL; // Not used
X21 : BOOL; // Not used
X22 : BOOL; // Not used
X23 : BOOL; // Not used
X8 : BOOL; // "Interlock" button is enabled
X9 : BOOL; // "Permission" button is enabled
X10 : BOOL; // "Protection" button is enabled
X11 : BOOL; // Not used
X12 : BOOL; // Not used
X13 : BOOL; // Not used
X14 : BOOL; // Not used
X15 : BOOL; // Not used
BYTE0 : BYTE; // Effective Signal1 of the message block connected via EventTsIn
END_STRUCT;
dwOS_Perm : DWORD; // Temporary variable for the value of OS_PermOut/OS_PermLog
ArrxOS_Perm AT dwOS_Perm :
STRUCT
Bit0 : BOOL; // 1 = Operator can shift to automatic mode
Bit1 : BOOL; // 1 = Operator can shift to manual mode
Bit2 : BOOL; // 1 = Operator can shift to local mode
Bit3 : BOOL; // 1 = Operator can shift to out of service mode
Bit4 : BOOL; // 1 = Operator can open the valve
Bit5 : BOOL; // 1 = Operator can close the valve
Bit6 : BOOL; // 1 = Operator can reset the valve
Bit7 : BOOL; // 1 = Operator can define the monitoring time for startup
Bit8 : BOOL; // 1 = Operator can define the monitoring time for runtime
Bit9 : BOOL; // 1 = Operator can activate the function monitoring time (bits 7 & 8)
Bit10 : BOOL; // 1 = Operator can enable function simulation
Bit11 : BOOL; // 1 = Operator can enable function maintenance release
Bit12 : BOOL; // Not used
Bit13 : BOOL; // Not used
Bit14 : BOOL; // Not used
Bit15 : BOOL; // Not used
Bit16 : BOOL; // Not used
Bit17 : BOOL; // Not used
Bit18 : BOOL; // Not used
Bit19 : BOOL; // Not used
Bit20 : BOOL; // Not used
Bit21 : BOOL; // Not used
Bit22 : BOOL; // Not used
Bit23 : BOOL; // Not used
Bit24 : BOOL; // Not used
Bit25 : BOOL; // Not used
Bit26 : BOOL; // Not used
Bit27 : BOOL; // Not used
Bit28 : BOOL; // Not used
Bit29 : BOOL; // Not used
Bit30 : BOOL; // Not used
Bit31 : BOOL; // Not used
END_STRUCT;
ArrbdwOS_Perm AT dwOS_Perm :
STRUCT
BYTE0 : BYTE ; // BYTE 0
BYTE1 : BYTE ; // BYTE 1
BYTE2 : BYTE ; // BYTE 2
BYTE3 : BYTE ; // BYTE 3
END_STRUCT;
xOSPerAuto : BOOL; // 1 = Operator enabled to switch to automatic mode
xOSPerMan : BOOL; // 1 = Operator enabled to switch to manual mode
xOSPerLocal : BOOL; // 1 = Operator enabled to switch motor to local mode
xOSPerOOS : BOOL; // 1 = Operator enabled to switch to OOS mode
xOSPerOpen : BOOL; // 1 = Operator enable to open the valve
xOSPerClose : BOOL; // 1 = Operator enable to close the valve
xOSPerRst : BOOL; // 1 = Operator enabled to reset the valve
xOSPerDynMon : BOOL; // 1 = Operator enabled to configure the dynamic monitoring time
xOSPerStaMon : BOOL; // 1 = Operator enabled to configure the static monitoring time
xOSPerMonOnOff : BOOL; // 1 = Operator enabled to switch On/Off monitoring