-
Notifications
You must be signed in to change notification settings - Fork 5
/
CPU_RT.scl
1774 lines (1718 loc) · 95 KB
/
CPU_RT.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: FB128
// Symbolic Name: CPU_RT
// Symbol Comment: CPU Performance Block
// Family: @SYSTEM
// Version: 7.1
// Author: DRIVER80
// Last modified: 01/18/2012
// Use: SFB54,UDT3,FC260,SFC43,SFC51,SFC78
// Size: 29016 bytes
// Signature: generiert vom SCL Übersetzer Version: SCLCOMP K05.03.07.00_01.02.00.01 release
{
Scl_ResetOptions ;
Scl_OverwriteBlocks:= 'y' ;
Scl_GenerateReferenceData := 'y' ;
Scl_S7ServerActive:= 'n' ;
Scl_CreateObjectCode:= 'y' ;
Scl_OptimizeObjectCode:= 'y' ;
Scl_MonitorArrayLimits:= 'n' ;
Scl_CreateDebugInfo := 'n' ;
Scl_SetOKFlag:= 'y' ;
Scl_SetMaximumStringLength:= '254'
}
FUNCTION_BLOCK FB1128
TITLE ='CPU Performance Block'
{ S7_hardware := 'rack'; S7_m_c := 'true'; S7_tasklist := 'OB1,OB100' }
AUTHOR : DRIVER80
FAMILY : '@SYSTEM'
NAME : CPU_RT
VERSION : '7.1'
VAR_INPUT
MAX_RTRG { S7_m_c := 'true' }: INT := 50; //Maximum count of retrigger attempts
MAX_LIM { S7_m_c := 'true' }: REAL := 7.500000e+001; //Total Maximum Limit in percent
MAX_VAL { S7_m_c := 'true' }: REAL := 9.500000e+001; //Max Value -> for calculating the Reset of the idle cycles
HYS { S7_m_c := 'true' }: REAL := 5.000000e+000; //Hysteresis of Total Maximum Limit in percent
RESET { S7_m_c := 'true'; S7_string_1 := '1' }: BOOL := TRUE; //Reset Average, Min and Max Values
OB30_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB30 takes part in steps of avoiding cpu stop
OB31_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB31 takes part in steps of avoiding cpu stop
OB32_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB32 takes part in steps of avoiding cpu stop
OB33_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB33 takes part in steps of avoiding cpu stop
OB34_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB34 takes part in steps of avoiding cpu stop
OB35_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB35 takes part in steps of avoiding cpu stop
OB36_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB36 takes part in steps of avoiding cpu stop
OB37_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB37 takes part in steps of avoiding cpu stop
OB38_ATTN { S7_m_c := 'true'; S7_string_0 := '0'; S7_string_1 := '1' }: BOOL := TRUE; //OB38 takes part in steps of avoiding cpu stop
SAMPLE_AV { S7_visible := 'false'; S7_m_c := 'true' }: DINT := 25; //Sample Faktor for displayed values
SAMPLE_RE { S7_visible := 'false'; S7_m_c := 'true' }: DINT := 5; //Sample Faktor for calculate the undo of the idle cycle procedure
N_REQ_ERR { S7_m_c := 'true' }: INT := 4; //Number of OB3x Request Errors
UNDO_CYC { S7_m_c := 'true' }: INT := 5; //Counter in the slowest OB for undo emergency mode
DELTA_L { S7_visible := 'false'; S7_link := 'false' }: BOOL := TRUE; //Delta Load is concluded
RUNUPCYC { S7_visible := 'false'; S7_link := 'false' }: INT := 5; //Number of Run Up Cycles
END_VAR
VAR_OUTPUT
IDLE_CYC { S7_m_c := 'true' }: INT ; //Current idle cycles for OS
OB30_N_START : INT ; //Startvalue for the idle cycles
OB31_N_START : INT ; //Startvalue for the idle cycles
OB32_N_START : INT ; //Startvalue for the idle cycles
OB33_N_START : INT ; //Startvalue for the idle cycles
OB34_N_START : INT ; //Startvalue for the idle cycles
OB35_N_START : INT ; //Startvalue for the idle cycles
OB36_N_START : INT ; //Startvalue for the idle cycles
OB37_N_START : INT ; //Startvalue for the idle cycles
OB38_N_START : INT ; //Startvalue for the idle cycles
OB30_N_CNT : INT ; //Current value for the idle cycles
OB31_N_CNT : INT ; //Current value for the idle cycles
OB32_N_CNT : INT ; //Current value for the idle cycles
OB33_N_CNT : INT ; //Current value for the idle cycles
OB34_N_CNT : INT ; //Current value for the idle cycles
OB35_N_CNT : INT ; //Current value for the idle cycles
OB36_N_CNT : INT ; //Current value for the idle cycles
OB37_N_CNT : INT ; //Current value for the idle cycles
OB38_N_CNT : INT ; //Current value for the idle cycles
EXC_FR30 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB30
EXC_FR31 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB31
EXC_FR32 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB32
EXC_FR33 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB33
EXC_FR34 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB34
EXC_FR35 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB35
EXC_FR36 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB36
EXC_FR37 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB37
EXC_FR38 { S7_visible := 'false'; S7_m_c := 'true' }: INT ; //Execution Frequency OB38
DAT_PLAU : BOOL ; //slowest OB3x has slowest priority
SFC78_EX { S7_m_c := 'true' }: BOOL ; //SFC78 available on the CPU
SL_OB : BYTE ; //slowest OB3x
SL_OB_EXC_FR : INT ; //Execution Frequency of slowest OB3x
N_OB1_CYC : INT ; //Number of OB1 cycles while one slowest OB cycle
MAXCYCTI { S7_m_c := 'true' }: INT ; //Maximum Cycle Time of CPU
TOTALCUR { S7_m_c := 'true' }: REAL ; //Total Current Value (net average of all OB3x/OB8x + OB1) in percent
TOTALAV { S7_m_c := 'true' }: REAL ; //Total Average CPU (net of all OB3x/OB8x + OB1 Net) in percent
TOTALMAX { S7_m_c := 'true' }: REAL ; //Total Max Value in percent (derived from current net of all OB3x/OB8x + OB1)
TOTALMIN { S7_m_c := 'true' }: REAL ; //Total Min Value in percent (derived from current net of all OB3x/OB8x + OB1)
NET01CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB01
NET01AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB01
NET01MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB01
NET01MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB01
NET01PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB01
NET30CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB30
GRO30CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB30
NET30AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB30
GRO30AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB30
NET30MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB30
GRO30MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB30
NET30MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB30
GRO30MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB30
NET30PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB30
GRO30PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB30
NET31CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB31
GRO31CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB31
NET31AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB31
GRO31AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB31
NET31MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB31
GRO31MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB31
NET31MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB31
GRO31MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB31
NET31PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB31
GRO31PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB31
NET32CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB32
GRO32CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB32
NET32AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB32
GRO32AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB32
NET32MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB32
GRO32MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB32
NET32MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB32
GRO32MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB32
NET32PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB32
GRO32PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB32
NET33CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB33
GRO33CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB33
NET33AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB33
GRO33AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB33
NET33MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB33
GRO33MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB33
NET33MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB33
GRO33MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB33
NET33PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB33
GRO33PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB33
NET34CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB34
GRO34CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB34
NET34AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB34
GRO34AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB34
NET34MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB34
GRO34MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB34
NET34MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB34
GRO34MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB34
NET34PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB34
GRO34PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB34
NET35CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB35
GRO35CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB35
NET35AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB35
GRO35AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB35
NET35MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB35
GRO35MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB35
NET35MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB35
GRO35MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB35
NET35PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB35
GRO35PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB35
NET36CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB36
GRO36CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB36
NET36AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB36
GRO36AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB36
NET36MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB36
GRO36MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB36
NET36MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB36
GRO36MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB36
NET36PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB36
GRO36PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB36
NET37CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB37
GRO37CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB37
NET37AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB37
GRO37AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB37
NET37MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB37
GRO37MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB37
NET37MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB37
GRO37MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB37
NET37PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB37
GRO37PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB37
NET38CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB38
GRO38CUR { S7_m_c := 'true' }: REAL ; //current Gross cycle time of OB38
NET38AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB38
GRO38AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Gross cycle time of OB38
NET38MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB38
GRO38MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Gross cycle time of OB38
NET38MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Net cycle time of OB38
GRO38MIN { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //minimum Gross cycle time of OB38
NET38PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB38
GRO38PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Gross average percentage cycle time of OB38
NET81CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB81
NET81AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB81
NET81MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB81
NET81PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB81
NET82CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB82
NET82AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB82
NET82MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB82
NET82PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB82
NET83CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB82
NET83AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB83
NET83MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB83
NET83PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB83
NET84CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB84
NET84AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB84
NET84MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB84
NET84PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB84
NET85CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB85
NET85AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB85
NET85MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB85
NET85PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB85
NET86CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB86
NET86AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB86
NET86MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB86
NET86PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB86
NET87CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB87
NET87AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB87
NET87MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB87
NET87PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB87
NET88CUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of OB88
NET88AV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of OB88
NET88MAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of OB88
NET88PER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of OB88
NETXXCUR { S7_m_c := 'true' }: REAL ; //current Net cycle time of Rest e.G. OB5x
NETXXAV { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Average Net cycle time of Rest e.G. OB5x
NETXXMAX { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //maximum Net cycle time of Rest e.G. OB5x
NETXXPER { S7_visible := 'false'; S7_m_c := 'true' }: REAL ; //Net average percentage cycle time of Rest e.G. OB5x
REQ30ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ31ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ32ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ33ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ34ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ35ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ36ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ37ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ38ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
REQ01ERR { S7_visible := 'false'; S7_m_c := 'true' }: BOOL ; //OB Request Error occured since last Reset
ERR_NUM { S7_visible := 'false' }: INT ; //Error Number
CPU_RT_DATA { S7_visible := 'false' }: STRUCT
OB_NUM : BYTE ; //OB Number which caused Request Error
MAX_LIM : BOOL ; //Total Current Value > MAX_LIM
EMERGENCY_MODE : BOOL ; //Emergency mode, cyclic OBґs get idle cycles
NOT_PCS7_COMPLIANT : BOOL ; //priority of OB3x not PCS7 compliant
REQUEST_ERR : BOOL ; //Reserved
RES_2 : BOOL ; //Reserved
RES_3 : BOOL ; //Reserved
RES_4 : BOOL ; //Reserved
RES_5 : BOOL ; //Reserved
RES : DINT ; //Reserved
END_STRUCT ;
END_VAR
VAR
RALRM : SFB54; //Multiinstanz RALRM
reserve1 : DWORD ;
reserve2 : DWORD ;
srTemp1 : REAL ;
srTemp2 : REAL ;
srTemp3 : REAL ;
srTemp4 : REAL ;
siRUNUPCNT : INT ; //intertner Zдhler RUNUPCYC
sbERSTLAUF : BOOL := TRUE; //Erstlaufmerker
sbyASIG0a : BYTE ;
sbyASIG0a_bool AT sbyASIG0a: ARRAY[0..7] OF BOOL;
sbyASIG0b : BYTE ;
Temp : ARRAY [0 .. 126 ] OF WORD ;
Temp_byte AT Temp : ARRAY[0..251] OF BYTE;
Temp_int AT Temp : ARRAY[0..126] OF INT;
Temp_bool AT Temp : ARRAY[0..2016] OF BOOL;
Temp_st AT Temp : ARRAY[0..8] OF STRUCT
b1 : BYTE;
b2 : BYTE;
b3 : BYTE;
b4 : BYTE;
arr: ARRAY[2..13] OF INT ;
END_STRUCT;
sReqErrOBNr : BYTE ; //OB which put out an Request Error
siTemp : ARRAY [0 .. 62 ] OF //temp data Structure while cyclic OBs running
DINT ; //temp data Structure while cyclic OBs running
siTemp_real AT siTemp : ARRAY[0..62] OF REAL ;
sSZL822_BUSY : BOOL := TRUE;
sSZL222_BUSY : BOOL := TRUE;
sSZL112_BUSY : BOOL := TRUE;
sSlowestOB : BYTE ;
sSlowestOBExcFreq : INT ;
sSlowestOBPriority : BYTE ;
sFastestOB : BYTE ;
sFastestOBExcFreq : INT ;
sFastestOBPriority : BYTE ;
sDataPlausible : BOOL ;
sSFC78available : BOOL ; //SFC78 ist verfьgbar
sOBExcFreq : ARRAY [30 .. 38 ] OF INT ;
sNumOB1Cyc : INT ; //count of ob1 cycles while one slowest OB cycle Time
s30AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet30 : DINT ; //Current net value in micro seconds in DINT
siGRO30 : DINT ; //Current gross value in micro seconds in DINT
sNET30CurrPer : REAL ; //Current value in percent
srNET30AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
s31AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet31 : DINT ; //Current net value in micro seconds in DINT
siGRO31 : DINT ; //Current gross value in micro seconds in DINT
sNET31CurrPer : REAL ; //Current value in percent
srNET31AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
s32AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet32 : DINT ; //Current net value in micro seconds in DINT
siGRO32 : DINT ; //Current gross value in micro seconds in DINT
sNET32CurrPer : REAL ; //Current value in percent
srNET32AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
s33AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet33 : DINT ; //Current net value in micro seconds in DINT
siGRO33 : DINT ; //Current gross value in micro seconds in DINT
sNET33CurrPer : REAL ; //Current value in percent
srNET33AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
s34AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet34 : DINT ; //Current net value in micro seconds in DINT
siGRO34 : DINT ; //Current gross value in micro seconds in DINT
sNET34CurrPer : REAL ; //Current value in percent
srNET34AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
s35AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet35 : DINT ; //Current net value in micro seconds in DINT
siGRO35 : DINT ; //Current gross value in micro seconds in DINT
sNET35CurrPer : REAL ; //Current value in percent
srNET35AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
s36AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet36 : DINT ; //Current net value in micro seconds in DINT
siGRO36 : DINT ; //Current gross value in micro seconds in DINT
sNET36CurrPer : REAL ; //Current value in percent
srNET36AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
s37AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet37 : DINT ; //Current net value in micro seconds in DINT
siGRO37 : DINT ; //Current gross value in micro seconds in DINT
sNET37CurrPer : REAL ; //Current value in percent
srNET37AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
s38AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet38 : DINT ; //Current net value in micro seconds in DINT
siGRO38 : DINT ; //Current gross value in micro seconds in DINT
sNET38CurrPer : REAL ; //Current value in percent
srNET38AVPerIntern : REAL ; //intern average value in percent for undo the idle cycles
srNETAccuPerIntern : REAL ; //accumulate all NET values for undo the idle cycles
sTotalAVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
sTotalCurrPer : REAL ; //Current value in percent
s01AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet01 : DINT ; //Current net value in micro seconds in DINT
sNET01CurrPer : REAL ; //Current value in percent
srNET01Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET01Merker : BOOL ; //merker for 1 slowest ob cycle expired
s81AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet81 : DINT ; //Current net value in micro seconds in DINT
sNET81CurrPer : REAL ; //Current value in percent
srNET81Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET81Merker : BOOL ; //merker for 1 slowest ob cycle expired
s82AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet82 : DINT ; //Current net value in micro seconds in DINT
sNET82CurrPer : REAL ; //Current value in percent
srNET82Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET82Merker : BOOL ; //merker for 1 slowest ob cycle expired
s83AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet83 : DINT ; //Current net value in micro seconds in DINT
sNET83CurrPer : REAL ; //Current value in percent
srNET83Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET83Merker : BOOL ; //merker for 1 slowest ob cycle expired
s84AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet84 : DINT ; //Current net value in micro seconds in DINT
sNET84CurrPer : REAL ; //Current value in percent
srNET84Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET84Merker : BOOL ; //merker for 1 slowest ob cycle expired
s85AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet85 : DINT ; //Current net value in micro seconds in DINT
sNET85CurrPer : REAL ; //Current value in percent
srNET85Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET85Merker : BOOL ; //merker for 1 slowest ob cycle expired
s86AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet86 : DINT ; //Current net value in micro seconds in DINT
sNET86CurrPer : REAL ; //Current value in percent
srNET86Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET86Merker : BOOL ; //merker for 1 slowest ob cycle expired
s87AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet87 : DINT ; //Current net value in micro seconds in DINT
sNET87CurrPer : REAL ; //Current value in percent
srNET87Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET87Merker : BOOL ; //merker for 1 slowest ob cycle expired
s88AVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNet88 : DINT ; //Current net value in micro seconds in DINT
sNET88CurrPer : REAL ; //Current value in percent
srNET88Sample : REAL ; //current value in terms of slowest OB Exc Freq
sbNET88Merker : BOOL ; //merker for 1 slowest ob cycle expired
sXXAVCounter : DINT := 1; //counter for 1.. sample necessary to recognice the first cyc after reset
siNetXX : DINT ; //Current net value in micro seconds in DINT
sNETXXCurrPer : REAL ; //Current value in percent
srNETXXSample : REAL ; //current value in terms of slowest OB Exc Freq
sbNETXXMerker : BOOL ; //merker for 1 slowest ob cycle expired
srNETXXAVPerIntern : REAL ;
END_VAR
VAR_TEMP
RETURN_CODE : INT ; //Hilfsparameter (Wechselnde Bedeutung)!
x : INT ; //Hilfsparameter (Wechselnde Bedeutung)!
y : INT ; //Hilfsparameter (Wechselnde Bedeutung)!
Busy : BOOL ;
ERR : INT ; //Error beim Anlauf
TOP_SI : STRUCT
EV_CLASS : BYTE ;
EV_NUM : BYTE ;
PRIORITY : BYTE ;
NUM : BYTE ;
TYP2_3 : BYTE ;
TYP1 : BYTE ;
ZI1 : WORD ;
ZI2 : BYTE ;
ZI3 : BYTE ;
ZI4 : BYTE ;
ZI5 : BYTE ;
T : DATE_AND_TIME ;
SUBNET : BYTE ; //Mastersystem
RACK : BYTE ; //Racknr.
SL_TYP : BYTE ; //Slave- und Profil-Typ
A_INF : BYTE ; //A-Info- Typ/Struktur-Vers
ET_CR_FL : BYTE ; //ET-CR-Flags
ET_ER_FL : BYTE ; //ET-ER- Flags
PNO_ID : WORD ; //PNO-Ident
END_STRUCT ;
AINFO : BYTE ;
STATUS : DWORD ; //Funktionsergebnis/Fehlermeldung
SZL_HEADER : STRUCT
LENTHDR : WORD ;
N_DR : WORD ;
END_STRUCT ;
MS_AS : DWORD ; //Maintenance State AS
END_VAR
BEGIN
RALRM(MODE := 1
,MLEN := 0
,TINFO := TOP_SI
,AINFO := AINFO
);
STATUS:=RALRM.STATUS;
IF (TOP_SI.NUM=B#16#64) OR (((sbERSTLAUF) OR DELTA_L) AND (TOP_SI.NUM=B#16#1)) THEN
sDataPlausible:=false;
IF TOP_SI.NUM=B#16#64 THEN
siRUNUPCNT:=RUNUPCYC;
FOR x:=0 TO 126 BY 1 DO
Temp[x]:=W#16#0;
END_FOR;
REPEAT
RETURN_CODE:=RDSYSST(REQ := true
,SZL_ID := W#16#112
,INDEX := W#16#100
,BUSY := sSZL112_BUSY
,SZL_HEADER := SZL_HEADER
,DR := Temp
);
UNTIL NOT(TOP_SI.NUM=B#16#64) OR NOT sSZL112_BUSY
END_REPEAT;
IF NOT sSZL112_BUSY THEN
SFC78_EX:=false;
FOR x:=0 TO WORD_TO_INT(SZL_HEADER.N_DR) BY 1 DO
IF Temp[x]=W#16#106 THEN
SFC78_EX:=true;
END_IF;
END_FOR;
END_IF;
ELSE
sSZL112_BUSY:=false;
END_IF;
IF NOT sSZL112_BUSY THEN
FOR x:=0 TO 13 BY 1 DO
Temp[x]:=W#16#0;
END_FOR;
REPEAT
RETURN_CODE:=RDSYSST(REQ := true
,SZL_ID := W#16#222
,INDEX := W#16#50
,BUSY := sSZL222_BUSY
,SZL_HEADER := SZL_HEADER
,DR := Temp
);
UNTIL NOT(TOP_SI.NUM=B#16#64) OR NOT sSZL222_BUSY
END_REPEAT;
END_IF;
IF NOT sSZL222_BUSY AND NOT sSZL112_BUSY THEN
MAXCYCTI:=WORD_TO_INT(Temp[5]);
FOR x:=0 TO 126 BY 1 DO
Temp[x]:=W#16#0;
END_FOR;
REPEAT
RETURN_CODE:=RDSYSST(REQ := true
,SZL_ID := W#16#822
,INDEX := W#16#1E
,BUSY := sSZL822_BUSY
,SZL_HEADER := SZL_HEADER
,DR := Temp_byte
);
UNTIL NOT(TOP_SI.NUM=B#16#64) OR NOT sSZL822_BUSY
END_REPEAT;
IF RETURN_CODE<>0 THEN
ERR_NUM:=1;
END_IF;
IF NOT sSZL822_BUSY AND ERR_NUM<>1 THEN
FOR x:=30 TO 38 BY 1 DO
sOBExcFreq[x]:=0;
END_FOR;
sOBExcFreq[BYTE_TO_INT(Temp_byte[3])]:=Temp_int[5];
sSlowestOB:=Temp_byte[3];
sSlowestOBExcFreq:=Temp_int[5];
sSlowestOBPriority:=Temp_byte[2];
FOR x:=1 TO 8 BY 1 DO
IF Temp_st[x].arr[5]>0 THEN
sOBExcFreq[BYTE_TO_INT(Temp_st[x].b4)]:=Temp_st[x].arr[5];
IF Temp_st[x].arr[5]>sSlowestOBExcFreq THEN
sSlowestOB:=Temp_st[x].b4;
sSlowestOBExcFreq:=Temp_st[x].arr[5];
sSlowestOBPriority:=Temp_st[x].b3;
ELSE
IF Temp_st[x].arr[5]=sSlowestOBExcFreq THEN
IF BYTE_TO_INT(Temp_st[x].b3)<BYTE_TO_INT(sSlowestOBPriority) THEN
sSlowestOB:=Temp_st[x].b4;
sSlowestOBExcFreq:=Temp_st[x].arr[5];
sSlowestOBPriority:=Temp_st[x].b3;
END_IF;
END_IF;
END_IF;
ELSE
EXIT;
END_IF;
END_FOR;
FOR x:=0 TO 8 BY 1 DO
IF Temp_st[x].arr[5]>0 THEN
IF BYTE_TO_INT(sSlowestOBPriority)<BYTE_TO_INT(Temp_st[x].b3) OR
Temp_st[x].b4=sSlowestOB
THEN
sDataPlausible:=true;
CPU_RT_DATA.NOT_PCS7_COMPLIANT:=false;
ELSE
sDataPlausible:=false;
CPU_RT_DATA.NOT_PCS7_COMPLIANT:=true;
EXIT;
END_IF;
ELSE
EXIT;
END_IF;
END_FOR;
DAT_PLAU:=sDataPlausible;
SL_OB:=sSlowestOB;
SL_OB_EXC_FR:=sSlowestOBExcFreq;
sbERSTLAUF:=false;
DELTA_L:=false;
RESET:=true;
FOR x:=0 TO 62 BY 1 DO
siTemp[x]:=0;
END_FOR;
END_IF;
END_IF;
ELSE;
END_IF;
IF ERR_NUM<>1 AND sSlowestOBExcFreq>0 THEN
IF NOT SFC78_EX THEN
IF TOP_SI.NUM=sSlowestOB AND sDataPlausible THEN
siTemp[17]:=siTemp[17]+1;
IF siTemp[21]=0 THEN
siTemp[17]:=siTemp[17]+1;
ELSE
siTemp[17]:=0;
END_IF;
IF siTemp[17]>=UNDO_CYC THEN
siTemp[17]:=0;
IF OB30_N_START>1 OR
OB31_N_START>1 OR
OB32_N_START>1 OR
OB33_N_START>1 OR
OB34_N_START>1 OR
OB35_N_START>1 OR
OB36_N_START>1 OR
OB37_N_START>1 OR
OB38_N_START>1
THEN
IF IDLE_CYC>1 THEN
IDLE_CYC:=IDLE_CYC-1;
END_IF;
IF OB30_N_START>1 THEN
OB30_N_START:=OB30_N_START-1;
END_IF;
IF OB31_N_START>1 THEN
OB31_N_START:=OB31_N_START-1;
END_IF;
IF OB32_N_START>1 THEN
OB32_N_START:=OB32_N_START-1;
END_IF;
IF OB33_N_START>1 THEN
OB33_N_START:=OB33_N_START-1;
END_IF;
IF OB34_N_START>1 THEN
OB34_N_START:=OB34_N_START-1;
END_IF;
IF OB35_N_START>1 THEN
OB35_N_START:=OB35_N_START-1;
END_IF;
IF OB36_N_START>1 THEN
OB36_N_START:=OB36_N_START-1;
END_IF;
IF OB37_N_START>1 THEN
OB37_N_START:=OB37_N_START-1;
END_IF;
IF OB38_N_START>1 THEN
OB38_N_START:=OB38_N_START-1;
END_IF;
ELSIF NOT OB30_ATTN AND OB30_N_START>0 OR
NOT OB31_ATTN AND OB31_N_START>0 OR
NOT OB32_ATTN AND OB32_N_START>0 OR
NOT OB33_ATTN AND OB33_N_START>0 OR
NOT OB34_ATTN AND OB34_N_START>0 OR
NOT OB35_ATTN AND OB35_N_START>0 OR
NOT OB36_ATTN AND OB36_N_START>0 OR
NOT OB37_ATTN AND OB37_N_START>0 OR
NOT OB38_ATTN AND OB38_N_START>0
THEN
IF NOT OB30_ATTN AND OB30_N_START>0 THEN
OB30_N_START:=OB30_N_START-1;
END_IF;
IF NOT OB31_ATTN AND OB31_N_START>0 THEN
OB31_N_START:=OB31_N_START-1;
END_IF;
IF NOT OB32_ATTN AND OB32_N_START>0 THEN
OB32_N_START:=OB32_N_START-1;
END_IF;
IF NOT OB33_ATTN AND OB33_N_START>0 THEN
OB33_N_START:=OB33_N_START-1;
END_IF;
IF NOT OB34_ATTN AND OB34_N_START>0 THEN
OB34_N_START:=OB34_N_START-1;
END_IF;
IF NOT OB35_ATTN AND OB35_N_START>0 THEN
OB35_N_START:=OB35_N_START-1;
END_IF;
IF NOT OB36_ATTN AND OB36_N_START>0 THEN
OB36_N_START:=OB36_N_START-1;
END_IF;
IF NOT OB37_ATTN AND OB37_N_START>0 THEN
OB37_N_START:=OB37_N_START-1;
END_IF;
IF NOT OB38_ATTN AND OB38_N_START>0 THEN
OB38_N_START:=OB38_N_START-1;
END_IF;
ELSIF OB30_N_START>0 OR
OB31_N_START>0 OR
OB32_N_START>0 OR
OB33_N_START>0 OR
OB34_N_START>0 OR
OB35_N_START>0 OR
OB36_N_START>0 OR
OB37_N_START>0 OR
OB38_N_START>0
THEN
IF IDLE_CYC>0 THEN IDLE_CYC:=IDLE_CYC-1; END_IF;
IF OB30_N_START>0 THEN OB30_N_START:=OB30_N_START-1; END_IF;
IF OB31_N_START>0 THEN OB31_N_START:=OB31_N_START-1; END_IF;
IF OB32_N_START>0 THEN OB32_N_START:=OB32_N_START-1; END_IF;
IF OB33_N_START>0 THEN OB33_N_START:=OB33_N_START-1; END_IF;
IF OB34_N_START>0 THEN OB34_N_START:=OB34_N_START-1; END_IF;
IF OB35_N_START>0 THEN OB35_N_START:=OB35_N_START-1; END_IF;
IF OB36_N_START>0 THEN OB36_N_START:=OB36_N_START-1; END_IF;
IF OB37_N_START>0 THEN OB37_N_START:=OB37_N_START-1; END_IF;
IF OB38_N_START>0 THEN OB38_N_START:=OB38_N_START-1; END_IF;
ELSE
CPU_RT_DATA.EMERGENCY_MODE:=false;
END_IF;
END_IF;
IF siRUNUPCNT>0 THEN
siRUNUPCNT:=siRUNUPCNT-1;
END_IF;
N_OB1_CYC:=sNumOB1Cyc;
sNumOB1Cyc:=0;
siTemp[60]:=0;
FOR x:=30 TO 38 BY 1 DO
siTemp[60]:=siTemp[60]+siTemp[x];
siTemp[x]:=0;
END_FOR;
IF siTemp[60]=0 THEN
CPU_RT_DATA.REQUEST_ERR:=false;
END_IF;
END_IF;
ELSE
IF siRUNUPCNT=0 THEN
CASE BYTE_TO_INT(TOP_SI.NUM) OF
30 :
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 30 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet30 // Runtime of the most recent execution
,LAST_ET := siGRO30 // Time between the call and the end of execution
,CUR_T := siTemp[25] // Time of the OB request
,CUR_RT := siTemp[26] // Expired execution runtime
,CUR_ET := siTemp[27] // Time expired
,NEXT_ET := siTemp[28] // time-to-go between the actual time and the time of execution
);
NET30CUR:=DINT_TO_REAL(siNet30)/1000.0;
GRO30CUR:=DINT_TO_REAL(siGRO30)/1000.0;
EXC_FR30:=sOBExcFreq[30];
sNET30CurrPer:=NET30CUR/EXC_FR30*100.0;
IF NOT RESET THEN
srTemp1:=(NET30CUR-NET30AV)/s30AVCounter+NET30AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN NET30AV:=srTemp1; END_IF;
srTemp1:=(GRO30CUR-GRO30AV)/s30AVCounter+GRO30AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN GRO30AV:=srTemp1; END_IF;
IF s30AVCounter<sSlowestOBExcFreq*SAMPLE_AV/EXC_FR30 THEN
s30AVCounter:=s30AVCounter+1;
END_IF;
NET30PER:=NET30AV/EXC_FR30*100.0;
GRO30PER:=GRO30AV/EXC_FR30*100.0;
END_IF;
srTemp1:=(NET30CUR/EXC_FR30*100.0-srNET30AVPerIntern)/
(sSlowestOBExcFreq*SAMPLE_RE/EXC_FR30)+
srNET30AVPerIntern;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN srNET30AVPerIntern:=srTemp1; END_IF;
IF NET30CUR>NET30MAX THEN NET30MAX:=NET30CUR; END_IF;
IF NET30CUR<NET30MIN THEN NET30MIN:=NET30CUR; END_IF;
IF GRO30CUR>GRO30MAX THEN GRO30MAX:=GRO30CUR; END_IF;
IF GRO30CUR<GRO30MIN THEN GRO30MIN:=GRO30CUR; END_IF;
31:
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 31 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet31 // Runtime of the most recent execution
,LAST_ET := siGRO31 // Time between the call and the end of execution
,CUR_T := siTemp[25] // Time of the OB request
,CUR_RT := siTemp[26] // Expired execution runtime
,CUR_ET := siTemp[27] // Time expired
,NEXT_ET := siTemp[28] // time-to-go between the actual time and the time of execution
);
NET31CUR:=DINT_TO_REAL(siNet31)/1000.0;
GRO31CUR:=DINT_TO_REAL(siGRO31)/1000.0;
EXC_FR31:=sOBExcFreq[31];
sNET31CurrPer:=NET31CUR/EXC_FR31*100.0;
IF NOT RESET THEN
srTemp1:=(NET31CUR-NET31AV)/s31AVCounter+NET31AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN NET31AV:=srTemp1; END_IF;
srTemp1:=(GRO31CUR-GRO31AV)/s31AVCounter+GRO31AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN GRO31AV:=srTemp1; END_IF;
IF s31AVCounter<sSlowestOBExcFreq*SAMPLE_AV/EXC_FR31 THEN
s31AVCounter:=s31AVCounter+1;
END_IF;
NET31PER:=NET31AV/EXC_FR31*100.0;
GRO31PER:=GRO31AV/EXC_FR31*100.0;
END_IF;
srTemp1:=(NET31CUR/EXC_FR31*100.0-srNET31AVPerIntern)/
(sSlowestOBExcFreq*SAMPLE_RE/EXC_FR31)+
srNET31AVPerIntern;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN srNET31AVPerIntern:=srTemp1; END_IF;
IF NET31CUR>NET31MAX THEN NET31MAX:=NET31CUR; END_IF;
IF NET31CUR<NET31MIN THEN NET31MIN:=NET31CUR; END_IF;
IF GRO31CUR>GRO31MAX THEN GRO31MAX:=GRO31CUR; END_IF;
IF GRO31CUR<GRO31MIN THEN GRO31MIN:=GRO31CUR; END_IF;
32:
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 32 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet32 // Runtime of the most recent execution
,LAST_ET := siGRO32 // Time between the call and the end of execution
,CUR_T := siTemp[25] // Time of the OB request
,CUR_RT := siTemp[26] // Expired execution runtime
,CUR_ET := siTemp[27] // Time expired
,NEXT_ET := siTemp[28] // time-to-go between the actual time and the time of execution
);
NET32CUR:=DINT_TO_REAL(siNet32)/1000.0;
GRO32CUR:=DINT_TO_REAL(siGRO32)/1000.0;
EXC_FR32:=sOBExcFreq[32];
sNET32CurrPer:=NET32CUR/EXC_FR32*100.0;
IF NOT RESET THEN
srTemp1:=(NET32CUR-NET32AV)/s32AVCounter+NET32AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN NET32AV:=srTemp1; END_IF;
srTemp1:=(GRO32CUR-GRO32AV)/s32AVCounter+GRO32AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN GRO32AV:=srTemp1; END_IF;
IF s32AVCounter<sSlowestOBExcFreq*SAMPLE_AV/EXC_FR32 THEN
s32AVCounter:=s32AVCounter+1;
END_IF;
NET32PER:=NET32AV/EXC_FR32*100.0;
GRO32PER:=GRO32AV/EXC_FR32*100.0;
END_IF;
srTemp1:=(NET32CUR/EXC_FR32*100.0-srNET32AVPerIntern)/
(sSlowestOBExcFreq*SAMPLE_RE/EXC_FR32)+
srNET32AVPerIntern;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN srNET32AVPerIntern:=srTemp1; END_IF;
IF NET32CUR>NET32MAX THEN NET32MAX:=NET32CUR; END_IF;
IF NET32CUR<NET32MIN THEN NET32MIN:=NET32CUR; END_IF;
IF GRO32CUR>GRO32MAX THEN GRO32MAX:=GRO32CUR; END_IF;
IF GRO32CUR<GRO32MIN THEN GRO32MIN:=GRO32CUR; END_IF;
33:
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 33 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet33 // Runtime of the most recent execution
,LAST_ET := siGRO33 // Time between the call and the end of execution
,CUR_T := siTemp[25] // Time of the OB request
,CUR_RT := siTemp[26] // Expired execution runtime
,CUR_ET := siTemp[27] // Time expired
,NEXT_ET := siTemp[28] // time-to-go between the actual time and the time of execution
);
NET33CUR:=DINT_TO_REAL(siNet33)/1000.0;
GRO33CUR:=DINT_TO_REAL(siGRO33)/1000.0;
EXC_FR33:=sOBExcFreq[33];
sNET33CurrPer:=NET33CUR/EXC_FR33*100.0;
IF NOT RESET THEN
srTemp1:=(NET33CUR-NET33AV)/s33AVCounter+NET33AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN NET33AV:=srTemp1; END_IF;
srTemp1:=(GRO33CUR-GRO33AV)/s33AVCounter+GRO33AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN GRO33AV:=srTemp1; END_IF;
IF s33AVCounter<sSlowestOBExcFreq*SAMPLE_AV/EXC_FR33 THEN
s33AVCounter:=s33AVCounter+1;
END_IF;
NET33PER:=NET33AV/EXC_FR33*100.0;
GRO33PER:=GRO33AV/EXC_FR33*100.0;
END_IF;
srTemp1:=(NET33CUR/EXC_FR33*100.0-srNET33AVPerIntern)/
(sSlowestOBExcFreq*SAMPLE_RE/EXC_FR33)+
srNET33AVPerIntern;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN srNET33AVPerIntern:=srTemp1; END_IF;
IF NET33CUR>NET33MAX THEN NET33MAX:=NET33CUR; END_IF;
IF NET33CUR<NET33MIN THEN NET33MIN:=NET33CUR; END_IF;
IF GRO33CUR>GRO33MAX THEN GRO33MAX:=GRO33CUR; END_IF;
IF GRO33CUR<GRO33MIN THEN GRO33MIN:=GRO33CUR; END_IF;
34:
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 34 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet34 // Runtime of the most recent execution
,LAST_ET := siGRO34 // Time between the call and the end of execution
,CUR_T := siTemp[25] // Time of the OB request
,CUR_RT := siTemp[26] // Expired execution runtime
,CUR_ET := siTemp[27] // Time expired
,NEXT_ET := siTemp[28] // time-to-go between the actual time and the time of execution
);
NET34CUR:=DINT_TO_REAL(siNet34)/1000.0;
GRO34CUR:=DINT_TO_REAL(siGRO34)/1000.0;
EXC_FR34:=sOBExcFreq[34];
sNET34CurrPer:=NET34CUR/EXC_FR34*100.0;
IF NOT RESET THEN
srTemp1:=(NET34CUR-NET34AV)/s34AVCounter+NET34AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN NET34AV:=srTemp1; END_IF;
srTemp1:=(GRO34CUR-GRO34AV)/s34AVCounter+GRO34AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN GRO34AV:=srTemp1; END_IF;
IF s34AVCounter<sSlowestOBExcFreq*SAMPLE_AV/EXC_FR34 THEN
s34AVCounter:=s34AVCounter+1;
END_IF;
NET34PER:=NET34AV/EXC_FR34*100.0;
GRO34PER:=GRO34AV/EXC_FR34*100.0;
END_IF;
srTemp1:=(NET34CUR/EXC_FR34*100.0-srNET34AVPerIntern)/
(sSlowestOBExcFreq*SAMPLE_RE/EXC_FR34)+
srNET34AVPerIntern;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN srNET34AVPerIntern:=srTemp1; END_IF;
IF NET34CUR>NET34MAX THEN NET34MAX:=NET34CUR; END_IF;
IF NET34CUR<NET34MIN THEN NET34MIN:=NET34CUR; END_IF;
IF GRO34CUR>GRO34MAX THEN GRO34MAX:=GRO34CUR; END_IF;
IF GRO34CUR<GRO34MIN THEN GRO34MIN:=GRO34CUR; END_IF;
35:
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 35 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet35 // Runtime of the most recent execution
,LAST_ET := siGRO35 // Time between the call and the end of execution
,CUR_T := siTemp[25] // Time of the OB request
,CUR_RT := siTemp[26] // Expired execution runtime
,CUR_ET := siTemp[27] // Time expired
,NEXT_ET := siTemp[28] // time-to-go between the actual time and the time of execution
);
NET35CUR:=DINT_TO_REAL(siNet35)/1000.0;
GRO35CUR:=DINT_TO_REAL(siGRO35)/1000.0;
EXC_FR35:=sOBExcFreq[35];
sNET35CurrPer:=NET35CUR/EXC_FR35*100.0;
IF NOT RESET THEN
srTemp1:=(NET35CUR-NET35AV)/s35AVCounter+NET35AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN NET35AV:=srTemp1; END_IF;
srTemp1:=(GRO35CUR-GRO35AV)/s35AVCounter+GRO35AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN GRO35AV:=srTemp1; END_IF;
IF s35AVCounter<sSlowestOBExcFreq*SAMPLE_AV/EXC_FR35 THEN
s35AVCounter:=s35AVCounter+1;
END_IF;
NET35PER:=NET35AV/EXC_FR35*100.0;
GRO35PER:=GRO35AV/EXC_FR35*100.0;
END_IF;
srTemp1:=(NET35CUR/EXC_FR35*100.0-srNET35AVPerIntern)/
(sSlowestOBExcFreq*SAMPLE_RE/EXC_FR35)+
srNET35AVPerIntern;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN srNET35AVPerIntern:=srTemp1; END_IF;
IF NET35CUR>NET35MAX THEN NET35MAX:=NET35CUR; END_IF;
IF NET35CUR<NET35MIN THEN NET35MIN:=NET35CUR; END_IF;
IF GRO35CUR>GRO35MAX THEN GRO35MAX:=GRO35CUR; END_IF;
IF GRO35CUR<GRO35MIN THEN GRO35MIN:=GRO35CUR; END_IF;
36:
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 36 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet36 // Runtime of the most recent execution
,LAST_ET := siGRO36 // Time between the call and the end of execution
,CUR_T := siTemp[25] // Time of the OB request
,CUR_RT := siTemp[26] // Expired execution runtime
,CUR_ET := siTemp[27] // Time expired
,NEXT_ET := siTemp[28] // time-to-go between the actual time and the time of execution
);
NET36CUR:=DINT_TO_REAL(siNet36)/1000.0;
GRO36CUR:=DINT_TO_REAL(siGRO36)/1000.0;
EXC_FR36:=sOBExcFreq[36];
sNET36CurrPer:=NET36CUR/EXC_FR36*100.0;
IF NOT RESET THEN
srTemp1:=(NET36CUR-NET36AV)/s36AVCounter+NET36AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN NET36AV:=srTemp1; END_IF;
srTemp1:=(GRO36CUR-GRO36AV)/s36AVCounter+GRO36AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN GRO36AV:=srTemp1; END_IF;
IF s36AVCounter<sSlowestOBExcFreq*SAMPLE_AV/EXC_FR36 THEN
s36AVCounter:=s36AVCounter+1;
END_IF;
NET36PER:=NET36AV/EXC_FR36*100.0;
GRO36PER:=GRO36AV/EXC_FR36*100.0;
END_IF;
srTemp1:=(NET36CUR/EXC_FR36*100.0-srNET36AVPerIntern)/
(sSlowestOBExcFreq*SAMPLE_RE/EXC_FR36)+
srNET36AVPerIntern;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN srNET36AVPerIntern:=srTemp1; END_IF;
IF NET36CUR>NET36MAX THEN NET36MAX:=NET36CUR; END_IF;
IF NET36CUR<NET36MIN THEN NET36MIN:=NET36CUR; END_IF;
IF GRO36CUR>GRO36MAX THEN GRO36MAX:=GRO36CUR; END_IF;
IF GRO36CUR<GRO36MIN THEN GRO36MIN:=GRO36CUR; END_IF;
37:
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 37 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet37 // Runtime of the most recent execution
,LAST_ET := siGRO37 // Time between the call and the end of execution
,CUR_T := siTemp[25] // Time of the OB request
,CUR_RT := siTemp[26] // Expired execution runtime
,CUR_ET := siTemp[27] // Time expired
,NEXT_ET := siTemp[28] // time-to-go between the actual time and the time of execution
);
NET37CUR:=DINT_TO_REAL(siNet37)/1000.0;
GRO37CUR:=DINT_TO_REAL(siGRO37)/1000.0;
EXC_FR37:=sOBExcFreq[37];
sNET37CurrPer:=NET37CUR/EXC_FR37*100.0;
IF NOT RESET THEN
srTemp1:=(NET37CUR-NET37AV)/s37AVCounter+NET37AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN NET37AV:=srTemp1; END_IF;
srTemp1:=(GRO37CUR-GRO37AV)/s37AVCounter+GRO37AV;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN GRO37AV:=srTemp1; END_IF;
IF s37AVCounter<sSlowestOBExcFreq*SAMPLE_AV/EXC_FR37 THEN
s37AVCounter:=s37AVCounter+1;
END_IF;
NET37PER:=NET37AV/EXC_FR37*100.0;
GRO37PER:=GRO37AV/EXC_FR37*100.0;
END_IF;
srTemp1:=(NET37CUR/EXC_FR37*100.0-srNET37AVPerIntern)/
(sSlowestOBExcFreq*SAMPLE_RE/EXC_FR37)+
srNET37AVPerIntern;
srTemp1:=ChkREAL(In := srTemp1,ErrNum := ERR );
IF ERR<>3 THEN srNET37AVPerIntern:=srTemp1; END_IF;
IF NET37CUR>NET37MAX THEN NET37MAX:=NET37CUR; END_IF;
IF NET37CUR<NET37MIN THEN NET37MIN:=NET37CUR; END_IF;
IF GRO37CUR>GRO37MAX THEN GRO37MAX:=GRO37CUR; END_IF;
IF GRO37CUR<GRO37MIN THEN GRO37MIN:=GRO37CUR; END_IF;
38:
RETURN_CODE:=OB_RT( // Determining the OB Program Runtime
OB_NR := 38 // OB whose last evaluated times are to be queried.
,PRIO := y // The priority class of the queried OB is output in PRIO
,LAST_RT := siNet38 // Runtime of the most recent execution
,LAST_ET := siGRO38 // Time between the call and the end of execution