-
Notifications
You must be signed in to change notification settings - Fork 5
/
MOD_1.scl
868 lines (839 loc) · 33.4 KB
/
MOD_1.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
// Name: FB91
// Symbolic Name: MOD_1
// Symbol Comment: Non-diagnostic Module Check (<=16 Channel)
// Family: @SYSTEM
// Version: 7.2
// Author: DRIVER80
// Last modified: 04/11/2012
// Use: SFB35,SFC51, UDT1
// Size: 5214 byte
// 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:= 'y' ;
Scl_CreateObjectCode:= 'y' ;
Scl_OptimizeObjectCode:= 'y' ;
Scl_MonitorArrayLimits:= 'n' ;
Scl_CreateDebugInfo := 'n' ;
Scl_SetOKFlag:= 'n' ;
Scl_SetMaximumStringLength:= '254'
}
FUNCTION_BLOCK FB191
TITLE ='Non-diagnostic Module Check (<=16 Channel)'
{ S7_hardware := 'sm'; S7_alarm_ui := '1'; S7_tasklist := 'OB1,OB83,OB85,OB86,OB100'; S7_tag := 'false' }
AUTHOR : DRIVER80
FAMILY : '@SYSTEM'
NAME : MOD_1
VERSION : '7.2'
VAR_INPUT
LADDR { S7_link := 'false' }: INT ; //Logical Address of Module
SUBN_TYP { S7_link := 'false' }: BOOL ; //1=External DP-Interface
SUBN1_ID { S7_link := 'false' }: BYTE := B#16#FF; //ID of Primary Subnet
SUBN2_ID { S7_link := 'false' }: BYTE := B#16#FF; //ID of Redundant Subnet
RACK_NO { S7_link := 'false' }: BYTE ; //Rack Number
SLOT_NO { S7_link := 'false' }: BYTE ; //Slot Number
CHAN_NUM { S7_link := 'false' }: INT ; //Highest Channel Address
MODE_00 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 0
MODE_00_ar AT MODE_00: ARRAY[0..0] OF DWORD;
MODE_01 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 1
MODE_02 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 2
MODE_03 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 3
MODE_04 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 4
MODE_05 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 5
MODE_06 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 6
MODE_07 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 7
MODE_08 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 8
MODE_09 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 9
MODE_10 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 10
MODE_11 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 11
MODE_12 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 12
MODE_13 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 13
MODE_14 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 14
MODE_15 { S7_visible := 'false'; S7_link := 'false' }: DWORD ; //Mode Channel 15
DELAY1 { S7_visible := 'false'; S7_link := 'false' }: INT := 2; //Alarm Delay 1 (s)
DELAY2 { S7_visible := 'false'; S7_link := 'false' }: INT := 2; //Alarm Delay 2 (s)
EV_ID { S7_visible := 'false'; S7_link := 'false'; S7_param := 'false'; S7_server := 'alarm_archiv'; S7_a_type := 'alarm_8p' }: DWORD ; //Event ID
EN_MSG { S7_visible := 'false'; S7_link := 'false' }: BOOL := TRUE; //1=Enable Alarm
MS { S7_link := 'false'; S7_m_c := 'true' }: DWORD ; //Maintenance State
END_VAR
VAR_OUTPUT
QERR { S7_visible := 'false'; S7_dynamic := 'true' }: BOOL := TRUE; //1=Runtime Error
QRACKF { S7_dynamic := 'true' }: BOOL ; //1=Rack Failure
QMODF { S7_dynamic := 'true' }: BOOL ; //1=Module Removed / Out of Order
QPERAF { S7_dynamic := 'true' }: BOOL ; //1=Module I/O Access Failure
O_MS { S7_visible := 'false' }: DWORD ; //Maintenance State
CH_EXIST { S7_visible := 'false'; S7_m_c := 'true' }: DWORD ; //Channel exist
CH_EXIST_byte AT CH_EXIST: ARRAY[0..3] OF BYTE;
CH_ACTIVE { S7_visible := 'false'; S7_m_c := 'true' }: DWORD ; //Channel active
CH_ACTIVE_byte AT CH_ACTIVE: ARRAY[0..3] OF BYTE;
CH_OK { S7_visible := 'false'; S7_m_c := 'true' }: DWORD ; //Channel OK
CH_OK_byte AT CH_OK: ARRAY[0..3] OF BYTE;
EXT_STAT { S7_visible := 'true'; S7_m_c := 'true' }: DWORD ; //Maintenance Release - Extended Status
EXT_STAT_byte AT EXT_STAT: ARRAY[0..3] OF BYTE;
OMODE_00 { S7_visible := 'false' }: DWORD ; //Mode Channel 0
OMODE_00_ar AT OMODE_00: ARRAY[0..0] OF DWORD;
OMODE_01 { S7_visible := 'false' }: DWORD ; //Mode Channel 1
OMODE_02 { S7_visible := 'false' }: DWORD ; //Mode Channel 2
OMODE_03 { S7_visible := 'false' }: DWORD ; //Mode Channel 3
OMODE_04 { S7_visible := 'false' }: DWORD ; //Mode Channel 4
OMODE_05 { S7_visible := 'false' }: DWORD ; //Mode Channel 5
OMODE_06 { S7_visible := 'false' }: DWORD ; //Mode Channel 6
OMODE_07 { S7_visible := 'false' }: DWORD ; //Mode Channel 7
OMODE_08 { S7_visible := 'false' }: DWORD ; //Mode Channel 8
OMODE_09 { S7_visible := 'false' }: DWORD ; //Mode Channel 9
OMODE_10 { S7_visible := 'false' }: DWORD ; //Mode Channel 10
OMODE_11 { S7_visible := 'false' }: DWORD ; //Mode Channel 11
OMODE_12 { S7_visible := 'false' }: DWORD ; //Mode Channel 12
OMODE_13 { S7_visible := 'false' }: DWORD ; //Mode Channel 13
OMODE_14 { S7_visible := 'false' }: DWORD ; //Mode Channel 14
OMODE_15 { S7_visible := 'false' }: DWORD ; //Mode Channel 15
DXCHG_00 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 0
DXCHG_00_ar AT DXCHG_00: ARRAY[0..0] OF DWORD;
DXCHG_01 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 1
DXCHG_02 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 2
DXCHG_03 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 3
DXCHG_04 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 4
DXCHG_05 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 5
DXCHG_06 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 6
DXCHG_07 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 7
DXCHG_08 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 8
DXCHG_09 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 9
DXCHG_10 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 10
DXCHG_11 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 11
DXCHG_12 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 12
DXCHG_13 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 13
DXCHG_14 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 14
DXCHG_15 { S7_visible := 'false' }: DWORD ; //Bidirectional data exchange Channel 15
MSG_STAT { S7_visible := 'false' }: WORD ; //Message Failure
MSG_ACK { S7_visible := 'false' }: WORD ; //Message Acknowledged
MOD_INF { S7_visible := 'false' }: STRUCT
SUBN_ID : BYTE ; //Subnet Number
RACK_NO : BYTE ; //Rack Number
SLOT_NO : BYTE ; //Slot Number
SUBSL_NO : BYTE ; //Subslot Number
BASADR : WORD ; //Base Address
EXPECTYP : WORD ; //Expected Module Type
ACTTYP : WORD ; //Actual Module Type
RESERVE : WORD ; //Reserved
IOSTAT : BYTE ; //Data ID of Logical Address
IOSTAT_0 : BOOL ; //1=Module Fault
IOSTAT_1 : BOOL ; //1=Module Exists
IOSTAT_2 : BOOL ; //1=Module Removed
IOSTAT_3 : BOOL ; //Reserved
IOSTAT_4 : BOOL ; //Reserved
IOSTAT_5 : BOOL ; //1=Module can be Host for Submodule
IOSTAT_6 : BOOL ; //Reserved for S7-400
IOSTAT_7 : BOOL ; //1=Module on Local Bus Segment
AREA_ID : WORD ; //Area ID
END_STRUCT ;
END_VAR
VAR_IN_OUT
CPU_DIAG : STRUCT
H_MODE : BOOL ; //1= H-System
V1_MODE : BOOL ; //1= CPU DP V1 Mode
CPU_ERR0 : BOOL ; //1=CPU Error in Rack0
CPU_ERR1 : BOOL ; //1=CPU Error in Rack1
OB1_TIME : DINT ; //OB1_TIME_TCK
OB_S : STRUCT
NUM_CNT : INT ; //Counter Startinfo OB_NR
NUM_01 : BYTE ; //Startinfo OB_NO
NUM_02 : BYTE ; //Startinfo OB_NO
NUM_03 : BYTE ; //Startinfo OB_NO
NUM_04 : BYTE ; //Startinfo OB_NO
NUM_05 : BYTE ; //Startinfo OB_NO
NUM_06 : BYTE ; //Startinfo OB_NO
NUM_07 : BYTE ; //Startinfo OB_NO
NUM_08 : BYTE ; //Startinfo OB_NO
NUM_09 : BYTE ; //Startinfo OB_NO
NUM_10 : BYTE ; //Startinfo OB_NO
NUM_11 : BYTE ; //Startinfo OB_NO
NUM_12 : BYTE ; //Startinfo OB_NO
NUM_13 : BYTE ; //Startinfo OB_NO
NUM_14 : BYTE ; //Startinfo OB_NO
NUM_15 : BYTE ; //Startinfo OB_NO
NUM_16 : BYTE ; //Startinfo OB_NO
END_STRUCT ;
OB_72 : STRUCT
TOP_SI : STRUCT
EV_CLASS : BYTE ; //Event class
EV_NUM : BYTE ; //Event number
PRIORITY : BYTE ; //Priority
NUM : BYTE ; //OB-Number
TYP2_3 : BYTE ; //Reserved
TYP1 : BYTE ; //Reserved
ZI1 : WORD ; //Reserved
ZI2_3 : DWORD ; //Reserved
END_STRUCT ;
END_STRUCT ;
OB_70 : STRUCT
TOP_SI : STRUCT
EV_CLASS : BYTE ; //Event class
EV_NUM : BYTE ; //Event number
PRIORITY : BYTE ; //Priority
NUM : BYTE ; //OB-Number
TYP2_3 : BYTE ; //Reserved
TYP1 : BYTE ; //Reserved
ZI1 : WORD ; //Reserved
ZI2_3 : DWORD ; //Reserved
END_STRUCT ;
SUBNET : BYTE ; //SUBNET ID
RACK : BYTE ; //Rack Number
STATUS : DWORD ; //Status SFB 54
END_STRUCT ;
OB_82 : STRUCT
TOP_SI : STRUCT
EV_CLASS : BYTE ; //Event class
EV_NUM : BYTE ; //Event number
PRIORITY : BYTE ; //Priority
NUM : BYTE ; //OB-Number
TYP2_3 : BYTE ; //Reserved
TYP1 : BYTE ; //Reserved
ZI1 : WORD ; //Reserved
ZI2_3 : DWORD ; //Reserved
END_STRUCT ;
SUBNET : BYTE ; //SUBNET ID
RACK : BYTE ; //Rack Number
SL_TYP : BYTE ; //Slave-/Profiltyp
A_INF : BYTE ; //Alarm-Info-Type
ET_CR_FL : BYTE ; //ET-CR-Flags
ET_ER_FL : BYTE ; //ET-ER-Flags
PNO_ID : WORD ; //PROFIBUS Ident Number
AINFO : STRUCT
D_LENGTH : BYTE ; //Data Length
A_TYP : BYTE ; //Alarm Type
SLOT : BYTE ; //Slot Number
A_SPEC : BYTE ; //Alarm-Specifire
A_0 : BYTE ; //Alarm Information
A_1 : BYTE ; //Alarm Information
A_2 : BYTE ; //Alarm Information
A_3 : BYTE ; //Alarm Information
A_4 : BYTE ; //Alarm Information
A_5 : BYTE ; //Alarm Information
A_6 : BYTE ; //Alarm Information
A_7 : BYTE ; //Alarm Information
A_8 : BYTE ; //Alarm Information
A_9 : BYTE ; //Alarm Information
A_10 : BYTE ; //Alarm Information
A_11 : BYTE ; //Alarm Information
A_12 : BYTE ; //Alarm Information
A_13 : BYTE ; //Alarm Information
A_14 : BYTE ; //Alarm Information
A_15 : BYTE ; //Alarm Information
A_16 : BYTE ; //Alarm Information
A_17 : BYTE ; //Alarm Information
A_18 : BYTE ; //Alarm Information
A_19 : BYTE ; //Alarm Information
A_20 : BYTE ; //Alarm Information
A_21 : BYTE ; //Alarm Information
A_22 : BYTE ; //Alarm Information
A_23 : BYTE ; //Alarm Information
A_24 : BYTE ; //Alarm Information
A_25 : BYTE ; //Alarm Information
A_26 : BYTE ; //Alarm Information
A_27 : BYTE ; //Alarm Information
A_28 : BYTE ; //Alarm Information
A_29 : BYTE ; //Alarm Information
A_30 : BYTE ; //Alarm Information
A_31 : BYTE ; //Alarm Information
A_32 : BYTE ; //Alarm Information
A_33 : BYTE ; //Alarm Information
A_34 : BYTE ; //Alarm Information
A_35 : BYTE ; //Alarm Information
A_36 : BYTE ; //Alarm Information
A_37 : BYTE ; //Alarm Information
A_38 : BYTE ; //Alarm Information
A_39 : BYTE ; //Alarm Information
A_40 : BYTE ; //Alarm Information
A_41 : BYTE ; //Alarm Information
A_42 : BYTE ; //Alarm Information
A_43 : BYTE ; //Alarm Information
A_44 : BYTE ; //Alarm Information
A_45 : BYTE ; //Alarm Information
A_46 : BYTE ; //Alarm Information
A_47 : BYTE ; //Alarm Information
A_48 : BYTE ; //Alarm Information
A_49 : BYTE ; //Alarm Information
A_50 : BYTE ; //Alarm Information
A_51 : BYTE ; //Alarm Information
A_52 : BYTE ; //Alarm Information
A_53 : BYTE ; //Alarm Information
A_54 : BYTE ; //Alarm Information
A_55 : BYTE ; //Alarm Information
A_56 : BYTE ; //Alarm Information
A_57 : BYTE ; //Alarm Information
A_58 : BYTE ; //Alarm Information
A_59 : BYTE ; //Alarm Information
END_STRUCT ;
STATUS : DWORD ; //Status SFB 54
END_STRUCT ;
OB_83 : STRUCT
TOP_SI : STRUCT
EV_CLASS : BYTE ; //Event class
EV_NUM : BYTE ; //Event number
PRIORITY : BYTE ; //Priority
NUM : BYTE ; //OB-Number
TYP2_3 : BYTE ; //Reserved
TYP1 : BYTE ; //Reserved
ZI1 : WORD ; //Reserved
ZI2_3 : DWORD ; //Reserved
END_STRUCT ;
SUBNET : BYTE ; //SUBNET ID
RACK : BYTE ; //Rack Number
SLOT : BYTE ; //Slot Number
STATUS : DWORD ; //Status SFB 54
END_STRUCT ;
OB_85 : STRUCT
TOP_SI : STRUCT
EV_CLASS : BYTE ; //Event class
EV_NUM : BYTE ; //Event number
PRIORITY : BYTE ; //Priority
NUM : BYTE ; //OB-Number
TYP2_3 : BYTE ; //Reserved
TYP1 : BYTE ; //Reserved
ZI1 : WORD ; //Reserved
ZI2_3 : DWORD ; //Reserved
END_STRUCT ;
SUBNET : BYTE ; //SUBNET ID
RACK : BYTE ; //Rack Number
SLOT : BYTE ; //Slot Number
STATUS : DWORD ; //Status SFB 54
END_STRUCT ;
OB_86 : STRUCT
TOP_SI : STRUCT
EV_CLASS : BYTE ; //Event class
EV_NUM : BYTE ; //Event number
PRIORITY : BYTE ; //Priority
NUM : BYTE ; //OB-Number
TYP2_3 : BYTE ; //Reserved
TYP1 : BYTE ; //Reserved
ZI1 : WORD ; //Reserved
ZI2_3 : DWORD ; //Reserved
END_STRUCT ;
SUBNET : BYTE ; //SUBNET ID
RACK : BYTE ; //Rack Number
STATUS : DWORD ; //Status SFB 54
END_STRUCT ;
OB_81 : STRUCT
TOP_SI : STRUCT
EV_CLASS : BYTE ; //Event class
EV_NUM : BYTE ; //Event number
PRIORITY : BYTE ; //Priority
NUM : BYTE ; //OB-Number
TYP2_3 : BYTE ; //Reserved
TYP1 : BYTE ; //Reserved
ZI1 : WORD ; //Reserved
ZI2_3 : DWORD ; //Reserved
END_STRUCT ;
END_STRUCT ;
END_STRUCT ;
RAC_DIAG : STRUCT
SUBN1_ID : BYTE ; //ID of Primary Subnet
SUBN2_ID : BYTE ; //ID of Redundant Subnet
RACK_NO : BYTE ; //Rack Number
SUBN_TYP : BOOL ; //1=External DP-Interface
SUBN1ERR : BOOL ; //1=Slave 1 Failure
SUBN2ERR : BOOL ; //1=Slave 2 Failure
SUBN1ACT : BOOL ; //1=Slave 1 Active
SUBN2ACT : BOOL ; //1=Slave 2 Active
RACK_ERR : BOOL ; //1=Rack Error
V1_MODE : BOOL ; //1= DPV1 - Mode
END_STRUCT ;
ACC_MODE { S7_link := 'false' }: BOOL ; //1=Accept New Mode Settings
END_VAR
VAR
sdwRESERVE : DWORD ; //Reserve fьr zukьnftige Дnderungen
sdwRESERVE_bool AT sdwRESERVE: ARRAY[0..31] OF BOOL;
ID : STRUCT
IOTYP : BYTE := B#16#FF; //Ein- oder Ausgabemodul
CHECK : BOOL ; //Konfiguration OK?
END_STRUCT ;
RQ : STRUCT
PARA : BOOL ; //Parametrierung angefordert / lдuft
OB1PARA : BOOL ; //OB1 liest Parametrierung
OB1OUTP : BOOL ; //OB1 schreibt Ausgдnge
OB1ALRM : BOOL ; //OB1 sendet ALARM_8P
OB1INT : BOOL ; //OB1 wдhrend Parametrierung oder Diagnose unterbrochen?
END_STRUCT ;
MODF : STRUCT
ZS : BOOL ; //Baugruppe gezogen
ZSMEL : BOOL ; //Baugruppe gezogen melden // 2.8.2001 SCH
FBG : BOOL ; //Falsche Bauruppe //2.8.2001 SCH
ACC : BOOL ; //Peripheriezugriffsfehler
END_STRUCT ;
T_BG_ZS : INT ; //Ziehen Stecken Fehlertextnummer 4.5 Schultz
INI_ALRM : BOOL := TRUE; //1=ALARM_8P muЯ initialisiert werden
KIR : BOOL ; //Konfiguration im Run
KIR_OLD : BOOL ; //Hilfsmerker Konfiguration im Run
sbMODFZS : BOOL ; //Letztes gemeldetes ZS-Ereignis
sbPERAF : BOOL ; //Letztes gemeldetes PERAF-Ereignis
DEL_ACT : BOOL ; //PERAF wird fьr ьbergeordneten Fehler verzцgert
DEL_CNT : DINT ; //Verzцgerung (ms)
DEL_TIM : DINT ; //Start der Verzцgerung
DELAY : DINT ; //Eingestellte Verzцgerung
ALARM_8P_1 : SFB35; //Multiinstanzierte ALARM_8P
END_VAR
VAR_TEMP
EN_OUTP : BOOL ; //Ausgдnge freigeben
EN_ALRM : BOOL ; //Alarm_8P freigeben
sbRACKF : BOOL ; //Rackfehler
ZI1 : WORD ;
ZI2_3 : DWORD ;
NUM : BYTE ;
OB_START : WORD ;
OB_START_bool AT OB_START : ARRAY[0..15] OF BOOL;
RETURN_CODE : INT ; //Hilfsparameter (Wechselnde Bedeutung)!
CHANNELS : INT ; //Kanalanzahl der Baugruppe
SZL_HEADER : STRUCT
LENTHDR : WORD ;
N_DR : WORD ;
END_STRUCT ;
GEO : STRUCT
SUBNET : BYTE ; //SUBNET belegt 1 WORD im Speicher!
RACK : BYTE ;
SLOT : BYTE ;
END_STRUCT ;
TOP_SI : STRUCT
EV_CLASS : BYTE ;
EV_NUM : BYTE ;
PRIORITY : BYTE ;
NUM : BYTE ;
TYP2_3 : BYTE ;
TYP1 : BYTE ;
ZI1 : WORD ;
ZI2_3 : DWORD ;
END_STRUCT ;
CH_O : DWORD ;
CH_O_bool AT CH_O: ARRAY[0..31] OF BOOL;
CH_O_byte AT CH_O: ARRAY[0..3] OF BYTE;
CH_A : DWORD ;
CH_A_bool AT CH_A: ARRAY[0..31] OF BOOL;
CH_A_byte AT CH_A: ARRAY[0..3] OF BYTE;
CH_E : DWORD ;
CH_E_bool AT CH_E: ARRAY[0..31] OF BOOL;
CH_E_byte AT CH_E: ARRAY[0..3] OF BYTE;
EXT_S : DWORD ;
EXT_S_bool AT EXT_S: ARRAY[0..31] OF BOOL;
EXT_S_byte AT EXT_S: ARRAY[0..3] OF BYTE;
MS_AS : DWORD ; //Maintenance State AS
tDXCHG : DWORD ;
tDXCHG_bool AT tDXCHG: ARRAY[0..31] OF BOOL;
MOD_INF_TEMP : STRUCT
SUBN_ID_RACK_NO : WORD ; //bei dezentralem Aufbau mit PROFINET IO: Bit 15 = 1 (PROFINET IO-Kennung), die l
SLOT_NO_SUBSL_NO : WORD ; //bei dezentralem Aufbau mit PROFINET IO: Steckplatznummer
BASADR : WORD ; //Base Address
EXPECTYP : WORD ; //Expected Module Type
ACTTYP : WORD ; //Actual Module Type
RESERVE : WORD ; //Reserved
IOSTAT : BYTE ; //Data ID of Logical Address
IOSTAT_0 : BOOL ; //1=Module Fault
IOSTAT_1 : BOOL ; //1=Module Exists
IOSTAT_2 : BOOL ; //1=Module Removed
IOSTAT_3 : BOOL ; //Reserved
IOSTAT_4 : BOOL ; //Reserved
IOSTAT_5 : BOOL ; //1=Module can be Host for Submodule
IOSTAT_6 : BOOL ; //Reserved for S7-400
IOSTAT_7 : BOOL ; //1=Module on Local Bus Segment
AREA_ID : WORD ; //Area ID
END_STRUCT ;
END_VAR
BEGIN
OB_START:=W#16#0;
CASE CPU_DIAG.OB_S.NUM_CNT OF
1 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_01;
2 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_02;
3 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_03;
4 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_04;
5 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_05;
6 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_06;
7 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_07;
8 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_08;
9 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_09;
10 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_10;
11 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_11;
12 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_12;
13 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_13;
14 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_14;
15 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_15;
16 :
TOP_SI.NUM:=CPU_DIAG.OB_S.NUM_16;
ELSE;
END_CASE;
IF TOP_SI.NUM=B#16#1 THEN
OB_START_bool[6]:=true;
sbRACKF:=RAC_DIAG.RACK_ERR;
IF sbRACKF <> QRACKF THEN
IF SUBN1_ID=B#16#FF THEN
ACC_MODE:= NOT sbRACKF;
END_IF;
QRACKF:=sbRACKF;
END_IF;
ELSIF TOP_SI.NUM=B#16#55 THEN
OB_START_bool[4]:=true;
GEO.SUBNET:=CPU_DIAG.OB_85.SUBNET;
GEO.RACK:=CPU_DIAG.OB_85.RACK;
GEO.SLOT:=CPU_DIAG.OB_85.SLOT;
TOP_SI.EV_CLASS:=CPU_DIAG.OB_85.TOP_SI.EV_CLASS;
ELSIF TOP_SI.NUM=B#16#56 THEN
OB_START_bool[5]:=true;
GEO.SUBNET:=CPU_DIAG.OB_86.SUBNET;
GEO.RACK:=CPU_DIAG.OB_86.RACK;
TOP_SI.EV_CLASS:=CPU_DIAG.OB_86.TOP_SI.EV_CLASS;
TOP_SI.EV_NUM:=CPU_DIAG.OB_86.TOP_SI.EV_NUM;
TOP_SI.ZI2_3:=CPU_DIAG.OB_86.TOP_SI.ZI2_3;
ELSIF TOP_SI.NUM=B#16#53 THEN
OB_START_bool[3]:=true;
GEO.SUBNET:=CPU_DIAG.OB_83.SUBNET;
GEO.RACK:=CPU_DIAG.OB_83.RACK;
GEO.SLOT:=CPU_DIAG.OB_83.SLOT;
TOP_SI.EV_CLASS:=CPU_DIAG.OB_83.TOP_SI.EV_CLASS;
TOP_SI.EV_NUM:=CPU_DIAG.OB_83.TOP_SI.EV_NUM;
ELSIF TOP_SI.NUM=B#16#64 THEN
OB_START_bool[7]:=true;
ELSIF TOP_SI.NUM=B#16#46 THEN
OB_START_bool[0]:=true;
GEO.SUBNET:=CPU_DIAG.OB_70.SUBNET;
GEO.RACK:=CPU_DIAG.OB_70.RACK;
TOP_SI.EV_NUM:=CPU_DIAG.OB_70.TOP_SI.EV_NUM;
TOP_SI.EV_CLASS:=CPU_DIAG.OB_70.TOP_SI.EV_CLASS;
ELSIF TOP_SI.NUM=B#16#48 THEN
OB_START_bool[1]:=true;
ELSE;
END_IF;
EN_OUTP:=false;
IF OB_START_bool[6] OR OB_START_bool[7] THEN
EN_ALRM:=true;
IF OB_START_bool[6] THEN
EN_OUTP:=ACC_MODE;
RQ.PARA:=RQ.OB1INT AND RQ.OB1PARA OR RQ.PARA;
RQ.OB1INT:=false;
INI_ALRM:=(MSG_ACK AND W#16#FF)<>W#16#FF AND EN_MSG;
ELSE;
END_IF;
IF NOT RQ.PARA AND ACC_MODE OR OB_START_bool[7] THEN
ID.CHECK:=false;
RQ.PARA:=true;
CH_E:=DW#16#0;
FOR RETURN_CODE:= 0 TO CHAN_NUM BY 1 DO
CH_E_bool[RETURN_CODE]:=true; ;
END_FOR;
CH_EXIST_byte[3]:=CH_E_byte[0];
CH_EXIST_byte[2]:=CH_E_byte[1];
CH_EXIST_byte[1]:=CH_E_byte[2];
CH_EXIST_byte[0]:=CH_E_byte[3];
IF LADDR<0 THEN
ID.IOTYP:=B#16#55;
ELSE
ID.IOTYP:=B#16#54;
END_IF;
END_IF;
ACC_MODE:=false;
IF RQ.PARA THEN
RQ.OB1PARA:=OB_START_bool[6];
IF RAC_DIAG.SUBN_TYP THEN
IF BYTE_TO_INT(SUBN1_ID)>=100 THEN
ZI1:= W#16#C91;
ELSE
ZI1:= W#16#4C91;
END_IF;
ELSE
ZI1:= W#16#C91;
END_IF;
MOD_INF_TEMP.SUBN_ID_RACK_NO:=W#16#0;
MOD_INF_TEMP.SLOT_NO_SUBSL_NO:=W#16#0;
MOD_INF_TEMP.BASADR:=W#16#0;
MOD_INF_TEMP.EXPECTYP:=W#16#0;
MOD_INF_TEMP.ACTTYP:=W#16#0;
MOD_INF_TEMP.RESERVE:=W#16#0;
MOD_INF_TEMP.IOSTAT:=B#16#0;
MOD_INF_TEMP.IOSTAT_0:=false;
MOD_INF_TEMP.IOSTAT_1:=false;
MOD_INF_TEMP.IOSTAT_2:=false;
MOD_INF_TEMP.IOSTAT_3:=false;
MOD_INF_TEMP.IOSTAT_4:=false;
MOD_INF_TEMP.IOSTAT_5:=false;
MOD_INF_TEMP.IOSTAT_6:=false;
MOD_INF_TEMP.IOSTAT_7:=false;
MOD_INF_TEMP.AREA_ID:=W#16#0;
REPEAT
RETURN_CODE:=RDSYSST(REQ := true
,SZL_ID := ZI1
,INDEX := INT_TO_WORD(LADDR)
,BUSY := RQ.PARA
,SZL_HEADER := SZL_HEADER
,DR := MOD_INF_TEMP
);
UNTIL NOT OB_START_bool[7] OR NOT RQ.PARA
END_REPEAT;
IF NOT RQ.PARA THEN
IF RETURN_CODE=0 THEN
IF SHR(IN:=MOD_INF_TEMP.SUBN_ID_RACK_NO,N:=15)=W#16#1 THEN
MOD_INF.SUBN_ID:=INT_TO_BYTE(WORD_TO_INT(SHR(IN:=MOD_INF_TEMP.SUBN_ID_RACK_NO AND W#16#7800,N:=11))+100);
MOD_INF.RACK_NO:=WORD_TO_BYTE(MOD_INF_TEMP.SUBN_ID_RACK_NO AND W#16#EFF);
MOD_INF.SLOT_NO:=WORD_TO_BYTE(MOD_INF_TEMP.SLOT_NO_SUBSL_NO);
ELSE
MOD_INF.SUBN_ID:=WORD_TO_BYTE(SHR(IN:=MOD_INF_TEMP.SUBN_ID_RACK_NO,N:=8));
MOD_INF.RACK_NO:=WORD_TO_BYTE(MOD_INF_TEMP.SUBN_ID_RACK_NO AND W#16#FF);
MOD_INF.SLOT_NO:=WORD_TO_BYTE(SHR(IN:=MOD_INF_TEMP.SLOT_NO_SUBSL_NO,N:=8));
MOD_INF.SUBSL_NO:=WORD_TO_BYTE(MOD_INF_TEMP.SLOT_NO_SUBSL_NO AND W#16#FF);
END_IF;
MOD_INF.BASADR:=MOD_INF_TEMP.BASADR;
MOD_INF.EXPECTYP:=MOD_INF_TEMP.EXPECTYP;
MOD_INF.ACTTYP:=MOD_INF_TEMP.ACTTYP;
MOD_INF.RESERVE:=MOD_INF_TEMP.RESERVE;
MOD_INF.IOSTAT:=MOD_INF_TEMP.IOSTAT;
MOD_INF.IOSTAT_0:=MOD_INF_TEMP.IOSTAT_0;
MOD_INF.IOSTAT_1:=MOD_INF_TEMP.IOSTAT_1;
MOD_INF.IOSTAT_2:=MOD_INF_TEMP.IOSTAT_2;
MOD_INF.IOSTAT_3:=MOD_INF_TEMP.IOSTAT_3;
MOD_INF.IOSTAT_4:=MOD_INF_TEMP.IOSTAT_4;
MOD_INF.IOSTAT_5:=MOD_INF_TEMP.IOSTAT_5;
MOD_INF.IOSTAT_6:=MOD_INF_TEMP.IOSTAT_6;
MOD_INF.IOSTAT_7:=MOD_INF_TEMP.IOSTAT_7;
MOD_INF.AREA_ID:=MOD_INF_TEMP.AREA_ID;
ID.CHECK:=MOD_INF.SUBN_ID=RAC_DIAG.SUBN1_ID OR MOD_INF.SUBN_ID=RAC_DIAG.SUBN2_ID;
ELSE
RQ.PARA:=(RETURN_CODE=-32635) OR (RETURN_CODE=-32604) OR (RETURN_CODE=-32605) OR (RETURN_CODE=-32606) OR (RETURN_CODE=-32571);
IF NOT RQ.PARA THEN
ID.CHECK:=false;
ELSE;
END_IF;
END_IF;
IF ID.CHECK THEN
INI_ALRM:=EN_MSG;
ELSE
MODF.ACC:=false;
END_IF;
ELSE;
END_IF;
EN_OUTP:=NOT RQ.PARA;
IF EN_OUTP THEN
RQ.OB1PARA:=false;
QRACKF:=RAC_DIAG.RACK_ERR;
DEL_ACT:=false;
MODF.ZSMEL:=false;
MODF.ZS:=false;
MODF.ACC:=false;
IF NOT QRACKF THEN //a813
MODF.ZS:=MOD_INF.ACTTYP<>MOD_INF.EXPECTYP OR NOT MOD_INF.IOSTAT_1 OR MOD_INF.IOSTAT_2;
MODF.ZSMEL:=MODF.ZS;
END_IF;
END_IF;
END_IF;
ELSE
RQ.OB1INT:=true;
EN_ALRM:=false;
IF ID.CHECK THEN
IF (TOP_SI.EV_NUM=B#16#C1 OR TOP_SI.EV_NUM=B#16#C2 OR TOP_SI.EV_NUM=B#16#C6) AND OB_START_bool[5] THEN
FOR RETURN_CODE:=1 TO 21 BY 1 DO
TOP_SI.ZI2_3:=SHR(IN:=TOP_SI.ZI2_3,N:=1);
IF ((TOP_SI.ZI2_3 AND DW#16#1) <> DW#16#0) AND (RETURN_CODE=BYTE_TO_INT(RACK_NO)) THEN
GEO.RACK:=RACK_NO;
EXIT;
END_IF;
END_FOR;
END_IF;
IF (GEO.SUBNET=SUBN1_ID OR GEO.SUBNET=SUBN2_ID) AND GEO.RACK=RACK_NO THEN
sbRACKF:=RAC_DIAG.RACK_ERR;
IF QRACKF<>sbRACKF THEN
EN_OUTP:=true;
QRACKF:=sbRACKF;
IF QRACKF THEN
DEL_ACT:=false;
ELSE
DEL_ACT:=DELAY2>0;
DELAY:=DELAY2*1000;
DEL_TIM:=CPU_DIAG.OB1_TIME;
END_IF;
END_IF;
IF GEO.SLOT=SLOT_NO THEN
IF OB_START_bool[3] THEN
EN_OUTP:=true;
DEL_ACT:=false;
IF TOP_SI.EV_NUM=B#16#61 OR
((BYTE_TO_INT(SUBN1_ID)>=100) AND
(TOP_SI.EV_NUM=B#16#51 OR TOP_SI.EV_NUM=B#16#54))
THEN
MODF.ZS:=TOP_SI.EV_CLASS=B#16#39;
MODF.FBG:=false;
IF MODF.ZS THEN
MODF.ZSMEL:=true;
ELSE
MODF.ACC:=false;
MODF.ZSMEL:=false;
END_IF;
ELSE
IF TOP_SI.EV_CLASS=B#16#33 AND TOP_SI.EV_NUM=B#16#67 THEN
KIR:=true;
T_BG_ZS:=40;
ELSE
IF TOP_SI.EV_CLASS=B#16#32 AND TOP_SI.EV_NUM=B#16#67 THEN
KIR:=false;
T_BG_ZS:=40;
ELSE
IF TOP_SI.EV_CLASS=B#16#39 AND TOP_SI.EV_NUM=B#16#68 THEN
KIR:=false;
T_BG_ZS:=41;
ELSE
IF NOT (TOP_SI.EV_NUM=B#16#58) THEN
MODF.FBG:=true;
MODF.ZSMEL:=false;
END_IF;
IF TOP_SI.EV_NUM=B#16#63 OR TOP_SI.EV_NUM=B#16#55 THEN
T_BG_ZS:=35;
ELSE
IF TOP_SI.EV_NUM=B#16#64 OR TOP_SI.EV_NUM=B#16#57 THEN
T_BG_ZS:=36;
ELSE
IF TOP_SI.EV_NUM=B#16#65 OR TOP_SI.EV_NUM=B#16#56 THEN
T_BG_ZS:=37;
END_IF;
END_IF;
END_IF;
END_IF;
END_IF;
END_IF;
END_IF;
ELSE
IF OB_START_bool[4] THEN
MODF.ACC:=TOP_SI.EV_CLASS=B#16#39;
IF MODF.ACC THEN
IF MODF.ZS THEN
MODF.ACC:=false;
ELSE
DEL_ACT:=DELAY1>0 AND NOT QRACKF;
DELAY:=INT_TO_DINT(DELAY1)*1000;
DEL_TIM:=CPU_DIAG.OB1_TIME;
END_IF;
ELSE
MODF.ZS:=false;
MODF.ZSMEL:=false;
END_IF;
EN_OUTP:=true;
END_IF;
END_IF;
END_IF;
EN_ALRM:=NOT DEL_ACT;
END_IF;
ELSE
RQ.PARA:=true;
END_IF;
END_IF;
IF EN_ALRM THEN
IF DEL_ACT THEN
DEL_CNT:=CPU_DIAG.OB1_TIME - DEL_TIM;
IF DEL_CNT<0 THEN
DEL_CNT:=DEL_CNT+1879048192;
DEL_CNT:=DEL_CNT+268435456;
END_IF;
DEL_ACT:=DEL_CNT<=DELAY;
END_IF; //A839
QPERAF:= (NOT (MODF.ZS OR QRACKF OR DEL_ACT)) AND MODF.ACC;
INI_ALRM:=MODF.ZSMEL<>sbMODFZS OR QPERAF<>sbPERAF OR INI_ALRM OR KIR<>KIR_OLD;
END_IF; //A838
FOR RETURN_CODE:= 0 TO CHAN_NUM BY 1 DO
OMODE_00:= OMODE_00_ar[RETURN_CODE] AND DW#16#10000 OR OMODE_00;
END_FOR;
IF (EN_OUTP OR OB_START_bool[7] OR ((OMODE_00 AND DW#16#10000) = DW#16#10000))
OR (NOT QRACKF AND sdwRESERVE_bool[25])
THEN
sdwRESERVE_bool[25]:=QRACKF;
QMODF:=NOT ID.CHECK OR MODF.ZS;
IF QMODF OR QRACKF OR MODF.ACC THEN
ZI2_3:=DW#16#40000000;
ELSE
ZI2_3:=DW#16#80000000;
END_IF;
IF OB_START_bool[7] THEN
ZI2_3:=ZI2_3 OR DW#16#10000;
END_IF;
CH_O:=DW#16#0;
CH_A:=DW#16#0;
FOR RETURN_CODE:= 0 TO CHAN_NUM BY 1 DO
IF NOT ((MODE_00_ar[RETURN_CODE] AND DW#16#FFFF)=DW#16#0) THEN
OMODE_00_ar[RETURN_CODE]:=ZI2_3 OR MODE_00_ar[RETURN_CODE];
ELSE
OMODE_00_ar[RETURN_CODE]:=DW#16#0;
END_IF;
IF NOT ((MODE_00_ar[RETURN_CODE] AND DW#16#FFFF)=DW#16#0) THEN
CH_A_bool[RETURN_CODE]:=true;
ELSE
CH_A_bool[RETURN_CODE]:=false;
END_IF;
IF (OMODE_00_ar[RETURN_CODE] AND DW#16#FF000000)=DW#16#80000000 THEN
CH_O_bool[RETURN_CODE]:=true;
ELSIF (OMODE_00_ar[RETURN_CODE] AND DW#16#FF000000)=DW#16#40000000 THEN
CH_O_bool[RETURN_CODE]:=false;
END_IF;
END_FOR;
CH_OK_byte[3]:=CH_O_byte[0];
CH_OK_byte[2]:=CH_O_byte[1];
CH_OK_byte[1]:=CH_O_byte[2];
CH_OK_byte[0]:=CH_O_byte[3];
CH_ACTIVE_byte[3]:=CH_A_byte[0];
CH_ACTIVE_byte[2]:=CH_A_byte[1];
CH_ACTIVE_byte[1]:=CH_A_byte[2];
CH_ACTIVE_byte[0]:=CH_A_byte[3];
END_IF;
IF EN_MSG THEN
IF INI_ALRM THEN
ALARM_8P_1 (EN_R := true
,ID := W#16#EEEE
,EV_ID := EV_ID
,SIG_1 := MODF.ZSMEL
,SIG_2 := QPERAF
,SIG_3 := MODF.FBG
,SIG_4 := KIR
,SD_1 := MOD_INF.SUBN_ID
,SD_2 := MOD_INF.RACK_NO
,SD_3 := MOD_INF.SLOT_NO
,SD_4 := T_BG_ZS
);
sbMODFZS:=MODF.ZSMEL;
sbPERAF:=QPERAF;
KIR_OLD:=KIR;
MSG_STAT:=ALARM_8P_1.STATUS;
MSG_ACK:=ALARM_8P_1.ACK_STATE;
IF NOT ALARM_8P_1.DONE AND NOT ALARM_8P_1.ERROR AND ALARM_8P_1.STATUS<>W#16#B AND ALARM_8P_1.STATUS<>W#16#14 THEN
INI_ALRM:=false;
END_IF;
ELSE;
END_IF;
ELSE
INI_ALRM:=false;
END_IF;
MS_AS:=MS AND DW#16#FF010000;
IF NOT EN_MSG OR QRACKF THEN
MS_AS:=MS_AS OR DW#16#8;
ELSIF (QMODF OR QPERAF OR (T_BG_ZS=49 AND KIR)) AND EN_MSG THEN
MS_AS:=MS_AS OR DW#16#7;
ELSE;
END_IF;
FOR RETURN_CODE:= 0 TO CHAN_NUM BY 1 DO
tDXCHG:=DXCHG_00_ar[RETURN_CODE];
EXT_S_bool[RETURN_CODE]:=tDXCHG_bool[24];
END_FOR;
EXT_STAT_byte[3]:=EXT_S_byte[0];
EXT_STAT_byte[2]:=EXT_S_byte[1];
EXT_STAT_byte[1]:=EXT_S_byte[2];
EXT_STAT_byte[0]:=EXT_S_byte[3];
MS:=MS_AS;
O_MS:=MS_AS;
QERR:=NOT OK;
END_FUNCTION_BLOCK