Download  Print this page

Mitsubishi Electric MELSEC iQ-R-R00CPU User Manual

Melsec iq-r series cpu module application user's manual
Hide thumbs
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Table Of Contents
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

Advertisement

MELSEC iQ-R CPU Module
User's Manual (Application)
-R00CPU
-R01CPU
-R02CPU
-R04CPU
-R04ENCPU
-R08CPU
-R08ENCPU
-R08PCPU
-R08PSFCPU
-R08SFCPU
-R16CPU
-R16ENCPU
-R16PCPU
-R16PSFCPU
-R16SFCPU
-R32CPU
-R32ENCPU
-R32PCPU
-R32PSFCPU
-R32SFCPU
-R120CPU
-R120ENCPU
-R120PCPU
-R120PSFCPU
-R120SFCPU
-R6RFM
-R6PSFM
-R6SFM

Advertisement

loading

  Related Manuals for Mitsubishi Electric MELSEC iQ-R-R00CPU

  Summary of Contents for Mitsubishi Electric MELSEC iQ-R-R00CPU

  • Page 1 MELSEC iQ-R CPU Module User's Manual (Application) -R00CPU -R01CPU -R02CPU -R04CPU -R04ENCPU -R08CPU -R08ENCPU -R08PCPU -R08PSFCPU -R08SFCPU -R16CPU -R16ENCPU -R16PCPU -R16PSFCPU -R16SFCPU -R32CPU -R32ENCPU -R32PCPU -R32PSFCPU -R32SFCPU -R120CPU -R120ENCPU -R120PCPU -R120PSFCPU -R120SFCPU -R6RFM -R6PSFM -R6SFM...
  • Page 3: Safety Precautions

    SAFETY PRECAUTIONS (Read these precautions before using this product.) Before using MELSEC iQ-R series programmable controllers, please read the manuals for the product and the relevant manuals introduced in those manuals carefully, and pay full attention to safety to handle the product correctly. In this manual, the safety precautions are classified into two levels: "...
  • Page 4 [Design Precautions] WARNING ● Configure safety circuits external to the programmable controller to ensure that the entire system operates safely even when a fault occurs in the external power supply or the programmable controller. Failure to do so may result in an accident due to an incorrect output or malfunction. (1) Emergency stop circuits, protection circuits, and protective interlock circuits for conflicting operations (such as forward/reverse rotations or upper/lower limit positioning) must be configured external to the programmable controller.
  • Page 5 [Design Precautions] WARNING ● Especially, when a remote programmable controller is controlled by an external device, immediate action cannot be taken if a problem occurs in the programmable controller due to a communication failure. To prevent this, configure an interlock circuit in the program, and determine corrective actions to be taken between the external device and CPU module in case of a communication failure.
  • Page 6 [Design Precautions] WARNING ● Modules operating in SIL2 mode turn off outputs when they detect an error on the safety communication path. However, the program does not automatically turn off outputs. Create a program that turns off outputs when an error is detected on the safety communication path. If safety communications are restored with outputs on, connected machines may suddenly operate, resulting in an accident.
  • Page 7 [Design Precautions] WARNING ● Create an interlock circuit which uses reset buttons so that the system does not restart automatically after executing safety functions and turning off outputs. ● In the case of a communication failure in the network, the status of the error station will be as follows: (1) All inputs from remote I/O stations are turned off.
  • Page 8 [Design Precautions] CAUTION ● Do not install the control lines or communication cables together with the main circuit lines or power cables. Keep a distance of 100mm or more between them. Failure to do so may result in malfunction due to noise. ●...
  • Page 9 [Installation Precautions] CAUTION ● Use the programmable controller in an environment that meets the general specifications in the Safety Guidelines included with the base unit. Failure to do so may result in electric shock, fire, malfunction, or damage to or deterioration of the product. ●...
  • Page 10 [Wiring Precautions] WARNING ● Shut off the external power supply (all phases) used in the system before installation and wiring. Failure to do so may result in electric shock or cause the module to fail or malfunction. ● After installation and wiring, attach a blank cover module (RG60) to each empty slot and an included extension connector protective cover to the unused extension cable connector before powering on the system for operation.
  • Page 11 [Wiring Precautions] CAUTION ● Individually ground the FG and LG terminals of the programmable controller with a ground resistance of 100 ohms or less. Failure to do so may result in electric shock or malfunction. ● Use applicable solderless terminals and tighten them within the specified torque range. If any spade solderless terminal is used, it may be disconnected when the terminal screw comes loose, resulting in failure.
  • Page 12 [Wiring Precautions] CAUTION ● Prevent foreign matter such as dust or wire chips from entering the module. Such foreign matter can cause a fire, failure, or malfunction. ● A protective film is attached to the top of the module to prevent foreign matter, such as wire chips, from entering the module during wiring.
  • Page 13 [Startup and Maintenance Precautions] CAUTION ● When connecting an external device with a CPU module or intelligent function module to modify data of a running programmable controller, configure an interlock circuit in the program to ensure that the entire system will always operate safely. For other forms of control (such as program modification, parameter change, forced output, or operating status change) of a running programmable controller, read the relevant manuals carefully and ensure that the operation is safe before proceeding.
  • Page 14 [Startup and Maintenance Precautions] CAUTION ● Startup and maintenance of a control panel must be performed by qualified maintenance personnel with knowledge of protection against electric shock. Lock the control panel so that only qualified maintenance personnel can operate it. ●...
  • Page 15 [Transportation Precautions] CAUTION ● When transporting lithium batteries, follow the transportation regulations. For details on the regulated models, refer to the MELSEC iQ-R Module Configuration Manual. ● The halogens (such as fluorine, chlorine, bromine, and iodine), which are contained in a fumigant used for disinfection and pest control of wood packaging materials, may cause failure of the product.
  • Page 16: Conditions Of Use For The Product

    CONDITIONS OF USE FOR THE PRODUCT (1) Mitsubishi programmable controller ("the PRODUCT") shall be used in conditions; i) where any problem, fault or failure occurring in the PRODUCT, if any, shall not lead to any major or serious accident; ii) where the backup and fail-safe function are systematically or automatically provided outside of the PRODUCT for the case of any problem, fault or failure occurring in the PRODUCT.
  • Page 17 • For Safety CPUs (1) Although MELCO has obtained the certification for Product's compliance to the international safety standards IEC61508, EN954-1/ISO13849-1 from TUV Rheinland, this fact does not guarantee that Product will be free from any malfunction or failure. The user of this Product shall comply with any and all applicable safety standard, regulation or law and take appropriate safety measures for the system in which the Product is installed or used and shall take the second or third safety measures other than the Product.
  • Page 18: Introduction

    INTRODUCTION Thank you for purchasing the Mitsubishi Electric MELSEC iQ-R series programmable controllers. This manual describes the memory, functions, devices, and parameters of the relevant products listed below. Before using this product, please read this manual and the relevant manuals carefully and develop familiarity with the functions and performance of the MELSEC iQ-R series programmable controller to handle the product correctly.
  • Page 19: Table Of Contents

    CONTENTS SAFETY PRECAUTIONS ..............1 CONDITIONS OF USE FOR THE PRODUCT .
  • Page 20 Program memory/program cache memory ........... . . 93 Device/label memory .
  • Page 21 CPU module operation upon error detection setting ..........128 Error detection invalidation setting .
  • Page 22 Operating procedure for continuous logging ........... 178 Operating procedure for trigger logging.
  • Page 23 Precautions ................259 CHAPTER 14 PID CONTROL/PROCESS CONTROL FUNCTION 14.1 PID Control Function.
  • Page 24 CHAPTER 20 ROUTING SETTING 20.1 Setting Method............... . . 326 20.2 Setting Example.
  • Page 25 21.10 Refresh Data Register (RD) ............. . 359 Refresh memory setting .
  • Page 26 CHAPTER 25 CONSTANTS 25.1 Decimal Constant (K) ..............401 25.2 Hexadecimal Constant (H) .
  • Page 27 Precautions ................451 28.3 Tracking Transfer.
  • Page 28 Instructions that affect the status of another instruction when executed ......508 Instruction that causes different operation results between the control system and standby system .
  • Page 29 Switching the safety operation mode............538 Operations restricted in SAFETY MODE.
  • Page 30 When starting up both systems simultaneously ..........569 When starting up one system first .
  • Page 31 SD memory card ............... . 646 Safety operation mode .
  • Page 32 Precautions for using the COM or ZCOM instruction ..........691 Precautions for using the ADRSET instruction .
  • Page 33 Instruction related ............... 816 Latch area .
  • Page 34 Data logging function processing time............913 Memory dump function processing time .
  • Page 35: Relevant Manuals

    Dedicated instructions for the intelligent function modules e-Manual [SH-081976ENG] e-Manual refers to the Mitsubishi Electric FA electronic book manuals that can be browsed using a dedicated tool. e-Manual has the following features: • Required information can be cross-searched in multiple manuals.
  • Page 36: Terms

    TERMS Unless otherwise specified, this manual uses the following terms. Term Description Backup mode A mode to continue operation in a redundant system by switching the standby system to the control system when an error occurs in the control system. Buffer memory Memory in an intelligent function module for storing data such as setting values and monitored values.
  • Page 37 Term Description Process CPU (redundant mode) A Process CPU operating in redundant mode. A redundant system is configured with this CPU module. Process control function blocks and the online module change function can be used even in this mode. Program block A group of POUs that configure a program Program executed in both systems A program that is executed in both CPU modules of the control system and the standby system...
  • Page 38 The following terms are used when the SIL2 Process CPU or the Safety CPU is used. Term Description Pair version Version information that determines combination of the SIL2 Process CPU and SIL2 function module, and the Safety CPU and safety function module Safety communications Communication service that processes the send/receive of network layers for the safety defined in the safety predefined protocol...
  • Page 39: Part 1 Cpu Module Operation

    PART 1 CPU MODULE OPERATION This part consists of the following chapters. 1 RUNNING A PROGRAM 2 CPU MODULE OPERATION PROCESSING 3 MEMORY CONFIGURATION OF THE CPU MODULE...
  • Page 40: Chapter 1 Running A Program

    RUNNING A PROGRAM Scan Configuration The following shows the scan configuration of the CPU module. CPU module internal operation Structure of a scan Initial processing (when powered on or switched to RUN) I/O refresh Program execution END processing Initial processing (when powered on or switched to RUN) For the initial processing (when powered on or switched to RUN), the following processes are performed: : Performed, : Not performed Item...
  • Page 41: I/O Refresh

    I/O refresh The module performs the following before starting program operation. • ON/OFF data input from the input module/intelligent function module to the CPU module. • ON/OFF data output from the CPU module to the output module/intelligent function module. While constant scan is in progress, I/O refresh is performed after the waiting time for constant scan expires. Program operation According to the program settings, the module executes from step 0 through the END/FEND instruction for each program.
  • Page 42: Scan Time

    Scan Time The CPU module repeats the following processing. The scan time is the sum of the following processing and execution time. Switched to RUN Initial processing (when switched to RUN) I/O refresh Program execution Scan time END processing *1 The initial scan time includes this processing. Initial scan time The first scan time after the CPU module becomes in the RUN state.
  • Page 43: Constant Scan

    Constant scan RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) Scan time is different for each scan because its processing time varies depending on whether instructions used in a program are executed or not. By setting constant scan, the I/O refresh interval can be kept constant even when the program execution time varies because the program can be executed repeatedly by keeping the scan time constant.
  • Page 44 Accuracy of constant scan The accuracy of the constant scan is 0.01ms. However, if processing, which should be executed during the waiting time from the completion of the END processing to the start of the next scan, is being executed, the constant scan cannot finish even if the constant scan time is reached.
  • Page 45: Device/Label Access Service Processing Setting

    Device/label access service processing setting RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using a SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS • When using a Safety CPU, refer to the following as well. Page 535 FUNCTIONS The user can specify the time or the execution timing of the device/label access service processing which is performed during the END processing.
  • Page 46 Setting method The device/label access service processing can be configured as follows. [CPU Parameter]  [Service Processing Setting]  [Device/Label Access Service Processing Setting] Window Displayed items Item Description Setting range Default Specifying Select a method for specifying the service processing for access to •...
  • Page 47 Operations enabled by setting details Operations enabled by setting details of the device/label access service processing setting are as follows. Item Scan performance Device/label access Inter- Application service process program performance monitoring Increase Stability Response Stability time Execute the Process Medium Medium Medium...
  • Page 48 ■When "Execute END Processing between Programs" is enabled The device/label access service processing, such as access to devices, is performed between program executions and/or during the END processing. Therefore, when monitoring is performed in the situation where a device value is processed across programs, values of ongoing operation may be read out.
  • Page 49: Data Communication And I/O Processing

    Data Communication and I/O Processing Data communication In data communication, data such as I/O signals, buffer memory, and link device of the CPU module and intelligent function module are communicated. There are two modes for data communication: refresh mode which automatically sends\receives the module data into the device or label of the CPU module at END processing and direct mode which accesses when an instruction is executed in a program.
  • Page 50: Refresh Mode

    Refresh mode The CPU module performs I/O processing collectively at a specified timing. The timing of the input refresh and output refresh follows the specified refresh timing setting. Input of on/off data by input refresh Device memory Output of on/off data by output refresh On/off data On/off...
  • Page 51 Item Description Execution of an input contact Input data in the input (X) device memory (3) are read out and the program is executed. instruction Execution of an output contact Output data in the output (Y) device memory (4) are read out and the program is executed. instruction Execution of the OUT instruction The operation result of the program (5) are stored to the output (Y) device memory.
  • Page 52: Direct Mode

    Direct mode The CPU module performs I/O processing when each instruction is executed in a program. Input of on/off data upon instruction execution Device memory Output of on/off data upon instruction execution On/off data DX10 On/off data Input module or CPU module output module With this mode, the CPU module uses the direct access input (DX) and direct access output (DY) to perform I/O processing.
  • Page 53 Response delay An output response which corresponds to the status change in the input module delays for one scan (maximum) depending on the on timing of an external contact. [Example] A program that turns on the output DY5E when the input DX5 turns on DY5E •...
  • Page 54: Program Flow

    Program Flow Programs are executed in order when the CPU module is switched to the RUN state according to the program execution type and execution sequence settings (Page 53 Program Execution Type, Page 64 Execution type change). STOP → RUN Initial processing Does Exists...
  • Page 55: Program Execution Type

    Program Execution Type Set the execution condition of the program. ( Page 64 Execution type change) Initial execution type program Initial execution type program is executed only once when the CPU module has been powered off and on, or switched from the STOP state to the RUN state.
  • Page 56: Scan Execution Type Program

    Scan execution type program Scan execution type program is executed only once per every scan starting from the scan following the scan in which the initial execution type program was executed. Power-on→RUN, STOP→RUN 1st scan 2nd scan 3rd scan 4th scan END processing Initial execution type program Scan execution type program A...
  • Page 57 Fixed scan interval setting Set the execution condition of the fixed scan execution type program. [CPU Parameter]  [Program Setting] Operating procedure Click "Detailed Setting" on the "Program Setting" window "Program Setting" window. Select the program name and set "Detailed Setting" window the execution type to "Fixed Scan".
  • Page 58 Operation when the execution condition is satisfied The following describes operation of the program. ■If the execution condition is satisfied before the interrupt is enabled by the EI instruction The program enters the waiting status and is executed when the interrupt is enabled. Note that if the execution condition for this fixed scan execution type program is satisfied more than once during the waiting status, the program is executed only once when the interrupt is enabled.
  • Page 59 ■If another interrupt occurs while the fixed scan execution type program is being executed If an interrupt program (including an interrupt which triggers the event execution type program) is triggered while the fixed scan execution type program is being executed, the program operates in accordance with the interrupt priority. ( Page 81 Multiple interrupt function) Processing when the fixed scan execution type program starts The same processing as when the interrupt program starts.
  • Page 60 ■Fixed scan execution mode setting Use the fixed scan execution mode setting. [CPU Parameter]  [Interrupt Settings]  [Fixed Scan Execution Mode Setting] Window Displayed items Item Description Setting range Default Fixed Scan Execution When fixed scan characteristics are prioritized, an execution is performed •...
  • Page 61: Event Execution Type Program

    Event execution type program This type of program starts execution when triggered by a specified event. ( Page 59 Trigger type) The program is executed at the execution turn specified in the program settings of the CPU parameters, and if execution conditions of the specified trigger are met when the execution turn of the event execution type program comes, the program is executed.
  • Page 62 ■Bit data ON (TRUE) The program is executed at the execution turn specified in program setting of the CPU parameters, and if the specified bit data is ON (TRUE) when the execution turn of the event execution type program comes, the program is executed. The current values of the output (Y), timer (T), and long timer (LT) used in this program can be cleared at the execution turn that comes after the specified bit data is changed from ON (TRUE) to OFF (FALSE).
  • Page 63 ■Passing time After the status of the CPU module is changed into the RUN state, programs are executed in execution turn specified in "Program Setting" of "CPU Parameter". If the specified time passes, the event execution type program is executed once when the execution turn of the program comes.
  • Page 64 Trigger setting Use the event execution type detail setting. [CPU Parameter]  [Program Setting] Operating procedure Click "Detailed Setting" on the "Program Setting" window "Program Setting" window. Select the program name and set "Detailed Setting" window the execution type to "Event". Click "Detailed Setting Information".
  • Page 65: Standby Type Program

    Standby type program This type of program is executed only when its execution is requested. Librarization of programs Set a subroutine program and/or an interrupt program as a standby type program to manage them separately from the main routine program. In a single standby type program, multiple subroutine programs and interrupt programs can be created. Scan execution type program Scan execution type program Main routine program...
  • Page 66: Execution Type Change

    Execution type change This section describes how to change the execution type of programs. Using parameter settings "Program Setting" can be used to specify the execution type of programs. [CPU Parameter]  [Program Setting]  [Detailed Setting] Operating procedure Click "Detailed Setting" on the "Program Setting"...
  • Page 67: Group Setting For Refresh

    Group setting for refresh Refresh can be performed when a specified program is executed by setting a group number to each program and specifying the number for each module. *1 Input refresh (load of analog input, Input (X)) is performed before execution of a program, and output refresh (analog output, Output (Y)) is performed after execution of a program.
  • Page 68: Subroutine Program

    Subroutine Program Subroutine program is a program that is executed from a pointer (P) through the RET instruction. It is executed only when called by a subroutine call instruction (such as the CALL instruction or the ECALL instruction). A pointer type label can also be used instead of a pointer (P).
  • Page 69: Interrupt Program

    Interrupt Program A program from an interrupt pointer (I) through the IRET instruction. (1) This indicates the end of the main routine program. Main routine program FEND Interrupt program (I0) IRET Interrupt program (I29) IRET *1*2 Interrupt pointer *1 Only one interrupt program can be created with a single interrupt pointer number. *2 The interrupt pointers are not required to be defined in an ascending order.
  • Page 70 Operation upon occurrence of an interrupt factor The following shows the operation when an interrupt factor occurs. ■If an interrupt factor occurs during link refresh The link refresh is suspended and the interrupt program is executed. Even though the station-based block data assurance is enabled for cyclic data during refresh of such links as CC-Link IE Field Network, if the interrupt program uses a device specified as the refresh target, the station-based block data assurance for cyclic data is not available.
  • Page 71 ■If an interrupt factor occurs while interrupt is disabled (DI) • For I0 to I15, I28 to I31, I48, I49, and I50 to I1023 The interrupt factor that has occurred is memorized, and the interrupt program corresponding to the factor will be executed when the interrupt is enabled.
  • Page 72 • For I44 If interrupt is enabled before the next cycle, the I44 interrupt program will be executed when the interrupt is enabled. If interrupt continues to be disabled beyond the start of the next cycle (the second cycle), the memorized information will be discarded (even when the interrupt is enabled, the I44 interrupt program will not be executed).
  • Page 73 ■If an interrupt factor with the same or a lower priority occurs while the interrupt program is being executed • For I0 to I15 and I50 to I1023 The interrupt factor that has occurred is memorized. After the running interrupt program finishes, the interrupt program corresponding to the factor will be executed.
  • Page 74 • For I28 to I31, I48, and I49 The interrupt factor that has occurred is memorized. After the running interrupt program finishes, the interrupt program corresponding to the factor will be executed. If the same interrupt factor occurs multiple times, it will be memorized once but operation at the second and later occurrences depends on setting of the fixed scan execution mode (...
  • Page 75 • For I44 If the running interrupt program finishes before the next cycle, the I44 interrupt program will be executed when the running interrupt program finishes. If the running interrupt program continues beyond the start of the next cycle (the second cycle), the memorized information will be discarded (even when the running interrupt program finishes, the I44 interrupt program will not be executed).
  • Page 76 ■If the same interrupt factor occurs while the interrupt program is being executed • For I0 to I15 and I50 to I1023 The interrupt factor that has occurred is memorized, and the interrupt program corresponding to the factor will be executed when the interrupt is enabled.
  • Page 77 • For I44 If an interrupt factor which is the same as that for the running interrupt program occurs, the factor is not memorized. Therefore, the corresponding interrupt program will not be executed after the running interrupt program finishes. Also, if the I44 interrupt program for this cause cannot be executed, SM480 (Cycle overrun flag for inter-module synchronization program (I44)) is turned on, and SD480 (Number of cycle overrun events for inter-module synchronization cycle program (I44)) reaches its upper limit.
  • Page 78 ■If an interrupt factor occurs in the STOP/PAUSE status • For I0 to I15, I28 to I31, I48, I49, and I50 to I1023 The interrupt factor that has occurred is memorized, and the corresponding interrupt program will be executed when the CPU module switches to the RUN state and the interrupt is enabled.
  • Page 79: Interrupt Period Setting

    Interrupt period setting The interrupt cycle based on the internal timer can be specified. [CPU Parameter]  [Interrupt Settings]  [Fixed Scan Interval Setting] Window Displayed items Item Item Description Setting range Default Interrupt Setting from Internal Timer Sets the execution interval of I28. 0.5 to 1000ms (in units of 0.5ms) 100.0ms Sets the execution interval of I29.
  • Page 80: Processing At Interrupt Program Startup

    Processing at interrupt program startup The processing shown below is performed when the interrupt program starts. • Saving/restoring of the file register (R) block number • Saving/restoring of the index register (Z, LZ) Saving/restoring of the file register (R) block number When an interrupt program starts, the block number of the file register (R) of the running program is saved and passed to the interrupt program.
  • Page 81 Saving/restoring of the index register (Z, LZ) When an interrupt program starts, the value of the index register (Z, LZ) of the running program is saved. When the interrupt program finishes, and the saved value is restored to the running program. Note that when an interrupt program starts, the local index register (Z, LZ) is not switched to the different one.
  • Page 82 If the value of the index register used for the interrupt program is continuously used for the next interrupt program, the value of the index register for the interrupt program must be saved or restored. Create a program to add the MOV instruction and the ZPUSH/ZPOP instruction. Program example Switch Return...
  • Page 83: Multiple Interrupt Function

    Multiple interrupt function When a new interrupt triggered by another factor occurs during execution of an interrupt program, the running program will be suspended if its priority is lower than that of the new interrupt. A program with higher priority is executed based on the set priority whenever its execution condition is satisfied.
  • Page 84 Interrupt priority setting The interrupt priority (5 to 8) of interrupts from modules can be changed. [CPU Parameter]  [Interrupt Settings]  [Interrupt Priority Setting from Module] Operating procedure Set "Multiple Interrupt" to "Enable" "Interrupt Settings" window on the "Interrupt Settings" window, and click "Detailed Setting".
  • Page 85 Disabling/enabling interrupts with a specified or lower priority Interrupts with a priority equal or lower than that specified by the DI or EI instruction can be disabled or enabled even when multiple interrupts are present. Order of interrupt occurrence:  Order of interrupt execution: ...
  • Page 86 Multiple interrupt execution sequence When multiple interrupts occur, the interrupt program with the highest priority is executed. Then, the interrupt program with the highest priority among those interrupted and in waiting status as a result of interrupts will be executed next when the previous is finished.
  • Page 87 Precautions The precautions for the interrupt program are mentioned below. ■Restrictions on program creation • The PLS/PLF instruction performs OFF processing in the scan after the instruction execution. The device turned on remains on until the interrupt program starts again and the instruction is executed. •...
  • Page 88 ■Interrupt processing with FB/FUN FB/FUN consists of multiple instructions. When an interrupt occurs during execution of the FB/FUN, the execution will be suspended and an interrupt program will be executed even though "Interrupt Enable Setting in Executing Instruction" of the CPU parameter has been set to "Disable".
  • Page 89: Chapter 2 Cpu Module Operation Processing

    CPU MODULE OPERATION PROCESSING Here is a list of the operating status of the CPU module: • RUN state • STOP state • PAUSE state Operation Processing by Operating Status This displays operation processing according to the operating status of the CPU module. Operation processing in RUN state In RUN state, the program operation is repeatedly performed in the following order: Step 0 ...
  • Page 90: Operation Processing When Operating Status Is Changed

    Operation Processing When Operating Status Is Changed This displays operation processing when the operating status of the CPU module is changed. CPU module CPU module processing operating Program External output Device memory status Other than Y STOP  RUN Executes the program from the Determines the status Retains the device memory Determines the status...
  • Page 91: Output Mode At Operating Status Change (Stop To Run)

    Output mode at operating status change (STOP to RUN) RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using a SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS • When using a Safety CPU, refer to the following as well. Page 535 FUNCTIONS When the operating status changes from RUN to STOP, for example, the CPU module internally stores the status of the outputs (Y) to turn them all off.
  • Page 92 Setting the output mode Set the mode in "Output Mode Setting of STOP to RUN". [CPU Parameter]  [Operation Related Setting]  [Output Mode Setting of STOP to RUN] Window Displayed items Item Description Setting range Default Output Mode of STOP to Set the operation of the output (Y) when the operating •...
  • Page 93: Operation Processing At Momentary Power Failure

    Operation Processing at Momentary Power Failure When an input power supply voltage supplied to the power supply module falls below the specified range, a momentary power failure is detected and the following operation processing is performed. Momentary power failure not exceeding the allowable momentary power failure time If a momentary power failure occurs, the event history is registered to suspend the operation processing.
  • Page 94: Chapter 3 Memory Configuration Of The Cpu Module

    MEMORY CONFIGURATION OF THE CPU MODULE Memory Configuration The following shows the memory configuration of the CPU module. Built-in memory Program cache memory Program memory Device/label memory Data memory Function memory Refresh memory CPU buffer memory Signal flow memory SD memory card *1 The built-in memory is a generic term of the memory built in the CPU module.
  • Page 95: Program Memory/Program Cache Memory

    Program memory/program cache memory The program memory and program cache memory store necessary programs for the CPU module to perform operations. At the following timing, data in the program memory is transferred to the program cache memory and an operation is performed.
  • Page 96: Device/Label Memory

    ■Destination of the file header area For the following CPU modules, the destination of the file header area is the data memory. CPU module Firmware version R04CPU, R08CPU, R16CPU, R32CPU, R120CPU "30" or earlier R04ENCPU, R08ENCPU, R16ENCPU, R32ENCPU, R120ENCPU Process CPU "12"...
  • Page 97 Device/label memory area setting RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using a SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS • When using a Safety CPU, refer to the following as well. Page 535 FUNCTIONS The capacity of each data area allocated within the device/label memory can be changed.
  • Page 98 • Please note that the total of the capacity of each area (including the capacity of the local device area) should not exceed the capacity of the device/label memory ( MELSEC iQ-R CPU Module User's Manual (Startup)). The total of the capacity of each area can be checked in "Device/Label Memory Area Capacity Setting".
  • Page 99 ■R04CPU, R04ENCPU Area Setting range of capacity of each area Without an With an With an With an With an With an extended SRAM extended SRAM extended SRAM extended SRAM extended SRAM extended SRAM cassette cassette (1MB) cassette (2MB) cassette (4MB) cassette (8MB) cassette (16MB) Device area...
  • Page 100: Data Memory

    Data memory This memory is used to store the parameter file, device comment file, and/or the user's folder/file. Data such as the parameter file and the device comment files written by the engineering tool is stored in the "$MELPRJ$" folder. The "$MELPRJ$" folder is created after memory initialization.
  • Page 101: Signal Flow Memory

    Signal flow memory This memory is used to memorize the execution status of the instruction in the last scan. The CPU module judges whether to execute a rising/falling edge execution instruction by referring to the signal flow memory. Signal flow memory INCP wCount1 Executed INCP wCount2...
  • Page 102: File Size Unit In Memory

    File Size Unit in Memory The minimum unit of capacity for storing a file in the memory is referred to as the file size unit (cluster size). File size unit based on memory area CPU module File size unit Program memory Device/label memory Data memory Function memory...
  • Page 103: Memory Operation

    Memory Operation Initialization and value clear Each memory can be initialized and cleared to zero by using the engineering tool. For details on the operation method, refer to the following.  GX Works3 Operating Manual Items to be specified in the engineering tool Target Initialization Data memory...
  • Page 104: Files

    Files This section lists the files used by the CPU module. File types and storage memory This table lists the types of files, which are generated by parameter settings and functions in use, as well as their storage memory. : Can be stored (Mandatory), : Can be stored, : Cannot be stored File type CPU built-in memory SD memory...
  • Page 105 *1 mmm represents the start I/O number (first three digits in four-digit hexadecimal representation) of each module. For the CPU module, it will be 3FFH. Also, nn represents the serial number (two-digit hexadecimal representation) of module extension parameter files or module-specific backup parameter files of each module.
  • Page 106: File Operation Available

    File operation available The following lists the file operations which can be executed to each file in the CPU module by external devices. : Available, : N/A File type Operation from engineering tool Operation with SLMP and FTP server Operation via function instruction Write...
  • Page 107: File Size

    File size The following table lists the size of files that can be stored in the CPU module. File type File size Program Approx. 4050 bytes minimum (only the END instruction + 500 steps reserved for online program change) FB file Approx.
  • Page 108 When the CPU module versions are different, a program which can be written to a CPU module with a certain version may not be written to the one with another version due to overcapacity. In this case, delete the steps reserved for online program change (default: 500 steps) and write the program to the CPU module.
  • Page 109: Part 2 Functions

    PART 2 FUNCTIONS This part consists of the following chapters. 4 CLOCK FUNCTION 5 WRITING DATA TO THE CPU MODULE 6 RAS FUNCTIONS 7 REMOTE OPERATION 8 BOOT OPERATION 9 MONITOR FUNCTION 10 TEST FUNCTION 11 DATA LOGGING FUNCTION 12 DEBUG FUNCTION 13 DATABASE FUNCTION 14 PID CONTROL/PROCESS CONTROL FUNCTION 15 CPU MODULE DATA BACKUP/RESTORATION FUNCTION...
  • Page 110: Chapter 4 Clock Function

    CLOCK FUNCTION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS • When using the SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS •...
  • Page 111: Reading The Clock Data

    Using SM/SD After SM210 (Clock data set request) is tuned off and on, values stored in SD210 (Clock data) to SD216 (Clock data) are written to the CPU module. Once the write operation is finished, SM210 is turned on and off. If values in SD210 to SD216 are out of the effective range, SM211 (Clock data set error) turns on and the values in SD210 to SD216 are not written to the CPU module.
  • Page 112: Setting Time Zone

    Setting Time Zone The time zone used for the CPU module can be specified. Specifying the time zone enables the clock of the programmable controller to work in the local time zone. [CPU Parameter]  [Operation Related Setting]  [Clock Related Setting] Window Displayed items Item...
  • Page 113: Daylight Saving Time Function

    Daylight Saving Time Function The daylight saving time function is used to adjust the CPU module time to daylight saving time. This function advances the CPU module time by one hour on the starting date of daylight saving time, and reverses the time by 1 hour on the ending date.
  • Page 114: Timing Of Daylight Saving Time Adjustment

    Displayed items Item Description Setting range Default Adjust Clock for Daylight Saving Time Sets whether to enable the daylight saving time setting. • Enable Disable • Disable Start/End Time Specification Method Sets the timing of the switch to daylight saving time to •...
  • Page 115: Daylight Saving Time Function Operation Check

    Daylight saving time function operation check The daylight saving time function operation can be checked as follows. Special relay SM217 (Daylight saving time status flag) can be used to check whether the date lies inside or outside the daylight saving time period.
  • Page 116: System Clock

    System Clock The system clock is turned on/off by the system or turns on/off automatically at the interval specified by the user. Special relay used for system clock Special relay used for system clock are as follows ( Page 810 System clock) SM number Name SM400...
  • Page 117: Chapter 5 Writing Data To The Cpu Module

    WRITING DATA TO THE CPU MODULE This chapter describes the functions relating to writing data to the CPU module. Writing Data to the Programmable Controller This function writes data specified by the project of the engineering tool to the memory of the CPU module. For details, refer to the following.
  • Page 118 Editable contents Within a program block, instructions and pointers (P, I) can be added, changed, or deleted. Also, for each program component, program blocks can be added, changed, or deleted. However, if the user try to edit a label, FB, or FUN, the following limitations are applied.
  • Page 119 Reserved area for online change Reserved area for online change can be set in a program file to address the online change (ladder block) which causes a change in the program file size. ( GX Works3 Operating Manual) In addition, if the changed program exceeds the program file capacity (including reserved area for online change) during the online change (ladder block), the reserved area for online change can be set again if there is space available in the program memory.
  • Page 120 Setting the initial value for registering/changing label definition The initial value used when registering/changing label definition can be set. ( GX Works3 Operating Manual) ■Initial value setting availability Indicates whether or not the initial value can be set when adding or changing a label. : Available, : Conditionally available, : Not available Label type Label addition...
  • Page 121: File Batch Online Change

    File batch online change This function writes programs and other data to the running CPU module in units of files. For the operating procedure and the execution condition of the file batch online change, refer to the following.  GX Works3 Operating Manual Writing FB files and the global label setting file The file batch online change of FB files and the global label setting file is available depending on the model and firmware version of the CPU module.
  • Page 122: Precautions

    Precautions This section describes the precautions on writing data to the CPU module. Prohibited operation (Turning off or resetting the CPU modules) • When writing data to the programmable controller or executing the online change (ladder block), do not turn off or reset the CPU module.
  • Page 123 If the later program memory transfer (from the engineering tool 2) has completed with an error, the former program memory transfer (from the engineering tool 1) does not complete. In such a case, write the data again instead of powering off and on or resetting the CPU module.
  • Page 124 • Falling instruction When a falling instruction exists within the range to be changed, the falling instruction will not be executed even if the execution condition (ON to OFF) is satisfied after completion of the online change (ladder block) or writing data to the programmable controller.
  • Page 125 • STMR instruction If an STMR instruction exists within the range to be changed, the STMR instruction will be executed. M10 is added at the online change. STMR K10 M100 STMR K10 M100 STMR K10 M200 STMR K10 M200 STMR K10 M100 STMR K10 M200...
  • Page 126 During the file batch online change The following describes the precautions on the file batch online change. ■Writing the label data Write labels using the file batch online change only when new label data is added. When the label data is changed or deleted, write data to the programmable controller or execute the online change (ladder block) after the data is rebuilt (reassigned).
  • Page 127: Chapter 6 Ras Functions

    RAS FUNCTIONS Scan Monitoring Function RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS • When using the SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS This function detects hardware and program errors of the CPU module by monitoring the scan time.
  • Page 128: Precautions

    Precautions The following lists the precautions on the scan monitoring function. Measurement error of watchdog timer Since the watchdog timer produces an error within the range of 0 to 10ms, take this into consideration when setting the scan time monitoring time. For example, if the scan time monitoring time is set to 100ms, an error will occur when the scan time falls within the range 100ms <...
  • Page 129: Self-Diagnostics Function

    Self-Diagnostics Function RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS • When using the SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS •...
  • Page 130: Cpu Module Operation Upon Error Detection Setting

    CPU module operation upon error detection setting Configure each CPU module operation setting when an error is detected. Mode when an error is detected If the self-diagnostic function of the CPU module detects an error, the CPU module can be in one of the following operation status: ■Mode for stopping the operation of CPU module Operation stops when an error has been detected.
  • Page 131 ■Applicable errors to the error detection setting The following table lists errors for which whether or not to detect the errors can be set. Error name Error code Power shutoff (either of the redundant power supply modules) 1010H Failure (either of the redundant power supply modules) 1020H Battery error 1090H...
  • Page 132 ■Applicable errors to the CPU module operation upon error detection setting The following table lists the applicable errors to the setting that specifies the CPU module operation of when the specific errors are detected. Error name Error code Memory card error 2120H, 2121H Module verification error 2400H, 2401H...
  • Page 133 LED display setting Set whether to display or hide the ERROR LED, USER LED, BATTERY LED, and FUNCTION LED. [CPU Parameter]  [RAS Setting]  [LED Display Setting] Window Displayed items Item Description Setting range Default ERROR LED Minor Error (Continue Error) Set whether or not to display the ERROR LED when a minor error •...
  • Page 134: Error Detection Invalidation Setting

    Error detection invalidation setting RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) Turning on the target bit of SD49 (Error detection invalidation setting) disables detection of the corresponding continuation error. (Page 834 Diagnostic information) *1 When using the error detection invalidation setting, check the version of the CPU module used.
  • Page 135: Error Clear

    Error Clear RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS • When using the SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS •...
  • Page 136 Error name Error code Receive queue full 1830H Receive processing error 1831H Transient data error 1832H Constant scan time error 1900H Network configuration mismatch 1B00H System consistency check error (operating status) 1B20H Redundant system error 1B40H, 1B42H, 1B43H Standby system CPU module error 1B60H, 1B61H Tracking communications disabled 1B70H...
  • Page 137 How to clear errors Errors can be cleared in two ways: ■Using the engineering tool Clear errors with the module diagnostics function of GX Works3. ( GX Works3 Operating Manual) The event history of error clear using the engineering tool is stored in the CPU module connected. ■Using SM/SD Clear errors by operating SM/SD.
  • Page 138: Event History Function

    Event History Function RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS • When using the Safety CPU, refer to the following as well. Page 535 FUNCTIONS The CPU module collects and stores event information from each module, such as errors detected by the module, operations performed on the module, and network errors.
  • Page 139: Logging Of The Event History

    Displayed items Item Description Setting range Default Save Destination Specify the storage location of event history files. • Data Memory Data Memory • Memory Card Set Save Volume of Per File Specify the storage capacity per event history file. 1 to 2048K bytes (in 1K bytes) 128K Byte *1 It cannot be set in the R00CPU.
  • Page 140 ■File size The size for event history files can be changed in event history setting (Page 136 Event history setting). If the storage size exceeds the specified size, records are deleted in order from the oldest one and the latest one is stored. An event history file size is obtained from the following calculation formula.
  • Page 141: Viewing The Event History

    ■When files are created An event history file is created when: • The CPU module is turned off and on (if there is no event history file or after the event history settings are changed). • The CPU module is reset (if there is no event history file or after the event history settings are changed). •...
  • Page 142: Precautions

    Precautions Clearing the event history during execution of another function No event history can be cleared during execution of the following functions. Check that the following functions are not being executed and then clear the event history. • CPU module data backup/restoration function •...
  • Page 143: Chapter 7 Remote Operation

    REMOTE OPERATION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS • When using the SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS •...
  • Page 144: Precautions

    Precautions This section describes the precautions on using remote RUN/STOP. • When remote RUN is performed during execution of the data logging function, it may fail. In that case, wait for a while and retry remote RUN. If remote RUN still cannot be executed, check whether remote RUN is acceptable and retry remote RUN (...
  • Page 145: Setting Run-Pause Contacts

    Setting RUN-PAUSE Contacts RUN-PAUSE contacts can be set. RUN-PAUSE contacts are used to perform remote RUN or STOP, or remote PAUSE using a contact. [CPU Parameter]  [Operation Related Setting]  [RUN-PAUSE Contact Setting] Window Displayed items Item Description Setting range Default ...
  • Page 146: Chapter 8 Boot Operation

    BOOT OPERATION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • This function cannot be used in the R00CPU. • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS The files stored on the SD memory card are transferred to the storage memory which is automatically determined by the CPU module when the CPU module is powered off and on or is reset.
  • Page 147: Specifiable File Types

    Specifiable File Types The files which can be booted are as follows. • System parameter • CPU parameter • Module parameter • Module extension parameter • Module extension parameter for protocol setting • Remote password • Global label setting file •...
  • Page 148: Configuring The Boot Setting

    Configuring the Boot Setting Configure the necessary settings for the boot operation. [Memory Card Parameters]  [Boot Setting] Operating procedure Click "Detailed Setting" on the "Boot "Boot Setting" window File Setting" window. Click the "Type" column. The "Boot File Setting" window maximum number of boot files that can be specified is the same as the number of files that can be stored in...
  • Page 149: Operation When Security Functions Are Enabled

    Operation When Security Functions Are Enabled This section describes the operation when security functions are enabled. When a security key is set When a security key is set to the boot target program file and the security key of the program file does not match with that of the CPU module, a boot error occurs.
  • Page 150: Chapter 9 Monitor Function

    MONITOR FUNCTION This chapter describes the functions for checking the CPU module operation. Item Description Reference  GX Works3 Operating Manual Circuit monitor Checks the status of the running program on the program editor. Device/buffer memory batch monitor Checks the current values of the device and buffer memory in a batch. Watch Registers a device and label and checks the current values.
  • Page 151 MEMO 9 MONITOR FUNCTION 9.1 Real-Time Monitor Function...
  • Page 152: Chapter 10 Test Function

    TEST FUNCTION 10.1 External Input/Output Forced On/Off Function RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS External inputs/outputs can be forcibly turned on and off from the engineering tool. This function enables input devices to be turned on and off regardless of the on/off state of the external inputs and enables the external outputs to be turned on and off regardless of the operation result of a program.
  • Page 153 Devices that allow forced on/off registration The following lists the devices that allow forced on/off registration. Device Range Input • R00CPU, R01CPU, and R02CPU: X0 to X1FFF (8192 points) • Other CPU modules: X0 to X2FFF (12288 points) Output • R00CPU, R01CPU, and R02CPU: Y0 to Y1FFF (8192 points) •...
  • Page 154 Operation method of forced on/off Use the engineering tool for the forced on/off operation. [Debug]  [Register/Cancel Forced Input/Output] Window Displayed items Item Description Device Enter target devices (X, Y). [Register Forced ON] button Registers forced on for the entered devices (X, Y). [Register Forced OFF] button Registers forced off for the entered devices (X, Y).
  • Page 155 Behavior in forced on/off registration The following describes the behavior in forced on/off registration. ■Behavior of an input device Registering forced on/off turns on or off the input device regardless of the status of the external input. When an input device for which the forced on/off has been registered is changed in the program, the input device is turned on and off in accordance with the operation result of the program.
  • Page 156 Forced on/off timing The following table lists the timing to reflect the registered data in the forced on/off registration settings to the input/output devices or external outputs. Inputs/outputs for which forced on/off Reflection timing for the input devices Reflection timing for the output devices or can be set external outputs Input/output of the modules mounted on the...
  • Page 157 ■Special register SD1488 (Debug function usage status) can be used to check whether the external input/output forced on/off function is used. ( Page 833 List of Special Register Areas) Behavior in cancellation of forced on/off Forced on/off registration can be canceled for each input/output device individually. ■Behavior of the device Inputs/outputs for which forced on/off can be Change in input/output devices in the program...
  • Page 158 Behavior in batch-cancellation of forced on/off registrations All the forced on/off registrations can be canceled in a batch. ■Behavior of the device The behavior of the device is the same as that of cancellation of forced on/off (for each device). ( Page 155 Behavior of the device) ■CPU module operating status The behavior of the device is the same as that of cancellation of forced on/off (for each device).
  • Page 159: Device Test With Execution Conditions

    10.2 Device test with execution conditions RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) Using the engineering tool, device/label values can be set for each execution of specified steps of programs. This function enables to debug a specific ladder block without modifying the program even when the program is configured as shown in the example below.
  • Page 160 Operation when device test with execution conditions is registered The device test with execution conditions can forcibly change device/label values (status) of specified locations. Specify a location of a device/label value (status) to be changed with a program name and a step number. In addition, specify a device/label and its value (status) to be changed with a device/label name and a setting value.
  • Page 161 Data that can be set The following tables list the data that can be set for the device test with execution conditions. ■Devices that can be set Type Device Bit device X, DX, Y, DY, M, L, F, SM, V, B, SB, T (contact), ST (contact), C (contact), LT (contact), LST (contact), LC (contact), FX, FY, Jn\X, Jn\Y, Jn\SB, Jn\B Word device T (current value), ST (current value), C (current value), D, SD, W, SW, RD, R, ZR, Z, FD, Un\G, Jn\W, Jn\SW, U3En\G, U3En\HG...
  • Page 162 Programs that can be set Only ladder programs can be set for the device test with execution conditions. Maximum number of devices/labels that can be set A total of 32 devices/labels can be set for the device test with execution conditions. Checking execution status of device test with execution conditions The execution status can be checked in the following ways.
  • Page 163 Registration of device test with execution conditions This section describes how to register the device test with execution conditions. ■Registration method Specify each field in the "Register Device Test with Execution Condition" window. [Debug]  [Device Test with Execution Condition]  [Register] Window •...
  • Page 164 Checking and disabling registration using list window Using the "Register/Disable Device Test With Execution Condition" window, the following operations can be performed: checking the registration status, disabling selected registrations, collectively registering/disabling registrations, and reading/ writing registered settings from/to a file. [Debug] ...
  • Page 165 ■Disabling device test with execution conditions In addition to the operation of the engineering tool, the following operations can be used to disable the device test with execution conditions. • Powering off and on • Reset operation • Writing a program to the CPU built-in memory by writing data to the programmable controller while the CPU module is in the STOP state •...
  • Page 166 Execution timing Select whether to change the device/label value before or after the execution of the instruction of the specified step when registering the device test with execution conditions. Program (1) The device test with execution conditions that sets 20 in D0 in step (100) is registered.
  • Page 167 Operation during online change This section describes the operation performed during the online change of the CPU module to which the device test with execution conditions is registered. ■Online change (ladder block) (without adding or deleting instruction) If a part to be changed by the online change (ladder block) includes registrations of the device test with execution conditions, such registrations are disabled.
  • Page 168 ■Online change (ladder block) (with adding instruction) When an instruction is added by the online change (ladder block), the registration of the device test with execution conditions of the instruction immediately after the instruction to be added is disabled. In the following example, an instruction is added by the online change (ladder block). In this case, when the device test with execution conditions is registered to the instruction immediately after the added instruction, the relevant registrations are disabled upon the execution of the online change (ladder block).
  • Page 169 ■Online change (ladder block) (with deleting instruction) When an instruction is deleted by the online change (ladder block), registrations of the device test with execution conditions for the deleted instruction and for the instruction immediately after the deleted instruction are disabled. In the following example, an instruction is deleted by the online change (ladder block).
  • Page 170 ■Addition/deletion/change of labels by the online change (ladder block) • When SM940 (Operation setting of the device test with execution conditions) is off, if local labels or program files are added, deleted, or changed and the online change (ladder block) is performed, all the registrations that specify local labels of the relevant program file are disabled.
  • Page 171 Precautions This section describes the precautions on the use of the device test with execution conditions. ■Operation when devices/labels cannot be registered When multiple devices/labels are registered to the device test with execution conditions, none of the devices/labels are registered if there is even one device/label or execution condition (program block, step number, or execution timing) that cannot be registered.
  • Page 172: Chapter 11 Data Logging Function

    DATA LOGGING FUNCTION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • This function cannot be used in the R00CPU. • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS •...
  • Page 173: Data To Be Collected

    11.1 Data to Be Collected This section describes the data to be collected by data logging. Number of data points The data logging function can collect up to 1280 data records. (10 settings  128 records) *1 Duplicate data records are counted as distinct. Data type The following table shows the number of data records for each data type.
  • Page 174 Devices to be collected The following table lists the devices that can be specified as the collected data. Type Device *4*5 *4*5 *4*5 *4*5 *4*5 Bit device X, DX, Y, DY, M , L, F, SM, V , B, SB, T (contact) , T (coil) , ST (contact) , ST (coil)
  • Page 175: Data Collection Conditions

    11.2 Data Collection Conditions This section describes the timing when data is collected and the conditions under which data is collected. Data collection conditions Description Each scan Collects data during the END processing of each scan. Time Data collection at specified time interval Collects data at specified time interval.
  • Page 176: Interrupt Occurrence

    Data collection during the END processing after specified time interval This option causes data collection to be performed at the timing of the END processing rather than during the course of program execution. Ensure that the "Scan time" is less than "Time specification". If the scan time is longer than the specified time and the collection interval or the collection timing occurs more than once during the same scan, data is collected only once during the END processing.
  • Page 177: Condition Specification

    Condition specification Specify the data collection timing according to the device/label data conditions and step number. The AND condition using a combination of "Device specification", "Label specification", and "Step No. specification" results in the collection of data at the time when both conditions are established. Device/label specification Data are collected when the monitored data meets the specified condition during the END processing.
  • Page 178 ■Specifying the monitored data For monitored data, the following devices and labels can be specified. *1 When specifying the local device, global label, or local label, check the versions of the CPU module, engineering tool, and CPU Module Logging Configuration Tool. ( Page 1008 Added and Enhanced Functions) The data types that can be selected include bit/word (unsigned), word (signed), double word (unsigned), and double word (signed).
  • Page 179 Step No. specification Data are collected when the specified condition is met immediately before the execution of the specified step. ■To collect data continuously while the execution conditions are met The following execution conditions cause the data logging function to collect data continuously while the execution condition are met: •...
  • Page 180: Logging Type

    11.3 Logging Type The following table describes available methods of data collection: Logging type Data collection method Application Continuous logging Continuously collects specified data at specified interval or timing. Allows the user to continuously monitor the content of specified data. Trigger logging Collects specified data at specified interval or timing and extracts a Allows the user to monitor the content of specified data before...
  • Page 181: Operating Procedure For Trigger Logging

    Operating procedure for trigger logging In trigger logging, the CPU module stores specified data in its internal buffer at a specified collection interval or timing; it extracts a specified number of data records before and after the satisfaction of a trigger condition and saves the extracted data in a data logging file residing in the storage memory.
  • Page 182 • Specifying the monitored data For the device and label change specification, monitored data can be configured to be collected from the devices and labels listed in the following table. *1 When specifying the local device, global label, or local label, check the versions of the CPU module, engineering tool, and CPU Module Logging Configuration Tool.
  • Page 183 ■Step No. specification A trigger occurs when the specified condition is met immediately before the execution of the specified step. Execution condition Description Always Executes the specified step regardless of the state immediately before the execution of it. In the specified condition satisfied Executes the specified step if the state immediately before the execution is a running state.
  • Page 184 To stop trigger logging The user can completely stop data logging by instructing CPU Module Logging Configuration Tool to stop data logging and unregister the data logging settings stored in the CPU module. (The special relay (data logging start) turns off.) To suspend/resume trigger logging The user can suspend data logging with the data logging settings remaining intact by doing either of the following: •...
  • Page 185: Data Logging File

    11.4 Data Logging File This section describes data logging files. Storage format of data logging files The following storage formats are available for data logging files. For details on the output format, format specifications, and output contents of each file, refer to the data output format. ( Page 950 Data output type) File format Application Unicode text file format...
  • Page 186: States Of The Data Logging Function

    11.5 States of the Data Logging Function The data logging function has the data logging state. The data logging state can be checked by CPU Module Logging Configuration Tool. ( Page 988 Logging status and operation) Data logging states The following table lists all the possible data logging states. Data logging states Description Stop...
  • Page 187: Led Status

    LED status Whether the data logging function is active or not can be checked by the LED of the CPU module. States of the Data Logging Function LED status FUNCTION LED CARD READY CARD ACCESS • Data logging settings have been registered by the start operation from CPU Module Logging Configuration Tool.
  • Page 188: Steps Until The Collected Data Is Saved

    11.6 Steps Until the Collected Data Is Saved This section describes the steps until the collected data is saved. When the data storage destination memory is the SD memory card The following figure shows the flow of data when the data storage destination memory is the SD memory card. Ethernet Inside the CPU module SD memory card...
  • Page 189 When the data storage destination memory is the function memory The following figure shows the flow of data when the data storage destination memory is the function memory. Ethernet Inside the CPU module Internal buffer Function memory Data collection Setting 1 Setting 1 of the specified device/label...
  • Page 190: Internal Buffer

    Internal buffer The internal buffer is a system area used to temporarily store collected data. The collected data is temporarily stored in the internal buffer and stored in the specified data storage destination memory at the time of a file save operation. Internal buffer capacity setting RnPCPU RnPCPU...
  • Page 191 Displayed items Item Description Setting range Default Total Capacity Shows the total of the internal buffer capacity set in the 60 to 3072K bytes 1536K bytes data logging function and the memory dump function.  Data Logging Total Capacity Shows the total of the internal buffer capacity used for the 1280K bytes Function data logging function.
  • Page 192: Switching To A Storage File

    Switching to a storage file The data collected by data logging is temporarily stored in a stack file. The stack file can be switched to a storage file to free the space in the SD memory card. How file switching works File switching works as follows: The CPU module writes collected data into a stack file (such as LOG01.BIN).
  • Page 193 Storage file The CPU module creates a subfolder ("storage file container folder") under the file storage folder and writes storage files to that storage file container folder. One storage file container folder can contain up to 256 storage files. When the files contained in the current storage file container folder reach the maximum number, the CPU module creates a new storage file container folder at the time of next storage file switching and begins writing storage files to that new folder.
  • Page 194 • Processing of file switching may take time depending on the setting. In this case, a date and time, which is closer to present than the timestamp of the first record in the data logging file, is added even though "File creation date"...
  • Page 195: Missing Data

    11.7 Missing Data The term "missing data" means that some of the collected data is missing, resulting in data discontinuity. Conditions under which missing data occurs Missing data occurs under the following conditions: Item Description Processing overflow Processing overflow has occurred due to failure to keep up with the specified collection interval/timing. Operations for the CPU module The CPU module has been stopped and run with "Operation at transition to RUN"...
  • Page 196: Data Logging File Transfer (Auto Transfer To Ftp Server)

    11.8 Data Logging File Transfer (Auto Transfer to FTP Server) RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • This function cannot be used in the R00CPU. This function automatically transfers data logging files to the FTP server. An SD memory card as the temporary storage destination is not required by setting the CPU built-in memory (function memory ) as the data storage destination while using this function.
  • Page 197 Transfer specifications and start timing of the data logging file Data logging files are transferred at the file switching timing in the data logging function. ■Transfer specifications of the data logging file • Data logging files are transferred one by one from each setting number (folder). •...
  • Page 198 ■Start timing of file transfer After data logging is started, the transfer of the files created at the file switching timing in the data logging function starts. When the transfer is started, special relay areas SM1219 to SM1309 (Data logging file transfer execution status flag) for each setting number turn on.
  • Page 199 ■Setting of CPU Module Logging Configuration Tool Select the "Transferring files to the FTP server" check box in "File transfer" of CPU Module Logging Configuration Tool. ( Page 966 Setting data logging,  Page 979 File transfer) Click the [Server Setting] button. Configure the server setting.
  • Page 200 File transfer test Check the communication status and settings by transferring a test file from the CPU module to the FTP server. The file transfer to the FTP server can be checked before system operation. ■Procedure for the file transfer test The following describes the procedure for the file transfer test.
  • Page 201 Setting on the "File transfer" window ■FTP server connection request timeout time Set the waiting time from when the connection request from the CPU module to the FTP server is sent to when the response is received. If no response is received from the FTP server within the connection request timeout time, an error occurs. ■File transfer retry time Set the time to retry the file transfer when the file transfer fails due to an error caused by communication failure such as the network error between the CPU module and the FTP server.
  • Page 202 • When the folder structure is not matched with the CPU module The folder structure of the FTP server consists of the storage destination structures of the data logging file excluding the subdirectory. The folder path (1) specified in the server setting, folder structure (2), logging files transferred (3). File storage LOG01 folder...
  • Page 203 • If the function memory is specified as the data storage destination, files are deleted after the transfer regardless of the setting. • Even if "Delete files completed transfer" is specified, data logging stops when the number of files stored by the data logging function exceeds the maximum value of the number of files to be saved.
  • Page 204: Data Logging File Transfer To Data Memory

    11.9 Data Logging File Transfer to Data Memory When the function memory is specified for the data storage destination memory without setting of the file transfer, the data is transferred from the function memory to the data memory at the logging completion or stop (including when an error occurs) as shown below.
  • Page 205: Setting Behavior At The Time Of Transition To Run

    11.10 Setting Behavior at the Time of Transition to RUN After the data logging settings are registered by the start operation of data logging, set the behavior of data logging when the following user operations to switch the operating status of the CPU module to RUN are performed (transition to RUN). ( Page 981 Movement) •...
  • Page 206: Auto Logging

    11.11 Auto Logging When inserting an SD memory card, which holds data logging setting, into the CPU module, the data logging automatically starts based on the data logging setting information on the SD memory card. How to use auto logging This section describes how to use auto logging.
  • Page 207 ■When "Data logging stop" is selected Auto logging is assumed to be completed if all the settings or any of auto logging stops *1 Here the term "stop" means one of the following:  Continuous logging: When the "Number of files to be saved" setting configured in the save setting has been exceeded and data logging has been completed.
  • Page 208: Sd Memory Card Replacement

    11.12 SD Memory Card Replacement SD memory cards can be replaced using the SD memory card forced disable function even while data logging is in progress.  MELSEC iQ-R CPU Module User's Manual (Startup) Only the data saving to an SD memory card is stopped while this function is being executed. The data collection keeps working.
  • Page 209: Sd Memory Card Life When The Data Logging Function Is Used

    Operations after SD memory card replacement If the SD memory card was replaced while data logging was running based on the data logging setting file contained in the SD memory card, the data logging setting file contained in the new SD memory card is used when data logging is started by one of the following operations.
  • Page 210: Errors Generated During Data Logging

    ■Header size of data logging (DCSn) Binary file output format: Refer to the header. ( Page 955 Binary file output format) Unicode text file format: Refer to the file information row to device comment row. ( Page 950 Unicode text file output type) ■Number of file switching times for the data logging per year (DCNn) Calculate this number with an estimated number according to the save setting of the data logging and system operations.
  • Page 211: Precautions To Take When Using The Data Logging Function

    11.16 Precautions to Take When Using the Data Logging Function This section describes precautions to take when using the data logging function. Mutual exclusion of the data logging function This section describes the mutual exclusion of the data logging function. ■When another function is executed during the execution of the data logging function The following table lists the cases when another function is executed during the execution of the data logging function.
  • Page 212 Function that has been Function to be executed Behavior already executed later Data logging function Function not specified in the If the condition "Total capacity that is set in the internal buffer capacity setting + internal buffer capacity setting Internal buffer capacity that is set in other than the internal buffer capacity setting > 3072K bytes"...
  • Page 213 ■When the data logging function is executed during the execution of another function The following table lists the cases when the data logging function is executed during the execution of another function. Function that has been Function to be executed Behavior already executed later...
  • Page 214 ■When a file operation related to the data logging is performed during the execution of the data logging function The following table lists the cases when a file operation related to the data logging is performed during the execution of the data logging function.
  • Page 215 Stopping/suspending data logging using CPU Module Logging Configuration Tool After data logging is stopped or suspended from CPU Module Logging Configuration Tool, all the data in the internal buffer are saved into the target memory. If a small number of records or a small file size is specified as part of the storage file switching condition, saving data to the target memory may take longer.
  • Page 216 Behavior that occurs while collected data is stored in the target memory If one of the following operations is performed while collected data is stored in the target memory, any unsaved data is cleared and not reflected to the results: •...
  • Page 217 Behavior at parameter change when functions consuming the internal buffer are active If the internal buffer capacity setting is changed during the execution of the functions that consume the internal buffer, attempting to start data logging results in an error, where the data logging fails to start. Function that consumes Function in execution the internal buffer other...
  • Page 218 ■Local index register, local long index register, and file register in which "Use File Register of Each Program" is set The program name cannot be specified for the following devices. • Local index register • Local long index register • File register in which "Use File Register of Each Program" is set To perform data logging of the above devices, transfer the data of the above devices to the global device on the program using the engineering tool beforehand.
  • Page 219 Data logging using the function memory as the data storage destination ■Power-off or reset during data logging During data logging using the function memory as the data storage destination, do not power off or reset the CPU module. During data logging, if the CPU module is powered off or reset before completion of the data transfer to the data memory (before data logging is completed or stopped), all the data logging data (data logging files) in the function memory are deleted.
  • Page 220 ■File transfer processing time The file transfer processing time differs depending on the Ethernet line load ratio (network congestion), the operating status and system configuration of other communication functions. ■Communications during the data logging file transfer Since the Ethernet communication load is high during the data logging file transfer, the behavior is as follows. •...
  • Page 221 Data transfer to the data memory ■Free space in the data memory When the transfer to the data memory is set, delete data by user data operation in the engineering tool to free up space in the data memory for storing the transferred data logging files. When a file transfer error occurs due to out of data memory space during transfer to the data memory, free up the required space and turn off and on SM653 (File transfer to data memory request) to transfer the data to the data memory again.
  • Page 222 Data in the CPU module when a device/label is specified Before starting the data logging, write the following data to the CPU module from the engineering tool. Device/label specification Data required to be written When a local device is specified The CPU parameter including the program name specified with CPU Module Logging Configuration Tool When a global label is specified Project data that is read using CPU Module Logging Configuration Tool (global label setting file)
  • Page 223: Chapter 12 Debug Function

    DEBUG FUNCTION This chapter describes the functions used for debugging. Item Description Reference Online change (ladder block) Changes and writes a part of the program and data online. Page 115 Online change (ladder block) Page 221 Memory Dump Function Memory dump function Stores device values of the CPU module at any given timing.
  • Page 224: Object Data

    Object data This section describes the data to be collected by memory dump. Data to be collected Of the devices listed below, all devices that are within the range specified in the device settings are subject to the collection. Type Device Bit device X, Y, M, L, B, F, SB, V, T (contact), T (coil), LT (contact), LT (coil), ST (contact), ST (coil), LST (contact), LST (coil), C (contact),...
  • Page 225 Error code specification With a specified error code of the CPU module as a trigger, data is to be collected. The occurrence timing of trigger varies depending on the error type: continuation error or stop error. ■At the occurrence of a continuation error The occurrence timing of trigger is at the time of END processing of the scan where an error has occurred.
  • Page 226: Procedure For Memory Dump

    Combining trigger conditions A trigger can be generated with trigger conditions combined. This combination is based on an OR condition. The establishment of a condition, either device specification or error code specification, results in data collection. Condition Trigger established generated The established condition is On error not recognized as a trigger...
  • Page 227: Flow Of Data Collection

    Flow of data collection Collected data is stored in the internal buffer, where the data is partitioned at END processing and saved in the SD memory card. Condition establishment Condition establishment timing Trigger occurrence Program Program END processing Internal buffer SD memory card Finish Writing of sampling data...
  • Page 228: Memory Dump File

    Memory dump file This file stores data that is collected through memory dump (collection result by memory dump). Data collected by one execution is saved in one file. The memory dump file is saved in a binary format and stored under the "MEMDUMP" folder. Save file name The file name can be arbitrarily set within a range of 64 characters (extension and period included) together with an auto- assigned number (00 to 99).
  • Page 229: States Of The Memory Dump Function

    States of the memory dump function The state of the memory dump function is reflected in the memory dump status. The engineering tool allows the memory dump status to be checked. ( GX Works3 Operating Manual) Memory dump status The following table lists the memory dump status. Memory dump status Description Trigger-wait not collected...
  • Page 230: Sizes Of Files Used For The Memory Dump Function

    Sizes of files used for the memory dump function This section shows the sizes of files used for the memory dump function. Capacity of the memory dump setting file The capacity of the memory dump setting file varies depending on the length of the save file name. The following formula is used for the calculation: ...
  • Page 231: Special Relay And Special Register Used In The Memory Dump Function

    Special relay and special register used in the memory dump function For details, refer to the following. • Special relay: Special relay relating to the memory dump function ( Page 825 Memory dump function) • Special register: Special register relating to the memory dump function ( Page 869 Memory dump function) Precautions for the memory dump function This section describes precautions to take when using the memory dump function.
  • Page 232 The following table shows the cases where the file operation related to the memory dump function is executed while the memory dump function is in execution. Target file File operation Behavior Memory dump setting file Write Settings that are subsequently written during the execution of the memory dump function are reflected after the completion of save, not reflected immediately.
  • Page 233 Creating files and folders Under the "MEMDUMP" folder containing memory dump files, do not create any files or folders using a personal computer or other device. Doing so may result in deletion of files and folders. Access to the SD memory card The SD memory card is so frequently accessed that a delay occurs in completing the access to the SD memory card (read/ write).
  • Page 234: Chapter 13 Database Function

    DATABASE FUNCTION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • This function cannot be used in the R00CPU, R01CPU, and R02CPU. This function manages the data such as product information or production information as a database in an SD memory card of the CPU module.
  • Page 235: Specifications

    13.1 Specifications Database specifications The following table lists specifications of databases which the user can create. Item Description The maximum number of fields 128 fields per table *2*4 The maximum number of records No limitation (they can be created up to the capacity of the SD memory card) The maximum number of tables 32 tables per database The maximum number of databases...
  • Page 236 • To input the data to the field of STRING using the CPU module database access function, use the data type of NLSCHAR. (Although the data is managed as Unicode in the database of the CPU module, it is converted to Shift-JIS code on the device of the CPU module.) •...
  • Page 237 Available operations The following table lists the operations that can be performed with the database functions. : Can be performed, : Cannot be performed Operation Description Database access instruction CPU module database access function Availability and instruction Availability and application symbol ...
  • Page 238: Database Access Instruction

    13.2 Database Access Instruction Usage procedure This section describes the procedure to use the database function. Creating databases To construct a database on an SD memory card, create a Unicode text file which defines the configuration of the database and its tables, store the file on the SD memory card, and execute the DBIMPORT(P) instruction, specifying the created Unicode text file.
  • Page 239: Creating Unicode Text Files

    Creating Unicode text files When the DBIMPORT(P) instruction is executed, a database is created on an SD memory card, according to setting details in the tab-delimited format of Unicode text file. The user must create Unicode text files on an SD memory card. Setting details of Unicode text file The following table lists items which must be specified in a Unicode text file to create a database.
  • Page 240 Specifications of the character code for Unicode text files are as follows: • Character encoding schema: UTF-16 (Little-Endian) • BOM: Yes ■Format of setting values in Unicode text Item Description WORD, DWORD, The value must be specified in the decimal format (e.g. 0, 1, 111, -111). INT, DINT BOOL The value must be 0 or 1.
  • Page 241 Example of the Unicode text file format (Database name: database1, Table name: product-info1) Data type: INT Data type: STRING, Number of characters: 124 Key restriction: Main key Key restriction: None proinfon proid1 proinfo1 proinfo2 abcd efgh pqrs 1001 efgh pqrs tuv abcd abcd efgh...
  • Page 242: Transactions For Databases

    Transactions for databases Use a transaction (the DBTRANS(P) instruction and the DBCOMMIT(P) instruction) to perform multiple operations for a database as a set and update the database at once. The DBTRANS(P) instruction starts a transaction, and the DBCOMMIT(P) instruction groups the results of the following instructions together to update the target database at once. •...
  • Page 243: Timing Of Database Update

    Timing of database update Once execution of a database access instruction is completed, the target database is updated. However, during transaction, the database is not updated each time execution of an instruction is completed. Instead, all changes during the transaction are applied to the database at once when the DBCOMMIT(P) instruction is executed.
  • Page 244: Cpu Module Database Access (From External Device) Function

    13.3 CPU Module Database Access (from External Device) Function The CPU module database access function operates a database, that is built in an SD memory card inserted into the CPU module, from an application on a personal computer through the Ethernet port of the CPU module. To use the CPU module database access function, install CPU Module Database Access Driver into a personal computer.
  • Page 245 Database access setting Creating a database Create a database in an SD memory card of the CPU module. ( Page 245 Creating a database) Adding a database to the ODBC data source Add the created database of the CPU module to the ODBC data source of the personal computer. ( Page 246 Adding a database to the ODBC data source) Database operation Checking the start-up of the ODBC server...
  • Page 246: Built-In Database Access Setting

    Built-in database access setting To use the CPU module database access function, set "To Use or Not to Use the Built-in Database Access" of the module parameter to "Use" with the engineering tool. [Navigation window]  [Parameter]  CPU module  [Module Parameter]  [Application Settings]  [Built-in Database Access Setting] Window Displayed items...
  • Page 247: Creating A Database

    Creating a database This section describes the procedure for creating a database to be used with the CPU module database access function. A database can be created with the following methods. • Storing the database folder • DBIMPORT(P) instruction (a database access instruction) Storing the database folder Store the database folder in an SD memory card.
  • Page 248: Adding A Database To The Odbc Data Source

    Adding a database to the ODBC data source This section describes the procedure for adding a created database of the CPU module to the ODBC data source in the personal computer. (Examples of Windows 7 are shown below. Names of windows and menus may differ depending on the version of the OS.) Select [Start] ...
  • Page 249 Data Source Name Setup Set the database of the CPU module connected from the personal computer. Window Displayed items Item Description Data Source Name Set the identification name (any character string) for specifying the connection target database from the application. Input 1 to 32 characters in single-byte or double-byte alphanumeric characters.
  • Page 250: Application Example

    Application example This section describes the examples of database operations of the CPU module from applications in the personal computer using the CPU module database access function. (Names of windows and menus may differ depending on the version of the OS and application.) Item Description...
  • Page 251 Start Microsoft Access and select "Blank database". Add the following fields. Field name Data type Data type for when the data is exported to the database of the CPU module proID AutoNumber type: Long integer Enduser Numeric type: Long integer TargetX Numeric type: Single-precision floating point type REAL...
  • Page 252 The result of export is displayed, and the table is added to the database of the CPU module. To set the details that cannot be set with Microsoft Access, send desired SQL commands to the database of the CPU module. Clicking the [Create] tab ...
  • Page 253 Record operation from an application The following provides an example of record operation such as synchronizing, writing, and deleting of the data by connecting to the database of the CPU module by using Microsoft Access. Ethernet Start Microsoft Access and select the [External Data] tab ...
  • Page 254 On the window for selecting table, select a table to be operated and click the [OK] button to display the contents of the table. When the value is changed or the record is deleted, the database of the CPU module is changed according to the operation.
  • Page 255 Record search from an application The following provides an example to search the record that matches the specified condition from the production data stored in the database by connecting to the database of the CPU module by using Excel. Ethernet Start Excel, and select the [Data] tab ...
  • Page 256 On the window for setting the sort order of the query wizard, set the condition to sort the output data. Set the output destination. Then, the search result is output. When the file used in the above procedure is saved, the search condition is also saved. Click the [Data] tab ...
  • Page 257 User-created application The following describes a sample program for accessing the database of the CPU module with the SQL command using the ODBC class of Microsoft .NET Framework. Ethernet ■Overview of the sample program This sample program performs the condition search in the database of the CPU module using the value of the Judge field as its key, and displays the acquired search result in a list and graph (scatter plot).
  • Page 258 ■Database configuration of the sample program The following describes the database configuration to be searched by the sample program. Item Description Server name (IP address of CPU module) 192.168.3.39 Database folder path 2:\Database\SampleDB Database name SampleDB Table name to be searched CheckData The following table lists the records of CheckData table.
  • Page 259 ■Source code of the sample program The following describes the source code of the sample program. • Development environment: Visual Studio 2015 • Programming language: C# namespace iQ_R_DB_Access public partial class FrmMain : Form public FrmMain() InitializeComponent(); // Range setting of X-/Y-axis on a graph chart1.ChartAreas[0].AxisX.Minimum = 400;...
  • Page 260 // Processing the search results one record at a time for (int recordnum = 0; reader.Read(); recordnum++) // Adding a blank row to the list dtRecord.Rows.Add(); Setting the number of rows to be inserted into the list recordnum = dtRecord.Rows.Count-2; Storing acquired records into the list one field at a time for (int i = 0;...
  • Page 261: Precautions

    Precautions This section describes the precautions for using the CPU module database access function. Database creation When creating a database in the CPUDB folder, use characters that can be specified only. If the characters that cannot be specified are used to create the database, the table cannot be accessed by the database access instructions. For the characters that can be specified, refer to the following.
  • Page 262 Completion with an error during database access Do not power off or reset the CPU module during the access to a database of the CPU module. Otherwise, the change is not reflected on the database that is being executed. Files created with this function Do not create, change, and delete the ODBC server setting file (netserver.cfg), database path file (dbmaintainpath.txt), and error database check file (ErrorDB.txt) created with the CPU module database access function.
  • Page 263 When the load of the CPU module is high When the CPU module database access function is used with high circuit load to the Ethernet port of the CPU module by other functions or high access load to the SD memory card, a timeout error may occur in the application on the personal computer side.
  • Page 264: Chapter 14 Pid Control/Process Control Function

    PID CONTROL/PROCESS CONTROL FUNCTION This chapter describes the PID control/process control function. 14.1 PID Control Function RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) PID control is applicable to process control in which factors such as flow rate, velocity, air flow volume, temperature, tension, and mixing ratio must be controlled.
  • Page 265: Process Control Function

    14.2 Process Control Function This chapter describes the process control function. Process control by using process control function blocks RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) A process control function block is the function block whose functions are extended for the process control. A process control program can be easily created by using process control function blocks.
  • Page 266: Process Control By Using Process Control Instructions

    Process control by using process control instructions RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) This function performs various types of process control by using process control instructions that support loop control, such as two-degree-of-freedom PID control, sample PI, and auto tuning, in combination.
  • Page 267: Chapter 15 Cpu Module Data Backup/Restoration Function

    CPU MODULE DATA BACKUP/RESTORATION FUNCTION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • This function cannot be used in the R00CPU, R01CPU, and R02CPU. This function backs up data such as program files, a parameter file, and device/label data of a CPU module to an SD memory card.
  • Page 268 Backup data Backup data is saved in an SD memory card. The following shows the folder structure of backup data. Root directory MAIN.PRG $MELPRJ$ Backup 20160101 00001 Drive0 FB.PFB FILEREG.QDR Drive3 LOGCOM.QLG MAIN.PRG Drive4 $MELPRJ$ MEMDUMP.DPS $BKUP_CPU_INF.BSC BKUP_CPU.BKD BKUP_CPU_DEVLAB.BKD 00002 20160102 Folder type Folder name...
  • Page 269 *1 Date folders and number folders are automatically named by the CPU module. *2 The maximum number of storable folders is 32767. Backup/restoration target data Backup target data is all target data in the CPU module. ( Page 267 Backup/restoration target files) Restoration target data is set with SD954 (Restoration target data setting).
  • Page 270 ■Backup/restoration target device data : Available, : Not available Classification Device name Symbol Backup Restoration   User device Input   Output   Internal relay   Link relay   Annunciator   Link special relay Edge relay ...
  • Page 271 ■Backup/restoration target label data : Available, : Not available Classification Backup Restoration   Global label (including module labels)   Global label with latch specified   Local label   Local label with latch specified *1 For module labels, data may be overwritten to the write areas from a module to the CPU module when the refresh settings have been made.
  • Page 272: Backup Function

    15.1 Backup Function This function backs up data of a specified CPU module in an SD memory card. The backup function operates even when the CPU module is in the RUN state. When executing the backup function with the CPU module in the RUN state, do not change device/label data during execution of the function.
  • Page 273 ■Operation of the special relay and special register The following figure shows the operations of the special relay and special register of when the upper limit value for the number of CPU module backup data has been set. Check the following at the timing on when the bit 5 of SD944 (Enable the upper limit value for the number of CPU module backup data) is turned on, and enable the upper limit value for the number of CPU module backup data.
  • Page 274: Backup Processing Triggered By Turning On Sm1351

    Backup processing triggered by turning on SM1351 Data in the CPU module is backed up at a desired timing. Operating procedure Data in the CPU module is backed up by turning on SM1351. To set the upper limit value for the number of CPU module backup data, follow the steps below. •...
  • Page 275: Automatic Backup Using Sd944

    Automatic backup using SD944 Data in the CPU module can be automatically backed up at a preset execution timing. Set the execution timing of the automatic backup with SD944 (Backup function setting). Multiple execution timing settings can be set. Bit pattern of SD944 Execution timing Bit 0: On On the time set in SD948 and SD949 on the day set in SD947...
  • Page 276 Operating procedure (when date and time are specified) Data is automatically backed up on the specified date and time. Set the upper limit value for the number of CPU module backup data. (The setting method and operating procedure for the upper limit value are the same as those for the upper limit value for the backup processing triggered by turning on SM1351.
  • Page 277: Checking Backup Errors

    Operating procedure (when a stop error has occurred in the CPU module) Data is automatically backed up when a stop error occurs in the CPU module. Set the upper limit value for the number of CPU module backup data. (The setting method and operating procedure for the upper limit value are the same as those for the upper limit value for the backup processing triggered by turning on SM1351.
  • Page 278 When parameter settings were changed before execution of the backup processing When programs or parameter settings were changed, check that operations are performed with the new programs and parameter settings and then execute the backup function. If the backup processing is executed without the check of the operations with the new programs and parameter settings, the restoration processing may not be executed.
  • Page 279 Operations and functions that cannot be performed While the following operations or functions are being executed, the backup processing cannot be executed. The following operations and functions cannot be executed during execution of the backup processing. Operation or function Operation from the engineering tool Initializing the CPU built-in memory/SD memory card Clearing values (Devices, labels, file registers, latches) Writing data to the programmable controller (including online change of files)
  • Page 280 Data logging function and backup When the CPU built-in memory (function memory) is specified for the data storage destination memory in the data logging function, the function memory is cleared after the CPU module is powered off or the RESET state is cleared. Thus, data logging files are also cleared.
  • Page 281: Restoration Function

    15.2 Restoration Function This function restores backup data in the SD memory card to the CPU module. Restoration target folder Set restoration target data among backup data in the SD memory card with SD956 (Restoration target date folder setting) to SD958 (Restoration target number folder setting).
  • Page 282 Operation setting after restoration As an operation after the restoration processing, set whether to operate the CPU module in the status at the backup processing or to operate the CPU module in the initial status with the bit 15 of SD955. The following table lists the operations of each item to be performed according to the operation setting after restoration.
  • Page 283: Restoration Processing Triggered By Turning On Sm1354

    Restoration processing triggered by turning on SM1354 Backup data is restored at a desired timing. Use the restoration function by turning on SM1354 to check the backup data and to test before actual operation. To operate the system using the backup data, use the automatic restoration with SD955. ( Page 282 Automatic restoration using SD955) The restoration processing triggered by turning on SM1354 (CPU module data restoration execution request) can be executed only when the CPU module is the STOP state.
  • Page 284: Automatic Restoration Using Sd955

    Automatic restoration using SD955 Backup data is automatically restored when the CPU module is powered on or is reset. Initialization at the automatic restoration Set whether or not to initialize drives other than the SD memory card at execution of the automatic restoration with the bit 1 of SD955 (Restoration function setting).
  • Page 285: Precautions

    Precautions The following describes the precautions for the restoration function. Prohibited operation during execution of the restoration processing Do not perform the following operations during execution of the restoration processing. • Removing and inserting the SD memory card • Powering off or resetting the CPU module The above mentioned operations leave the data in the CPU module in an incomplete state which is middle of the restoration processing.
  • Page 286 Changing the operating status during execution of restoration During execution of the restoration processing, the CPU module remains in the STOP state even though the RUN/STOP/ RESET switch is changed from the STOP to RUN position or the remote RUN or the remote PAUSE is executed. If the operating status of the CPU module is changed, the status will changes to the set status after the restoration processing is completed.
  • Page 287 Data protected by security functions ■File password function Unlock the file passwords of the files in the backup target CPU module. If any files to which file passwords have been set exist in the CPU module, the files are not restored. ■Security key authentication function Locked programs can be restored regardless of whether security keys have been written or not.
  • Page 288 Operation or function Others • SLMP Remote latch clear (Remote Latch Clear) • MC protocol Creating a new file (New File) Writing data to a file (Write File) Deleting a file (Delete File) Copying a file (Copy File) Changing a file attribute (Change File State) Changing file creation date (Change File Date) Opening a file (Open File) Reading a file (Read File)
  • Page 289 Restoration of when the data allocation in the program file is different The data allocation in the program file differs depending on the firmware version of the CPU module. ( Page 93 Data allocation and procedure of read/write operations) When the data backed up using the CPU module with the conventional data allocation is restored to the CPU module with the new data allocation, the restoration processing is completed successfully.
  • Page 290: Chapter 16 Multiple Cpu System Function

    MULTIPLE CPU SYSTEM FUNCTION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the Safety CPU, refer to the following as well. Page 535 FUNCTIONS With multiple CPU modules mounted on the base unit, each of the CPU modules controls their own assigned I/O modules and intelligent function modules.
  • Page 291: Out-Of-Group I/O Fetch

    16.1 Out-of-group I/O Fetch The access range to the controlled module is different from that to the non-controlled module. To fetch the data which cannot be accessed, use the out-of-group I/O fetch function. Accessing controlled module The access range to the controlled module of the CPU module is the same as that to the single CPU system, and I/O refresh for the controlled module and/or reading/writing to buffer memory of the intelligent function module are enabled.
  • Page 292 Out-of-group I/O fetch setting In this menu item, whether or not out-of-group I/O status is fetched can be specified. [System Parameter]  [Multiple CPU Setting]  [Other PLC Control Module Setting]  [I/O Setting Outside Group] Window Displayed items Item Description Setting range Default...
  • Page 293: Operation Settings

    Output to output/intelligent function module On/off data cannot be output to non-controlled modules. When turning on or off output of the output module and/or intelligent function module controlled by other CPU modules by the program or others, the output is turned on or off within the CPU module.
  • Page 294: Synchronous Startup Setting

    Applicable errors to the stop setting The following table lists the applicable errors to the setting that specifies the operation of all the CPU modules of when a major or moderate error has occurred in any of the CPU modules. Error name Error code Another CPU module moderate error...
  • Page 295 Program to check start-up of each CPU module It is recommended to create a program that checks start-up of each CPU module using SM220 to SM223 (CPUs No.1 to No.4 preparation completed) when the multiple CPU synchronized startup is disabled. If a certain instruction is issued against a CPU module that has not started, the instruction executes no processing.
  • Page 296 ■Program example • Devices to be used for programs to start operation processing synchronously Device to be used Application Flag that indicates the operation processing is ready to be started (after a flag that indicates the operation start turns on, this flag turns off.) Flag that indicates an operation start (this flag turns on for only one scan.) U3En\G2048...
  • Page 297: Clock Data

    Clock data CPUs No.2 to No.4 automatically synchronize their clock data to the one set for CPU No.1 (even if setting up clock data individually for each CPU, they will be overwritten). Therefore, simply setting up the clock data for CPU No.1 allows to manipulate a unified clock data across the entire multiple CPU system (...
  • Page 298: Multiple Cpu Parameter Checking

    16.3 Multiple CPU Parameter Checking Whether the same setting is configured for between the system parameter of each CPU module and multiple CPU refresh number of points of CPU parameter is checked by the multiple CPU system at the timing shown below. However, as for the fixed scan communication setting and inter-module synchronization setting, checking is done only for the module using the functions.
  • Page 299: Data Communication Between Cpu Modules

    16.4 Data Communication Between CPU Modules CPU modules within a multiple CPU system can send and transfer data to each other. The refresh communication and direct access communication enable data writing or reading between CPU modules. The following table lists the data communication method.
  • Page 300 ■Avoidance of 64-bit data inconsistency To avoid 64-bit data inconsistency, access the CPU buffer memory by specifying the start address as a multiple of four similarly to the device to be specified. CPU No.1 CPU No.2 CPU buffer memory G2048 Device Device G2052...
  • Page 301 Checking for the memory configuration This section describes the CPU buffer memory configuration of each CPU No. The refresh setting can be configured in both the CPU parameter and the window shown below. ( Page 308 Refresh settings) [System Parameter]  [Multiple CPU Setting]  [Communication Setting between CPUs]  [CPU Buffer Memory Setting] ...
  • Page 302 Setting the data communication with fixed scan communication area This section describes the setting for making the data communication with fixed scan communication area. ■Setting whether or not it should be used To communicate data with the fixed scan communication area, "Enable" must be set to "Fixed Scan Communication Function".
  • Page 303 When there exists a CPU module for which "Disable" is set to "Fixed Scan Communication Function", if the send area of the fixed scan communication area is set to a CPU module for which "Disable" is set to "Fixed Scan Communication Function" (unspecified) in the parameter setting on the host CPU module, no error is generated because the unspecified CPU module is considered as a reserved one for future configuration.
  • Page 304: Fixed Scan Communication Setting

    Fixed scan communication setting This menu item sets up the interval for data transfer between CPU modules. The data transfer interval can be synchronized with the timing for inter-module synchronization cycle ( MELSEC iQ-R Inter-Module Synchronization Function Reference Manual) [System Parameter]  [Multiple CPU Setting]  [Fixed Scan Communication Setting]  [Fixed Scan Interval Setting of Fixed Scan Communication] Window Displayed items...
  • Page 305: Module-By-Module Data Guarantee

    Module-by-module data guarantee In data communication, data is handled in units of 64 bits. Therefore, when data larger than 64 bits is handled, old and new data may be mixed for each CPU module depending on the timing between data reading by the host CPU module and data writing by other CPU modules/data receiving from other CPU modules.
  • Page 306 Prevention of data inconsistency by module-by-module data guarantee The following table shows the preventive control against data inconsistency according to the presence or absence of module- by-module data guarantee. : With the preventive control against data inconsistency by the system, : Without the preventive control against data inconsistency by the system Communication method CPU buffer memory...
  • Page 307: Communication Through Refresh

    Communication through refresh The device data for each CPU module is written/read only by the parameter settings. Using refresh areas allows data communication between all or a part of the CPU modules in the multiple CPU system, thereby enabling devices of other CPU modules to be used by the host CPU module.
  • Page 308 ■Refresh using CPU buffer memory At the END processing of the host CPU module, device data of the host CPU module is written to the refresh area within the CPU buffer memory on the host CPU module. The data written to the refresh area is transferred to the device of another CPU module at the END processing of another CPU module.
  • Page 309 Executing refresh Refresh is executed when the CPU module is in RUN and/or STOP (PAUSE) state. For details on the behavior when the CPU module is in stop error state, refer to CPU module operation upon error detection setting. ( Page 129 CPU module operation upon error detection setting) ■Behavior during the multiple CPU synchronous interrupt program (I45) execution If refresh is set to be performed during the multiple CPU synchronous interrupt program (I45) execution, the refresh behavior...
  • Page 310 Refresh settings The refresh can be set up with "Refresh Setting between Multiple CPUs" in "CPU Parameter". [CPU Parameter]  [Refresh Setting between Multiple CPUs] Operating procedure Click "Detailed Setting" at the execution timing "Refresh Setting between Multiple CPUs" window for each refresh.
  • Page 311: Communication Through Direct Access

    Communication through direct access This method uses programs to communicate with other CPU modules. The following table lists the communications using the direct access method. Communication method Description Instruction to be used Communication using CPU buffer memory Data between CPU modules are transferred using •...
  • Page 312 Communication using CPU buffer memory and fixed scan communication area This section describes the communication using CPU buffer memory and fixed scan communication area. ■Available area for communication The following area can be used for communication. Area Description CPU buffer memory All the CPU buffer memory area except for the refresh area is available.
  • Page 313 • When using an area within the fixed scan communication area Data written to the area within the fixed scan communication area on the host CPU module using the write instruction is sent to other CPU modules at the period specified in the fixed scan communication setting. Other CPU modules read the received data using the read instruction.
  • Page 314: Data Guarantee By Program

    Data guarantee by program This section describes how to avoid the inconsistency of data larger than 64 bits using the program. To set up the module-by- module data guarantee using the parameters, use the multiple CPU setting. ( Page 304 Module-by-module data guarantee) Data guarantee in communication through the refresh Inconsistency of transferred data can be avoided by setting the interlock device to a transfer number lower than the one for...
  • Page 315 Data guarantee for communication through direct access The behavior varies depending on the area to be accessed. ■When accessing CPU buffer memory: The program reads data in ascending order from the start address of the CPU buffer memory other than the refresh area, and the write instruction writes send data in descending order from the end address of the CPU buffer memory other than the refresh area.
  • Page 316 ■When accessing fixed scan communication area When accessing within the multiple CPU synchronous interrupt program (I45), enabling the setting of module-by-module data guarantee eliminates the need of an interlock circuit. When this refresh area is accessed within a program other than the above, or when the setting of module-by-module data guarantee is disabled, an interlock circuit is required, as with the access to the CPU buffer memory.
  • Page 317: Communication Between Cpu Modules In Error State

    Communication between CPU modules in error state The following section describes communication between CPU modules in an error state. Behavior in receive data error state A CPU module receiving illegal data due to noise and/or failure discards the received data. If a received data is discarded, the receive-side CPU module keeps the last data received before discarding.
  • Page 318: Multiple Cpu Synchronous Interrupt

    16.5 Multiple CPU Synchronous Interrupt This function triggers an interrupt program at the fixed scan communication cycle set in a parameter. An interrupt program executed at the fixed scan communication cycle is called a multiple CPU synchronous interrupt program. Using the multiple CPU synchronous interrupt enables synchronizing with the fixed scan communication cycle so that data communication between CPU modules can be made.
  • Page 319: Execution Timing

    Execution timing The multiple CPU synchronous interrupt program (I45) is executed at the timing for the fixed scan communication cycle. The fixed scan communication cycle can be changed through the fixed scan communication setting. ( Page 302 Fixed scan communication setting) It is also possible to perform refresh during the multiple CPU synchronous interrupt program (I45) in execution.
  • Page 320: Chapter 17 Security Function

    SECURITY FUNCTION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • Only the SIL2 Process CPU and Safety CPU support the user authentication function. This function serves to protect the user property stored in a personal computer and the user property inside modules in the MELSEC iQ-R series system against threats such as theft, tampering, faulty operation, and unauthorized execution due to the unauthorized access by an outsider.
  • Page 321 If a personal computer with a security key registered is abused by an outsider, there is no way to prevent the outflow of the program property, and thus the user needs to take adequate measures as shown below: • Preventive measures against the theft of a personal computer (for example, wire locking) •...
  • Page 322: Chapter 18 Sequence Scan Synchronization Sampling Function

    SEQUENCE SCAN SYNCHRONIZATION SAMPLING FUNCTION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) Data of the CPU module are collected when each module synchronizes data with the sequence scan of the CPU module. The modules which can synchronize and collect with sequence scan are as follows: •...
  • Page 323 MEMO 18 SEQUENCE SCAN SYNCHRONIZATION SAMPLING FUNCTION...
  • Page 324: Chapter 19 Label Initialization Function

    LABEL INITIALIZATION FUNCTION RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using a SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS In the Process CPU and SIL2 Process CPU, the labels assigned to label areas will be initialized (Initial values are set if the values have been set, or the labels are cleared to zero if not) when the CPU module is powered off and on or the operating status of the CPU module is switched from STOP to RUN after data is rebuilt (reassigned) and then written to the programmable controller.
  • Page 325 Operating procedure The following describes the operating procedure for this function. Rebuild (reassign) all data. [Convert]  [Rebuild All] Set the CPU module to the STOP state. Write the new program files. When initial values have been set in the labels used in the program, write the label initial value file together with the program files.
  • Page 326: Label Initial Value Reflection Setting

    19.2 Label Initial Value Reflection Setting With the default settings of the Process CPU and SIL2 Process CPU, initial label values are not set in labels when the operating status of CPU module is switched from STOP to RUN even though the label initial values have been set for the labels.
  • Page 327 Setting method The following describes how to configure the label initial value reflection setting. [CPU Parameter]  [File Setting]  [Label Initial Value Reflection Setting] Window Displayed items Item Description Setting range Default Label Initial Value Set whether or not to set label initial values when the operating status of the •...
  • Page 328: Chapter 20 Routing Setting

    ROUTING SETTING RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) The user can configure any communication route to perform transient transmission to stations in a different network. This setting can be used when the system has a network module which does not support dynamic routing or when it is necessary to clearly specify a communication route.
  • Page 329: Setting Example

    20.2 Setting Example The following is an example of the routing setting. Transient transmission from the request source (Network No.1) to the target (Network No.3) via Network No.2. Network No.: 1 Network No.: 1 Network No.: 2 Network No.: 2 Network No.: 3 Network No.: 3 Station No.3...
  • Page 330 MEMO 20 ROUTING SETTING 20.3 Precautions...
  • Page 331: Part 3 Devices, Labels, And Constants

    PART 3 DEVICES, LABELS, AND CONSTANTS This part consists of the following chapters. 21 DEVICES 22 LABELS 23 LATCH FUNCTION 24 DEVICE/LABEL INITIAL VALUE SETTINGS 25 CONSTANTS...
  • Page 332: Chapter 21 Devices

    DEVICES This chapter describes the devices. 21.1 Device List This section lists the devices. Classification Type Device name Symbol Number of points Parameter-set range Notation of Default User device Input 12K points Unchangeable Hexadecimal Output 12K points Hexadecimal Internal relay 12K points Changeable (...
  • Page 333: Device Setting

    Classification Type Device name Symbol Number of points Parameter-set range Notation of Default Pointer  Pointer 8192 points Changeable (Page Decimal 363 Pointer setting)  Interrupt pointer 1024 points Unchangeable Decimal   Other devices Network No. specification Unchangeable Decimal device ...
  • Page 334: Range Of Use Of Device Points

    Specify each item so that the total number of points for each user device does not exceed the capacity of the device area. ( Page 95 Device/label memory area setting) Range of use of device points The following table lists the range of use of device points to be set in the device setting. Type Device name Symbol...
  • Page 335: User Device

    21.3 User Device This chapter describes the user device. Input (X) This device provides the CPU module with commands and/or data using an external device, such as pushbutton, transfer switch, limit switch, and digital switch. Push-button switch CPU module Selector switch Input (X) Digital switch Concept of input...
  • Page 336: Internal Relay (M)

    Internal relay (M) This device is used as an auxiliary relay within the CPU module. The following operations turn off all the internal relays. • Turning power of the CPU module off and on • Reset • Latch clear Latch relay (L) This device is an auxiliary relay which enables latching (data retention during power failure).
  • Page 337 On/off method for annunciator Annunciators are turned on by either the SET Finstruction or the OUT F instruction. Annunciators are turned off by the RST Finstruction or the LEDR instruction or the BKRST instruction. When the annunciators are turned on/off using any methods (e.g. the MOV instruction) other than shown above, the operation is the same as that of internal relays.
  • Page 338: Link Special Relay (Sb)

    If more than 16 annunciators are turned on, the 17th annunciator onwards are not stored into SD64 to SD79. However, if the numbers of annunciators registered in SD64 to SD79 are turned off, the lowest numbers, which are not registered in SD62 to SD79, of the numbers of annunciators which were turned on for the 17th on and after, are stored into SD64 to SD79.
  • Page 339: Edge Relay (V)

    Edge relay (V) The edge relay is a device that memorizes operation results (on/off information) from the head of the ladder block, allowing its use only by the EGP/EGF instruction. This device is executed for various objectives such as the rising (off and on) detection in the structured programs by the index modification.
  • Page 340: Timer

    Timer This device starts measurement when the timer coil is turned on. When the current value reaches a setting value, time is up and the contact is turned on. This timer is an up-timing type device and therefore the current value matches a setting value when the timer time is up.
  • Page 341 ■Retentive timer (ST) This device counts the sum of time duration in which the coil is turned on. When the retentive timer coil is turned on, measurement starts and when the timer current value matches a setting value (when time is up), the retentive timer contact is turned on.
  • Page 342 ■Low-speed/high-speed timer (T/ST) The low-speed timer and high-speed timer are the same device which is set to a low speed or high speed timer by writing the instruction accordingly to specify it on the timer. For example, specifying OUT T0 generates a low-speed timer and specifying OUTH T0 produces a high-speed timer even when using the same T0 device.
  • Page 343 Accuracy of timers This sections describes the accuracy of timers. ■Timer (T/ST) The scan time value measured by the END instruction is added to the current value when the OUT T instruction is executed. If the timer coil is turned off when the OUT T instruction is executed, the current value is not updated. The maximum response accuracy of the timer (the time duration from capture of an input (X) to output of it) is "2 scan time + timer time limit setting".
  • Page 344 ■Long timer (LT/LST) In the following program, the accuracy of Tp (the time duration from the long timer coil activation to long timer contact activation) is (Ts-Tu)  Tp < (Ts + Tu). Process value of LT0 (Tp) LT0 (coil) LT0 (contact) LT0 coil Execution of...
  • Page 345 Data configuration of long timer (LT/LST) The long timer (LT) and the long retentive timer (LST) use four words (64 bits) for each point. If the most significant two words are changed in a program, it is impossible to measure the time properly, because they are used by the system. 1 word (16 bits) Current value of...
  • Page 346: Counter

    Counter This device counts the number of rising operation of the input condition in the program. The counter is an up-timing type device and therefore when the count value matches a setting value, the count reaches its upper limit and the contact is turned Types of counters There are two types of counters: counter (C) which retains the counter values in 16-bit units and long counter (LC) which retains them in 32-bit units.
  • Page 347 Resetting counters The counter current value is not cleared even when the counter coil input is turned off. To clear the counter current value (resetting) and turn off the contact, issue the RST C/RST LC instruction. When executing the RST C instruction, the counter value is cleared and the contact is turned off.
  • Page 348 ■Precautions about counter reset When executing the RST C instruction, the coil for C is also turned off. If the execution condition for the OUT C instruction is turned on after the RST C instruction is executed, the coil of C is turned on and the current value is updated (count value +1) when the OUT C...
  • Page 349: Data Register (D)

    Data register (D) This device can store numerical values. Link register (W) This device is used as a CPU module side device when refreshing word data between the network module, such as the CC- Link IE Controller Network module and the CPU module. Refreshing network modules using link register Data are transferred/received between the link register (W) within the CPU module and the link register (LW) of the network module, such as the CC-Link IE Controller Network module.
  • Page 350: System Device

    21.4 System Device The system device is used by the system. Assignment/capacity is fixed and cannot optionally be altered. Function device (FX/FY/FD) This device is used for the subroutine programs with argument passing. Data is written/read between the subroutine call sources with argument passing and the subroutine programs with argument passing.
  • Page 351: Special Relay (Sm)

    Special relay (SM) This is the internal relay for which the specification is defined in the CPU module, where the status of the CPU module is stored. ( Page 803 List of Special Relay Areas) Special register (SD) This is the internal register for which the specification is defined in the CPU module, where the status (diagnostics information, system information, etc) of the CPU module is stored.
  • Page 352: Specification Range

    Specification range All the link devices of the network module can be specified. The link devices which fall outside the range specified with "Refresh Setting" can also be specified. Specification range for writing Writing should be done for the range which is within the link device range specified as a sending range of network parameters and outside the range specified as a refresh range for "Refresh Setting".
  • Page 353: Module Access Device

    21.6 Module Access Device This device directly accesses from the CPU module to the buffer memory of the intelligent function module mounted on the main base unit and extension base unit. Specify this device with 'Un\Gn'. (Example: U5\G11) Specified item Value to be specified Start I/O number of intelligent function modules Upper two digits when a start I/O number is described in three digits...
  • Page 354: Precautions

    Precautions The following describes the precautions for when the module access device is used. • If data is written to the refresh-target memory using a program while the refresh function is being used, the CPU module overwrites the data in the target memory at the execution of the refresh function. Thus, the expected operation may not be acquired.
  • Page 355: Index Register (Z/Lz)

    21.8 Index Register (Z/LZ) This device is used for the index modification of the device. The index modification is the indirect specification using the index register. Specify the device with the number obtained from "Device number of device targeted for modification" + "Contents of index register".
  • Page 356: Device For Which Index Modification Can Be Performed

    Device for which Index modification can be performed The following table lists the devices that can be targeted for index modification. Item Description 16-bit index modification X, Y, M, L, B, F, SB, V, S , LT , ST , LST , LC , D, W, SW, SM, SD, Jn\X, Jn\Y, Jn\B, Jn\SB, Jn\W, Jn\SW, Un\G, U3En\G, U3En\HG, R, ZR, RD, P...
  • Page 357: Combination Of Index Modification

    Combination of index modification This section describes the combination of index modification. Modification order for the device specification and index modification According to the priority order shown below, the device specification (digit specification, bit specification, indirect specification) and index modification can be applied. However, some word devices may not follow the priority order shown below. Order of priority When the device targeted for the device specification When the device targeted for the device specification...
  • Page 358 Change of the index modification range due to switching from 16-bit to 32-bit To change the index modification range for switching from 16-bit to 32-bit, the user must: • Review the index modification block(s) within the program. • To perform the 32-bit index modification specification with ZZ expression, review the range of the index register (Z). Note that the range within the LZ cannot be specified.
  • Page 359: File Register (R/Zr)

    21.9 File Register (R/ZR) This device is a word device for extension. This device is specifically a file register file which exists in the file storage area on the device/label memory. Specification method There are two types of the specification methods for the file register: block switching and serial number methods. Block switching method In this method the number of points of file register being used is specified by being divided in increments of 32K point (R0 to R32767).
  • Page 360: Setting File Registers

    Setting file registers This section describes the settings required to use the file registers. Configuration procedure This section describes the procedure to use the file registers. Set the file register usage with [CPU Parameter]. To use the file register for each program, previously create the device memory which will become the file register file. (...
  • Page 361: Clearing File Registers

    Clearing file registers To clear the file registers, use the following methods ( Page 101 Memory Operation) • Clearing in the program: write 0 into the file register range to be cleared. • Clearing with engineering tool: clear them using engineering tool ( GX Works3 Operating Manual) 21.10 Refresh Data Register (RD) This device is provided for using as a refreshing target of buffer memory on the various devices, such as an intelligent function...
  • Page 362: Nesting (N)

    21.11 Nesting (N) This device is used in the master control instructions (the MC/MCR instruction) and enables the programming of operation conditions in a nesting structure. Specify this device from outside the nesting structure starting with the lowest number (in ascending order from N0 to N14).
  • Page 363: Pointer (P)

    21.12 Pointer (P) This device is used in the jump instructions (the CJ/SCJ/JMP instruction) and/or subroutine program call instructions (such as the CALL instruction). There are two types of pointer: the global pointer and the local pointer. Use the pointer when: •...
  • Page 364: Local Pointer

    Local pointer This is the pointer to be independently used in each program where the same pointer number can be used. This pointer is specified in the following format: # (pointer number) (Example: #P0) ( Page 370 Specification method for the local devices).
  • Page 365: Pointer Setting

    Pointer setting The following menu item is to set pointers. [CPU Parameter]  [Memory/Device Setting]  [Pointer Setting] Window Displayed items Item Description Setting range Default Global Pointer Start Set the start number of the global pointer. P0 and over ...
  • Page 366: Interrupt Factors Of The Interrupt Pointer Numbers

    Interrupt factors of the interrupt pointer numbers The interrupt factors of the interrupt pointer numbers are indicated. Interrupt factor Interrupt pointer number Description Interrupt from module I0 to I15 This is a pointer used for modules which have the interrupt function. Interrupt by the internal timer I28 to I31 This interrupt pointer is used in fixed scan interrupts by the internal timer.
  • Page 367: Network No. Specification Device (J)

    21.14 Network No. Specification Device (J) This device is used when specifying a network number with the Link dedicated instruction. ( MELSEC iQ-R Programming Manual (Module Dedicated Instructions)) 21.15 I/O No. Specification Device (U) This device is used when specifying an I/O number with the intelligent function module dedicated instruction. ( MELSEC iQ-R Programming Manual (Module Dedicated Instructions)) 21.16 SFC Block Device (BL)
  • Page 368: Global Device

    21.18 Global Device This device can be shared by all the programs. All the devices that do not set as local device are handled as global device. 21.19 Local Device This device can be used independently in each program. When creating multiple programs, programming can be completed without being aware of devices used in other programs.
  • Page 369 When local device is used in subroutine program Local devices to be used vary depending on whether SM776 (Local device setting at CALL) is turned on or off. Local index register to be used is also determined according to the SM776 setting. SM776 Local device to be used Uses local devices of the program file from which subroutine program is called.
  • Page 370 • For SM777, the value (on/off) set at the execution of an interrupt program / a fixed scan execution type program / an event execution type program triggered by occurrence of an interrupt is valid. For this reason, when the set value is changed while a program is being executed, the value changed does not become valid until the next time any of these programs is executed.
  • Page 371 Setting method for the local devices Set the range where each device will be used as a local device and also set whether or not it should be used. ■Range setting The range setting for local devices is common to all the programs. Therefore the range for local devices cannot be set for each program.
  • Page 372 Setting whether or not it should be used Whether or not local devices should be used can be set for each program. Since the local device area of program for which "Do not use" has been set is not assured, it can suppress unnecessary consumption of device/label memory. [CPU Parameter] ...
  • Page 373: Indirect Specification

    21.20 Indirect Specification Specify the device using the indirect address of device. Store the indirect address of device to be specified into the device for indirect specification, and write as "@ + Device for indirect specification". (1) The indirect address of D0 is read Indirect into D100, D101.
  • Page 374: Chapter 22 Labels

    LABELS A label is a variable consisting of a specified string used in I/O data or internal processing. Programs can be created without considering the size of devices and buffer memory by using labels. For this reason, a program using labels can be reused easily even in a system having a different module configuration. When labels are used, there are some precautions on programming and functions used.
  • Page 375: Classes

    22.3 Classes The label class indicates from which POU and how a label can be used. Different classes can be selected depending on the type of POU. Global label Class Description Applicable POU Program Function block Function block   ...
  • Page 376: Data Types

    22.4 Data Types The data types of a label are classified according to the bit length, processing method, and value range. There are two data types. • Primitive data type • Generic data type (ANY type) Primitive data type The following table lists the data types included in the primitive data type. Data type Description Value range...
  • Page 377 • The bit data in the word type label can be used by specifying a bit number. • The bit type array label can be used as 16-bit or 32-bit data by specifying the number of digits. For the bit specification and digit specification methods, refer to the following. ...
  • Page 378 Generic data type (ANY type) The generic data type is the data type of the labels which summarize several primitive data types. Generic data types are used when multiple data types are allowed for function and function block arguments and return values.
  • Page 379: Arrays

    22.5 Arrays An array represents a consecutive aggregation of same data type labels as a single name. Primitive data types and structures can be defined as arrays. Array image and setting in engineering tool One-dimensional array (The number of elements is 4.) Two-dimensional array (The number of elements is 5 ×...
  • Page 380 Defining arrays ■Array elements When an array is defined, the number of elements, or the length of array, must be determined. For the range of the number of elements, refer to the following. Page 380 Range of the number of array elements ■Dimension number of multidimensional array Up to three-dimensional array can be defined.
  • Page 381 How to use arrays To use an array, add an index enclosed by '[ ]' after each label name to identify individual labels. An array with two or more dimensions should be represented with indexes delimited by a comma (,) in '[ ]'. bLabel1 [0] bLabel2 [0,3] Label name...
  • Page 382 Range of the number of array elements The maxim number of array elements varies depending on the data type. Data type Setting range 1 to 2147483648 Word [unsigned]/bit string [16 bits] Word [signed] Timer Counter Retentive timer Double word [unsigned]/bit string [32 bits] 1 to 1073741824 Double word [signed] Single-precision real number...
  • Page 383: Structures

    22.6 Structures A structure is a data type containing one or more labels and can be used in all POUs. Members (labels) included in a structure can be defined even when their data types are different. Creating structures To create a structure, first define the structure, and then define members in the structure. Structure Member (label 1) Member (label 2)
  • Page 384 Structure arrays A structure can also be used as an array. Structure label [1] Structure label [2] Structure label [3] Structure label [4] Member (label 1) Member (label 1) Member (label 1) Member (label 1) Member (label 2) Member (label 2) Member (label 2) Member (label 2) Member (label 3)
  • Page 385: Label Access Setting From External Device

    22.7 Label Access Setting from External Device RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • This function cannot be used in the R00CPU, R01CPU, and R02CPU. • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS •...
  • Page 386: Configuration Procedure

    Configuration procedure This section describes the configuration procedure to enable access by specifying the global label from external devices. Operating procedure Set the label in "Global Label "Global Label Setting" window Setting" and select the "Access from External Device" checkbox. Check the capacity of the label communication data.
  • Page 387: Precautions

    22.8 Precautions Functions with restrictions The following functions have restrictions on the use of labels. Item Description CPU parameter • Trigger of an event execution type program Use devices because global labels nor local labels cannot be specified for these •...
  • Page 388 Precautions for creating programs When specifying a label as an operand used in instructions, match the data type of the label with that of the operand. In addition, when specifying a label as an operand used in instructions that control continuous data, specify the data range used in instructions within the data range of the label.
  • Page 389: Chapter 23 Latch Function

    LATCH FUNCTION 23.1 Latch with Battery RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using the Process CPU (redundant mode), refer to the following as well. Page 435 FUNCTIONS • When using the SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS •...
  • Page 390: Applicable Devices And Labels

    Applicable devices and labels This section describes the devices/labels that can be latched. Applicable devices The devices below can be latched. However, local devices cannot. Device Specification method Applicable latch type Internal relay (M) Specify the latch range. Latch (1) or Latch (2) Link relay (B) Specify the latch range.
  • Page 391: Setting Latch On Devices

    Setting latch on devices Multiple latch ranges can be set for a device type. A total of 32 latch ranges between latch (1) and latch (2) can be set. However, the ranges of latch (1) and latch (2) must not overlap. Setting a latch range Set the device to latch, its range, and the latch type.
  • Page 392 Setting the latch interval The user can specify the operation which should be performed at a latch interval ( Page 392 Timing of the latch processing) within the effective range of the latch interval setting *1 The effective range of the latch interval means the range of devices which is enabled on the "The Valid Range of Latch Interval Setting" window.
  • Page 393 For device latching, increasing the device range in the device setting of CPU parameters eliminates the latch processing from the END processing for the devices and enables real-time latching. For example, assume the following configuration for R04CPU: (1) 0K word is specified for the file storage area and 168K words for the device area in "Device/Label Memory Area Capacity Setting", (2) 100K points is specified for the data register (D) on the "Device Setting"...
  • Page 394 ■Timing of the latch processing The timing of the latch processing is determined based on the effective range of the latch interval setting and the operation setting for the specified latch interval ( Page 390 Setting the latch interval) • When set to "Time Setting" Latch processing is started in the END processing executed after the set time.
  • Page 395: Setting Latch On Labels

    Setting latch on labels This section describes latch setting on labels. Operating procedure In the label edit window, specify Label edit window "RETAIN" for label attribute. "Device/Label Memory Area Detailed Setting" window There are two types of latch for labels: latch (1) and latch (2).
  • Page 396: Latch With Battery-Less Option Cassette

    23.2 Latch with Battery-less Option Cassette RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • This function cannot be used in the R00CPU, R01CPU, and R02CPU. Programmable controller CPUs retain the data in each device/label with latch setting without a battery during power failure by inserting a battery-less option cassette to the CPU module.
  • Page 397 Write the set parameter to the CPU module, and then power off and on, or reset the CPU module. When the uninitialized error is displayed, use the engineering tool to initialize the battery-less option cassette. After the initialization, power off and on, or reset the CPU module. [Online] ...
  • Page 398: Precautions

    Precautions This section describes precautions on using the latch with the battery-less option cassette. • When a battery-less option cassette is inserted, the current consumption of the CPU module increases by 0.15A at maximum. • Insert or remove a battery-less option cassette while the programmable controller is powered off. If it is inserted or removed while the programmable controller is powered on, a stop error occurs in the CPU module and data may not be retained.
  • Page 399: Chapter 24 Device/Label Initial Value Settings

    DEVICE/LABEL INITIAL VALUE SETTINGS RnPCPU RnPCPU RnPSFCPU RnPSFCPU RnSFCPU RnSFCPU RnCPU RnENCPU (Process) (Redundant) (Standard) (Safety) (Standard) (Safety) • When using a Process CPU, refer to the following as well. Page 322 LABEL INITIALIZATION FUNCTION • When using a SIL2 Process CPU, refer to the following as well. Page 605 FUNCTIONS •...
  • Page 400: Setting Initial Device/Label Values

    24.1 Setting Initial Device/Label Values This section describes the settings required to use initial device/label values. Setting initial device values This section describes the settings of initial device values. Setting procedure The procedure for using initial device values is as follows. First, the user must create an initial device value file.
  • Page 401: Setting Initial Label Values

    Applicable range of initial device value files The applicable range of initial device value files is as follows. Target device Applicable range Global device Initial device values set up in the initial value file of the global device are used. Buffer memory Local device Initial device values set up in the initial value file of the local device (Program Name.DID) are used.
  • Page 402: Applicable Devices/Labels

    24.2 Applicable Devices/Labels For details on devices/labels to which initial device/label values can be set, refer to the following.  GX Works3 Operating Manual 24.3 Precautions This section describes the precautions when using the initial device/label value setting. • When initial device values or initial label values are overlapped with the latch range, these initial values take precedence over the latch range.
  • Page 403: Chapter 25 Constants

    CONSTANTS This section describes constants. 25.1 Decimal Constant (K) Use this type of constants when specifying decimal data in a program. Specify the decimal constant using K character (e.g. K1234). The specification range depends on the argument data type of the instruction using the decimal constant as shown in the following table: Argument data type of the instruction Specification range for decimal constant...
  • Page 404: Real Constant (E)

    25.3 Real Constant (E) Use this type of constants when specifying a real number in a program. There are two types of real numbers: single-precision real number and double-precision real number. Specify it using Echaracter. (e.g. E1.234). Setting range for real numbers The setting ranges are different between the single-precision real number and double-precision real number.
  • Page 405: Notation Of Constants

    25.5 Notation of Constants This section describes the notation of constants. Type Notation Example Applicable data type Boolean value Set "FALSE" or "TRUE". TRUE, FALSE Add "K" or "H" before "0" or "1". K0, K1, H0, H1 Integral Binary Add "2#" before a binary number. 2#0010, 2#01101010, •...
  • Page 406 Notation of time In the notation of time, add "T#" or "TIME#" at the beginning of the value specified in units of time; d (day), h (hour), m (minute), s (second), and ms (millisecond). The following table lists the effective range for each unit of time. Item Effective range d (day)
  • Page 407: Part 4 When Using The Process Cpu (Redundant Mode)

    PART 4 WHEN USING THE PROCESS CPU (REDUNDANT MODE) This part consists of the following chapters. Please read these chapters when building the redundant system using the Process CPU (redundant mode). Since information same as that of the Process CPU (process mode) is not described in these chapters, refer to Part 1 to Part 3.
  • Page 408: Chapter 26 Basic Concept

    BASIC CONCEPT This system consists of two basic systems that have a CPU module, a power supply module, a network module, or other modules for each of them. Even if an error occurs in one system, control is continued with the other system. A redundant configuration of the systems of main base units is available when redundant function modules are used and Process CPUs are operated in the redundant mode.
  • Page 409: System Switching Between The Control System And Standby System

    26.2 System Switching Between the Control System and Standby System In a redundant system, data link is performed between the redundant function modules connected with tracking cables and data required for operation is transferred (tracking transfer) at every scan from the control system to the standby system. If an error occurs in the control system, the standby system will function as the new control system and continue the control using the data that the system has received.
  • Page 410: Operation Modes Of The Redundant System

    26.5 Operation Modes of the Redundant System A redundant system operates in one of the following two modes. Operation mode Description Backup mode A mode used to normally operate the redundant system. When an error or failure has occurred in the control system, the standby system is switched to the control system to continue the operation.
  • Page 411: Scan Configuration

    26.6 Scan Configuration This section describes scan configurations of the CPU modules in a redundant system. In a redundant system, tracking is performed during the END processing. ( Page 454 Tracking Transfer) For details on other than tracking transfer, refer to Chapter 1. ( Page 38 Scan Configuration) The following figure shows scan configurations of when both systems are started up simultaneously in the backup mode.
  • Page 412: Determination Of Control System/Standby System

    26.7 Determination of Control System/Standby System This section describes how to determine which system is the control system and the other is the standby system. When starting up both systems simultaneously The following describes the method of determining the system types of when both systems are started up simultaneously. How to determine the system types A control system or standby system is determined when both the systems are powered off and on or the CPU module is reset and then ready for tracking communications.
  • Page 413: When Starting Up One System First

    ■When the READY LED of the CPU module in one of the systems is flashing Do not power off the CPU module in the other system. The system may start up without checking the system consistency even when the conditions between the both systems do not match.
  • Page 414 The system waiting for the start-up of the other system When the Process CPU (redundant mode) is started up and tracking communications cannot be established with the other system, the CPU module will start waiting for the start-up of the other system in three seconds. Both of the CTRL LED and SBY LED of the redundant function module turn off because the system of the CPU module is not the control system or standby system yet.
  • Page 415: When One System Is Started Automatically Even Though A Tracking Communication Error Has Occurred

    When one system is started automatically even though a tracking communication error has occurred When the other system is powered off or a tracking cable has an error at a system start, the CPU module waits for the start-up of the other system. The following shows a program example to start up only one of the systems using external signals without waiting for the start-up of the other system.
  • Page 416 ■I/O signals The following table lists the details on the I/O signals. Device No. Signal name Control System Start-up Setting (Input (X)) With the on delay timer wired externally, X20 turns on and the CPU module starts as the control system after a certain time. Starting up (other system) Control system (other system) Starting up (own system)
  • Page 417 ■CPU parameter (redundant settings) Set the CPU parameter in "Redundant System Settings" as follows. (1) Set "Not Set" in "Other system Start-up Timeout Setting". (2) Set "Enable" in "Control System Start-up Setting (Input (X))". (3) Set "X20" in "Input (X)". (4) Set "Detailed setting"...
  • Page 418 Program example The following shows a program example and the overview of the operation. ■Execution determination of start-up processing (0) Set an interlock signal (M0) to prevent the above program from being executed if the operating status of the CPU module is changed from STOP to RUN during operation.
  • Page 419 • If both systems start up successfully, a stop error does not occur because an initial execution type program is not executed on the other system. • If a stop error has occurred in this program, the possible cause is a tracking cables failure. Check the connection of tracking cables and power off and on or reset the CPU module on the system in which the stop error has occurred.
  • Page 420: When Starting Up The Previous Control System As The Control System

    When starting up the previous control system as the control system In a redundant system, the system A is always specified as the control system when both systems are started up simultaneously. Even though both systems are temporarily powered off due to a power failure or other causes while the system B is operating as the control system, the system A is started up as the control system when both systems are powered on again.
  • Page 421 Operation example Both systems are temporarily powered System A System B off due to a power failure or other Standby system → Power-off Control system → Power-off causes while the system B is operating as the control system. The system A is started as the control System A System B system when both systems are...
  • Page 422: State Transition Of The Redundant System

    26.8 State Transition of the Redundant System The following figure shows the state transition due to the operation mode change and system switching for the redundant system after start-up. Both systems: Powered off (1) System A: Off System B: Off Power on the system B.
  • Page 423 MEMO 26 BASIC CONCEPT 26.8 State Transition of the Redundant System...
  • Page 424: Chapter 27 Procedure For Starting Up A Redundant System

    PROCEDURE FOR STARTING UP A REDUNDANT SYSTEM This chapter describes the procedures for starting up a redundant system starting from the start-up procedure of CPU modules to execution of programs. 27.1 Overview The following table lists two procedures for starting up a redundant system. Start-up procedure Description Starting up both systems at a time...
  • Page 425 Setting parameters Set system parameters, CPU parameters, and module parameters. ( MELSEC iQ-R CPU Module User's Manual (Startup)) • To use the functions that require an SD memory card, set memory card parameters. • To mount an intelligent function module, set intelligent function module parameters. Users can set system parameters by reading the actual system configuration to the module configuration of the engineering tool.
  • Page 426: Starting Up The Systems One By One

    Monitoring the Program Check that the program is normally running on the engineering tool. ( Page 434 Monitoring the Program) Starting up the systems one by one To debug a program with only one system before operation, start up the control system. To start up the control system for a purpose other than debugging a program, start up the standby system to build a redundant system.
  • Page 427 Writing the system A/B setting Set the system A or B with the engineering tool. ( Page 431 System A/B Settings) Writing data to the programmable controller Write the set parameters and created programs to the CPU module with the engineering tool. ( Page 433 Writing Data to the Programmable Controller) Resetting the CPU module Restart the control system with either of the following methods.
  • Page 428 Starting up the standby system Start up the standby system while the control system keeps operating. Follow step 1 to 6 in the start-up procedure for the control system to start up the standby system. ( Page 424 Starting up the control system) Check if the model of the module which is mounted on the base unit and insertion of the extended SRAM cassette or SD memory card are the same between the control system and standby system before the starting...
  • Page 429: Precautions On Starting Up The System When The Data Logging Function Is Used

    Clearing errors When the ERROR LED of the CPU module of the control system is on, clear the error with the engineering tool. ( Page 133 Error Clear) When "Watching Standby System Setting" of the CPU parameter has been set to "Disable" in the procedure for starting up the control system, the ERROR LED may be off.
  • Page 430: Wiring

    27.2 Wiring Wiring the redundant function modules This section describes how to wire the redundant function modules. Wiring method Connect the tracking cables from the OUT connector of a redundant function module to the IN connector of the other redundant function module. For the specifications of the tracking cables connected to redundant function modules, refer to the following.
  • Page 431: Wiring To The Power Supply Modules In A Redundant System

    Wiring to the power supply modules in a redundant system This section describes the wiring to the power supply modules. The terminal block of each power supply module has a screw size of M4. Wire cables to the terminal block with the applicable solderless terminal RAV1.25-4 or RAV2-4.
  • Page 432: Creating A Project

    27.3 Creating a Project Start the engineering tool and create a project. [Project]  [New] Select the Process CPU to be used for "Type". Select "Redundant" for "Mode". Select a programming language to be used for "Programming Language" and click the [OK] button. 27.4 Connecting a Personal Computer and a CPU Module...
  • Page 433: System A/B Settings

    27.5 System A/B Settings Set the system A or B with the engineering tool and write the system settings to the CPU module. [Online]  [Redundant PLC Operation]  [System A/B Setting] Configuration procedure Set the CPU module to the STOP state. Select the setting to be written to own on the "System A/ B Setting"...
  • Page 434 Checking method Check the LED of each redundant function module to check the system status. Setting on the engineering tool LED of the redundant function module System A System B When the system setting is switched from system A to B When the system setting is switched to the system B with the engineering tool, The SYS B LED will flash.
  • Page 435: Writing Data To The Programmable Controller

    27.6 Writing Data to the Programmable Controller Write the set parameters and created programs to the CPU module. [Online]  [Write to PLC] Operating procedure Select system parameters, CPU parameters, module parameters, and program files on the "Online Data Operation" window. When FBs are used, select the corresponding FB/FUN files.
  • Page 436: Monitoring The Program

    27.7 Monitoring the Program Check the operation of a program on the engineering tool. Change the connection destination with the engineering tool and check the operating status of the system A or B. [Online]  [Current Connection Destination] Select a system in "Specify Redundant CPU" on the "Specify Connection Destination Connection"...
  • Page 437: Chapter 28 Functions

    FUNCTIONS This chapter describes the redundant functions and the functions that are different (modified or restricted) from those of the process mode. Functions not described in this chapter are the same as those described in PART 2. For the availability of the functions in the redundant system, refer to the following. ...
  • Page 438 Function Description Reference Functions different Constant scan • In the standby system, when the system is powered off, a Page 488 Constant Scan (modified or hardware failure has occurred, a tracking cable has a restricted) from failure, or the system is switched to the separate mode, a those of the process continuation error may occur due to the excess of constant mode...
  • Page 439 Function Description Reference  Functions different Remote operation Using a contact When the backup mode setting is enabled in the CPU (modified or parameter, both systems may be recognized as being restricted) from mismatched in the system consistency check even if the those of the process remote operation is simultaneously performed on the systems mode...
  • Page 440: Operation Mode Change

    28.1 Operation Mode Change This function switches the operation mode of the redundant system between the backup mode for normal operation and the separate mode for system maintenance while it is running. Switching procedure Switch the operation mode of the control system CPU module in the "Redundant Operation" window of the engineering tool. Mode switching to the separate mode The following describes the switching procedure for the separate mode.
  • Page 441 Mode switching to the backup mode The operation mode can be switched to the backup mode only in the communication path of when the operation mode was switched to the separate mode. The following describes the switching procedure for the backup mode. Set the CPU modules of the control system and standby system to have the same file configuration and operating status.
  • Page 442: Precautions

    Precautions The following describes the precautions for switching the operation mode. Switching of the operation mode in the RUN-transition instruction waiting state When the operation mode is switched to the separate mode, the standby system CPU module is set to the RUN-transition instruction waiting state (same as the STOP state).
  • Page 443: System Switching

    28.2 System Switching This function switches the systems between the control system and the standby system to continue operation of the redundant system when a failure or an error occurs in the control system. The systems can also be switched manually by a user for debug or maintenance.
  • Page 444 ■System switching due to power-off, reset, or hardware failure of the CPU module In a redundant system, the standby system CPU module monitors the control system status. If the control system is unable to control the redundant system in the following cases, the standby system CPU module is switched to the control system CPU module and the new control system CPU continues the control over the redundant system.
  • Page 445 ■System switching request from a network module A control system network module requests the CPU module for system switching when a communication error or disconnection is detected. When the control system CPU module receives the system switching request from the network module, the systems are switched after the END processing.
  • Page 446 Manual system switching The user can manually switch the systems between the control system and the standby system. • After turning on SM1646 (System switching by a user), perform the manual system switching in the control system. • When the manual system switching is disabled by the DCONTSW instruction, execute the ECONTSW instruction.
  • Page 447 ■System switching request from the engineering tool When the engineering tool sends a system switching request to the control system CPU module, the systems are switched after the END processing. Switch the systems from the "Redundant Operation" window of the engineering tool. [Online] ...
  • Page 448: Operation At System Switching

    Operation at system switching The following table shows the operations of the CPU modules of when the control system and the standby system are switched. These operations are for when both systems are operating and the operating statuses of the CPU modules are the same. Item New control system CPU module New standby system CPU module...
  • Page 449: Execution Availability Of System Switching

    Execution availability of system switching The following tables show the execution availability of system switching in each operation mode. In backup mode : Switching possible, : Switching not possible Redundant system status Execution availability of system switching Automatic system switching Manual system switching Power-off or Hardware...
  • Page 450 In separate mode : Switching possible, : Switching not possible Redundant system status Execution availability of system switching Automatic system switching Manual system switching Power-off, reset, Stop error of the System System System hardware failure CPU module switching switching switching of the CPU request from a request by the...
  • Page 451: Check Method Of System Switching Information

    Check method of system switching information The following table lists the check methods of system switching information at system switching (automatic system switching and manual system switching). Check method Information Reference Event history System switching result, system switching cause, and control system/ Page 449 Event history standby system transition Special relay (SM)/Special register (SD)
  • Page 452 ■Special register The following table shows the special register for system switching and the storage status of the CPU modules in the control system and standby system. : Stored, : Not stored Name Storage status at system switching number New control system New standby system CPU module CPU module...
  • Page 453: Precautions

    Precautions The following describes the precautions on system switching. Item Description Reference Error in the redundant function module • When an error has been detected on the redundant function module, the control Page 452 Error in the system and standby system continue operating without being switched. redundant function •...
  • Page 454 Error in the redundant function module • When an error has been detected on a redundant function module, a continuation error occurs on the CPU module, and the control system and standby system continue operating without being switched. Check the error code, and perform online module change if the redundant function module has failed.
  • Page 455 When the cable for the network module is disconnected If a network module cable is disconnected, the systems may not be switched depending on the timing of error detection on the control system and the timing on the standby system. Control system Standby system Other station systems...
  • Page 456: Tracking Transfer

    28.3 Tracking Transfer This function transfers the control data from the control system to the standby system and maintains the consistency of the data in the two systems to continue operation of the redundant system when a failure or an error occurs in the control system. Control system Standby system Sending tracking data...
  • Page 457: Tracking Data

    Tracking data The following table lists the tracking data that can be transferred from the control system to the standby system. Item Operation mode Reference Backup mode Separate mode Device data User device   Page 456 Devices that can be specified ...
  • Page 458 Devices that can be specified The following table lists the data that can be specified for tracking transfer. : Specifiable, : Not specifiable, : Not settable as a local device Classification Device name Transfer Global device Local device   User device Input (X) Output (Y)
  • Page 459 Auto tracking data The following tables list the data that is automatically transferred by the system regardless of parameter settings of tracking transfer. ■Special relay The following table lists the special relay areas that are automatically transferred by the system. SM number Name SM752...
  • Page 460: Tracking Block And Tracking Trigger

    Tracking block and tracking trigger The devices or labels of a specified range is transferred by setting a range of devices or labels to be transferred for each tracking block and turning on the tracking trigger which is assigned for each tracking block. Tracking block A tracking block is used for setting a tracking transfer range of global devices and whether or not to transfer local devices/ global labels/local labels.
  • Page 461: Setting Procedure For Tracking Transfer

    Tracking trigger By turning on a tracking trigger, the devices or labels of a range specified in the corresponding tracking block are transferred. Bits used as tracking triggers change depending on the CPU parameter setting, as shown below. ■When "Tracking Device/Label Setting" is set to "Transfer collectively" The bit 0 of SD1667 is used as a tracking trigger.
  • Page 462: Tracking Transfer Setting

    Tracking transfer setting The following describes the CPU parameters related to tracking transfer. [CPU Parameter]  [Redundant System Settings]  [Tracking Setting] Window Displayed items Item Description Setting range Default Signal Flow Memory Set whether to transfer the signal flow memory or not. ( Page 461 •...
  • Page 463 Tracking transfer setting for the signal flow memory By transferring the signal flow memory, operations of rising/falling instructions in the old control system are taken over to the new control system even after system switching. "Signal Flow Memory Tracking Setting" is set to "Transfer" by default. Transferring the signal flow memory is recommended.
  • Page 464 To transfer the annunciator (F), link special relay (SB), link special register (SW), file register (ZR), or refresh data register (RD), specify the corresponding data in "Device/Label Detailed Setting" of "Tracking Device/ Label Setting". ( Page 462 Detailed setting) After setting "Transfer collectively", perform a test operation in the system design phase and check if the size of tracking data is 1M words or smaller.
  • Page 465 ■Global device setting Set devices and their ranges for each tracking block No. [CPU Parameter]  [Redundant System Settings]  [Tracking Setting]  [Device/Label Detailed Setting]  [Global Device Setting] Window Displayed items Item Description Device Setting Reflection Reflects the device setting of "Device/Label Memory Area Setting" in the CPU parameter. (Except for the annunciator (F), link special relay (SB), and link special register (SW)) Tracking Block No.
  • Page 466: Tracking Mode

    Tracking mode The following two modes are available for tracking. Item Description Synchronous tracking Tracking data is always transferred to the standby system once every scan of the control system. During a tracking transfer from the mode control system to the standby system, the next scan does not start in the control system. Asynchronous tracking When a tracking transfer from the control system is to be performed and the previous tracking is still in progress, the tracking mode...
  • Page 467 Effect on the scan time The following describes the effect on the scan time depending on the tracking mode. For the calculation method for an increase in the scan time due to tracking transfer, refer to the following. Page 926 Increase in the scan time due to tracking transfer ■Synchronous tracking mode In the synchronous tracking mode, tracking transfer is always performed once every scan during the END processing.
  • Page 468 ■Asynchronous tracking mode In the asynchronous tracking mode, the control system starts the next scan without waiting for notifications of data reception/ reflection completion from the standby system. Unlike the synchronous tracking mode, the scan time is not affected by waiting time for data reception/reflection completion. When the standby system does not receive the tracking data from the control system, the standby system starts the next scan.
  • Page 469: Precautions

    Precautions Operation at power-on When the RUN/STOP/RESET switch of the CPU module of each system is set to the RUN position and both systems are powered on, the control system CPU module starts in the STOP state and switched to the RUN state after reflecting the tracking data is completed in the standby system CPU module.
  • Page 470: Memory Copy From Control System To Standby System

    When data is different between the control system and the standby system Store the same program, FB file, CPU parameter, and global label setting file in the control system CPU module and the standby system CPU module for tracking transfer. ( Page 468 Memory Copy from Control System to Standby System) If there is any difference, global devices, system data, and PID control instruction information are transferred.
  • Page 471 Files copied by the memory copy function The following table lists the files to be copied by the memory copy function. : Memory copy possible, : Memory copy not possible, : Storage not possible File type Copy CPU built-in memory SD memory card Program memory Device/label Data memory...
  • Page 472: Automatic Memory Copy

    Execution method of memory copy The following methods are available for memory copy. Item Description Application Automatic memory copy Automatically executes the memory copy by the system. Executing the memory copy without using an engineering CPU parameter settings are required in advance. tool or external devices (such as a GOT) Memory copy with the engineering tool Executes the memory copy with an online operation of...
  • Page 473: Memory Copy With The Engineering Tool

    • When the control system power supply and the standby system power supply are simultaneously turned on, the automatic memory copy is not executed. • The standby system CPU module does not operate in boot operation using an SD memory card, but operates based on the files copied by the automatic memory copy function.
  • Page 474: Memory Copy With The Special Relay And Special Register

    Memory copy with the special relay and special register The following describes the execution procedure of memory copy using the special relay and special register. Special relay to be used The following table lists the special relay areas used in memory copy. SM number Name SM1653...
  • Page 475 Operation of the special relay and special register The following chart shows the operation of the special relay and special register in memory copy. SM1653 Memory copy start SM1654 Memory copy being executed SM1655 Memory copy completion SD1653 Memory copy destination I/O number 03D1H SD1654 Memory copy status...
  • Page 476: Precautions

    Precautions The following describes precautions on the memory copy function. Automatic memory initialization If there are differences in the data memory or an SD memory card, the "$MELPRJ$" folder is deleted from the data memory or SD memory card, and the memory copy is executed. If there are differences in the program memory or device/label memory, the memory is initialized, and the memory copy is executed.
  • Page 477: System Consistency Check

    28.5 System Consistency Check This function checks whether the system configurations and files in the CPU modules are the same between the control system and the standby system when the redundant system is in backup mode. The following table lists the items to be checked in the system consistency check. Item Description Reference...
  • Page 478 Execution timing The following table shows the execution timing of the system consistency check. Item Execution timing File • When both systems are simultaneously turned on or reset • When one system is turned on or reset while waiting for the start-up of the other system •...
  • Page 479: File

    File Whether both systems have the same files is checked. The following table shows whether or not to perform the check on each file type. : Checked, : Not checked, : Storage not possible File type Check target memory Built-in memory of CPU SD memory card module ...
  • Page 480: Operating Status

    Operating status Whether the CPU modules of the control system and standby system are in the same operating status (RUN/STOP/PAUSE) is checked. Operation of when a mismatch is detected If a mismatch between the operating statuses is detected, a continuation error occurs on the standby system CPU module. The BACKUP LEDs of the redundant function modules of the control system and standby system flash because a cause of the system switching failure has occurred.
  • Page 481: Program Execution In Both Systems

    Operation of when a mismatch is detected If a mismatch of the installation of the SD memory cards or the status of the write protect switch is detected, a stop error occurs on the standby system CPU module. If a mismatch between the mounting statuses of the main base units is detected when the CPU modules of both systems are simultaneously turned on or reset, a stop error occurs on the control system CPU module as well.
  • Page 482 Setting of program execution in both systems Configure the setting for each program to be executed on both systems. [CPU Parameter]  [Program Setting] Window Displayed items Item Description Setting range Default Both Systems Program Set whether to execute a program only on the control system CPU module or on •...
  • Page 483: Operation Of A Program Executed In Both Systems

    Operation of a program executed in both systems The following describes the operation of a program executed in both systems. Control system/ Backup mode Separate mode Standby system Control system A program is executed according to its execution type. A program is executed according to its execution type regardless of the setting in "Both Systems Program Executions Setting".
  • Page 484 Operation at system switching The operation at system switching is different for a program executed in both systems. The following table shows the operation at system switching. Item New control system CPU module New standby system CPU module Program execution Initial execution When an initial execution type program has not been When an initial execution type program has not been...
  • Page 485: Precautions

    Precautions The following lists the precautions for using a program executed in both systems. Item Description Reference Program execution time Set a program execution time of the standby system to be shorter than that of the Page 483 Program control system. execution time ...
  • Page 486 Tracking transfer • Do not set global devices used in a program executed in both systems as a tracking transfer target. Due to tracking transfer, the standby system data is overwritten with that of the control system, and the standby system program may operate in an unintended way.
  • Page 487: Redundant System Operation Setting

    28.7 Redundant System Operation Setting Set the redundant system operation in the redundant system settings of the CPU parameter. [CPU Parameter]  [Redundant System Settings] Window Displayed items Item Description Setting range Default Watching Standby System Setting Set this item not to detect continuation errors when: •...
  • Page 488: Standby System Output Setting

    Standby system output setting Output timing When "Standby System Output Setting" has been set to "Enable", the output timing from the standby system in backup mode is at the completion of the END processing or depends on the refresh group setting or refresh settings of each module. ( Page 65 Group setting for refresh) Therefore, when a control system execution program is set in the refresh group setting, the I/O refresh is not performed while the module is running because the program is not executed in the standby system.
  • Page 489: Redundant Function Module Communication Test

    28.8 Redundant Function Module Communication Test The hardware of the redundant function module is checked for an error when its communication is unstable. The following table shows the test items included in the module communication test. Test item Description Internal selfloopback test Checks whether the communication function of the redundant function module normally operates.
  • Page 490: Constant Scan

    28.9 Constant Scan The following describes the precautions for setting the constant scan in the redundant system. Increase in scan time In the standby system, when the CPU module is powered off, a hardware failure has occurred, or a tracking cable has a failure, the scan time will increase in the control system.
  • Page 491: Online Change

    28.10 Online Change When the online change (ladder block) is performed on the CPU module in one system in backup mode, the change is also reflected on the CPU module in the other system. In separate mode, only the ladder block of the CPU module in the system specified in the transfer setup of the engineering tool is changed.
  • Page 492: Ras Function

    28.11 RAS Function Clearing errors on the standby system CPU module from the control system CPU module Errors on the standby system can be cleared from the control system CPU module by using SM1679 (Error reset (the other system)) in programs or external devices. Error clearing procedure Use SM1679 to clear errors.
  • Page 493: Remote Operation

    28.12 Remote Operation In a redundant system, the operation target of remote operations (with the engineering tool) depends on the operation mode and method. Operation mode Remote operation Remote RUN, remote STOP, remote PAUSE Remote RESET Backup mode The CPU module operating status of a system specified in the The CPU modules of both systems can be reset by performing transfer setup of the engineering tool or both systems can be the remote RESET operation on the control system CPU...
  • Page 494: Remote Reset

    Remote RESET The following describes the remote RESET operation in a redundant system. In backup mode The CPU modules of both systems can be reset by performing the remote RESET operation on the control system CPU module. Only the standby system CPU module can be reset by performing the remote RESET operation on the standby system CPU module.
  • Page 495: Boot Operation

    28.13 Boot Operation This section describes precautions on using the boot operation in the redundant system. Boot operation at start-up of the redundant system Use the boot operation only to simultaneously start up both systems. Attach SD memory cards that have boot setting data to both systems. Simultaneously turn on or reset both systems and perform the boot operation for them.
  • Page 496: External Input/Output Forced On/Off Function

    28.14 External Input/Output Forced On/Off Function Forced on/off is reflected to the input/output devices of both systems and external outputs by registering or canceling forced on/off for the control system. (Forced on/off is reflected to both systems without setting tracking transfer setting in the CPU parameters.) Ô...
  • Page 497 Reflection to external outputs of the standby system The forced on/off is reflected to output devices of the standby system regardless of the operation mode and settings. However, for external outputs of the standby system, the reflection is as follows depending on the operation mode and the output setting of the standby system.
  • Page 498 Forced on/off timing The following table lists the timing to reflect forced on/off registration information to the input/output devices or external outputs. Input/output for which forced on/off Reflection timing for the input devices Reflection timing for the output devices or can be set external outputs Input/output of the modules mounted on the...
  • Page 499 Behavior of forced on/off This section describes the behavior of forced on/off in the following cases. ■At operation mode change Even if the operation mode has been changed (backup mode  separate mode, or separate mode  backup mode), the forced on/off registration information before the change remains.
  • Page 500: Data Logging Function

    28.15 Data Logging Function In a redundant system, the data logging function collects data only in the control system regardless of the operation mode. For details on CPU Module Logging Configuration Tool used for the data logging function in a redundant system, refer to the following.
  • Page 501: Led Status

    Data logging states at system switching The following table lists the data logging states that change at system switching. ■When the control system is switched to the standby system Before system switching (old control system) After system switching (new standby system) Waiting Start Not Collected Standby system start waiting Pause...
  • Page 502: Switching To A Storage File

    Switching to a storage file After system switching, the file name in the old control system is not taken over to the new control system. (A number added to the file name is not a serial number.) An identifier added to the end of the file name indicates whether the systems are switched or not. Identifier Description *1*2...
  • Page 503: Slmp Communication

    28.16 SLMP Communication The following describes the precautions on SLMP communications. System switching There are the following notes when the system IP address matching function is not used. ■Re-setting of the connection destination When the relay CPU module is in the communication-disabled state (power-off, reset, or tracking cable disconnection) at system switching, the connection destination needs to be set again for SLMP communications.
  • Page 504: Chapter 29 Precautions On Programming

    PRECAUTIONS ON PROGRAMMING This chapter describes the precautions on programming for a redundant system. 29.1 Instructions Not Available in Redundant System This section describes the instructions not available in a redundant system. Instructions that cause stop errors Do not use the following instructions in backup mode. Doing so causes an error when the operating status of the CPU module is changed from STOP to RUN.
  • Page 505: Instructions That Need To Be Executed Again In A New Control System

    Instructions that need to be executed again in a new control system For an instruction that requires several scans for completing the processing, the instruction will be continuously executed when the system switching is performed during execution of the instruction. When a completion device has been used in an execution program of the control system, the completion device will not turn on even though the instruction is completed after the system switching from the control system to the standby system.
  • Page 506 Re-execution of instruction when systems are switched during instruction execution When the system switching is performed while an instruction that requires several scans is being executed, the instruction can be executed again in the new control system after the system switching by using such as the following programs. ■REMFR instruction When the system switching is performed while the instruction is being executed (M201 = ON), SM1643 (ON only in one scan after system switching (standby to control)) will turn on for one scan in the new control system and the REMFR instruction will...
  • Page 507 ■REMTO instruction When the system switching is performed while the instruction is being executed (M101 = ON), SM1643 (ON only in one scan after system switching (standby to control)) will turn on for one scan in the new control system and the REMTO instruction will be executed again on the station number 10 of the network number 1.
  • Page 508: Instructions Whose Operations Vary Depending On Tracking Of The Signal Flow Memory

    Instructions whose operations vary depending on tracking of the signal flow memory The following describes the instructions whose operations after the system switching vary depending on whether the signal flow memory is tracked or not in backup mode. The operations vary when one of the following instructions is executed among program organization units that have the signal flow memory, memory to which tracking can be performed.
  • Page 509 ■When the signal flow memory is tracked When the system switching is performed, the execution condition of the SCJ instruction turns on while the signal flow memory remains off. In the new control system, the processing jumps to the pointer specified by the SCJ instruction in the second scan.
  • Page 510: Instructions That Affect The Status Of Another Instruction When Executed

    Instructions that affect the status of another instruction when executed When one of the following instructions is executed and the status of another instruction changes, the new status will not be tracked to the other system. When the system switching is performed during execution of an instruction, execute the instruction again as required.
  • Page 511: Precautions For Using The Com Or Zcom Instruction

    Precautions for using the COM or ZCOM instruction When the network module link refresh is performed by using the COM or ZCOM instruction, output from the remote I/O station may change after system switching. To prevent this, do not perform the network module link refresh with the COM or ZCOM instruction.
  • Page 512: Interrupt From Modules

    29.2 Interrupt from Modules The following describes the precautions for interrupts from modules. System switching in backup mode When the old control system is switched to the new standby system The old control system retains the interrupt factors that have occurred even after the system is switched to the new standby system by system switching before execution of an interrupt program.
  • Page 513: When The Operation Mode Is Switched To The Backup Mode

    When the operation mode is switched to the backup mode For the control system When the interrupt programs of the interrupt factors before switching to the backup mode have not been executed yet, the control system will execute the programs that the system has retained in the separate mode. For the standby system When the interrupt programs of the interrupt factors before switching to the backup mode have not been executed yet, the standby system will retain the interrupt factors that the system has retained in the separate mode.
  • Page 514: Precautions On Timers And Timer Function Blocks

    29.4 Precautions on Timers and Timer Function Blocks The following describes the precautions on timers and timer function blocks at system switching. Current values at system switching For the timer (T), retentive timer (ST), and a timer function block TIMER__M, the current values of the timers in the first scan of the CPU module of the new control system will not be updated after system switching.
  • Page 515: Precautions On Access To Intelligent Function Module Or External Devices

    29.5 Precautions on Access to Intelligent Function Module or External Devices Depending on the timing of system switching cause to be caused, such as power-off, tracking processing is suspended and device/label data may not be applied to the CPU module in the new control system after the system switching. Consequently, output data may differ from device/label data of the CPU module of the new control system.
  • Page 516 When output is returned to external input External input (X10) Output (Y10) In the following program, turning on M0 turns on the output (Y10) and turning on M10 turns off the output (Y10). [Without measures] [With measures] (2) PLS M1 delays SET Y10 by one scan. (9) PLS M11 delays RST Y10 by one scan.
  • Page 517: Precautions On Writing Data From Got Or External Devices

    29.6 Precautions on Writing Data from GOT or External Devices When data is written from the GOT or external devices, the tracking data may not be applied to the CPU module of the new control system depending on the timing of system switching cause to be caused, such as power-off. Consequently, data that is written from the GOT or external devices before system switching may be lost.
  • Page 518: Chapter 30 Maintenance And Inspection For A Redundant System

    MAINTENANCE AND INSPECTION FOR A REDUNDANT SYSTEM This chapter describes the maintenance and inspection for a redundant system. 30.1 Module Replacement in the Redundant System The following describes the methods of replacing modules in a redundant system while the system is operating. •...
  • Page 519: Replacing A Cpu Module

    Replacing a CPU module The following describes the procedure for replacing the CPU module. The replacement procedure differs depending on whether the automatic memory copy function is enabled or disabled. ( Page 470 Automatic memory copy) When the automatic memory copy function is enabled Check the operation mode.
  • Page 520 When the automatic memory copy function is disabled Check the system of the replacement target CPU module. Check the CTRL LED and SBY LED of the redundant function module in the system of the replacement target CPU module for the following. The target module is in the standby system in this case. •...
  • Page 521: Replacing A Power Supply Module

    Replacing a power supply module The following describes the procedure for replacing the power supply module. Check the system of the replacement target power supply module. Check the CTRL LED and SBY LED of the redundant function module in the system of the replacement target module for the following.
  • Page 522: Replacing A Redundant Function Module

    Replacing a redundant function module The following describes the procedure for replacing the redundant function module. Check the system of the replacement target power supply module. Check the CTRL LED and SBY LED of the redundant function module in the system of the replacement target module for the following.
  • Page 523: Replacing A Network Module

    Replacing a network module The following describes the procedure for replacing the network module. Check the system of the replacement target power supply module. Check the CTRL LED and SBY LED of the redundant function module in the system of the replacement target module for the following.
  • Page 524 MEMO 30 MAINTENANCE AND INSPECTION FOR A REDUNDANT SYSTEM 30.1 Module Replacement in the Redundant System...
  • Page 525: Part 5 When Using The Safety Cpu

    PART 5 WHEN USING THE SAFETY CPU This part consists of the following chapters. Please read these chapters when using the Safety CPU. Since information same as that of the standard CPU is not described in these chapters, refer to Part 1 to Part 3. 31 RUNNING A SAFETY PROGRAM 32 MEMORY SPECIFICATIONS 33 FUNCTIONS...
  • Page 526: Chapter 31 Running A Safety Program

    RUNNING A SAFETY PROGRAM This section describes how to execute a safety program. Information not described in this chapter is same as that of the standard CPU. ( Page 38 RUNNING A PROGRAM to  Page 92 MEMORY CONFIGURATION OF THE CPU MODULE) For details on the setting method (registration procedure) of safety programs, refer to the following.
  • Page 527: Safety Program

    31.2 Safety Program Safety programs are executed at every safety cycle. Safety cycle processing is performed in the following order: safety input (refresh), safety program, and safety output (refresh). ( Page 527 Safety Cycle Time) Standard programs (+ END processing) are executed within the remaining time of the safety cycle time after safety programs are executed.
  • Page 528 Safety program execution type The standard program and safety program execution types are as follows. Program Execution type Standard program • Initial • Scan • Fixed scan • Event • Standby Safety program Fixed scan Safety programs are executed as a fixed scan execution type program. However, safety programs perform safety control, and therefore operation differs from standard fixed scan execution type programs in the following ways.
  • Page 529: Safety Cycle Time

    31.3 Safety Cycle Time A safety cycle time is a timing for executing safety programs and performing safety input/output processing. Setting method Set a safety cycle time in the CPU parameter. [CPU parameter]  [Safety Function Setting] Window Displayed items Item Description Setting range...
  • Page 530: Safety Cpu Operating Status

    31.4 Safety CPU Operating Status The following is a list of Safety CPU operating statuses. • RUN state • STOP state • PAUSE state Operation processing based on safety CPU operating status Operation processing based on the Safety CPU operating status is the same as that of the standard CPU. ( Page 87 Operation Processing by Operating Status) Safety communications processing based on safety CPU operating status Safety communications processing based on the Safety CPU operating status is as follows.
  • Page 531: Chapter 32 Memory Specifications

    MEMORY SPECIFICATIONS This chapter describes the memory specifications of the Safety CPU. Information not described in this chapter is same as that of the standard CPU. ( Page 92 MEMORY CONFIGURATION OF THE CPU MODULE) 32.1 Memory Configuration Specifications of the device/label memory differ from the standard CPU in the memory configuration of the Safety CPU. Device/label memory In addition to standard devices and standard labels, the data such as safety devices and safety labels are allocated to each data area of the device/label memory.
  • Page 532: File Size Unit In Memory

    Safety devices and safety labels cannot be latched, and therefore there is no latch area for safety devices and safety labels. 32.2 File Size Unit in Memory The following table lists the unit of the file size (cluster size) of the Safety CPU memory. Safety CPU File size unit Program memory...
  • Page 533: Files

    32.4 Files This section lists the files used by the Safety CPU. File types and storage memory The following table summarizes the types of files stored in the Safety CPU and storage memory. : Required, : Can be stored, : Cannot be stored File type CPU built-in memory SD memory...
  • Page 534: File Operation Available

    File operation available The following lists file operations which are available for each file type. In TEST MODE The following lists file operations which are available for each file type in TEST MODE. : Available, : Not available, : N/A File type Operation using engineering tool Operation with SLMP and FTP...
  • Page 535 In SAFETY MODE The following lists file operations which are available for each file type in SAFETY MODE. : Available, : Not available, : N/A File type Operation using engineering tool Operation with SLMP and FTP Operation with server function instructions in standard programs Write...
  • Page 536: File Size

    File size The following table lists the size of files that can be stored in the Safety CPU. File type File size Standard program Approx. 4248 bytes minimum (only END instruction + 500 steps reserved for online program change) Standard FB file Approx.
  • Page 537: Chapter 33 Functions

    FUNCTIONS This chapter describes the functions added to the Safety CPU and the functions different (modified or restricted) from the standard CPU. Functions not described in this chapter are the same as those described in PART 2. For the availability of Safety CPU functions, refer to the following. ...
  • Page 538 Function Description Reference Function different Interrupt function Interrupt period The interrupt pointer (I) cannot be used in safety programs. MELSEC iQ-R CPU (modified or setting Also, the following cannot be used in standard programs. Module User's Manual restricted) from the •...
  • Page 539: Safety Operation Mode

    Function Description Reference Function different PID control function The PID control instructions cannot be used in safety MELSEC iQ-R (modified or programs. Programming Manual restricted) from the (CPU Module standard CPU Instructions, Standard Functions/Function Blocks) Multiple CPU Data The Safety CPU supports only data communications using ...
  • Page 540: Switching The Safety Operation Mode

    Switching the safety operation mode This section describes how to switch the safety operation mode. Safety operation mode transition timing The timing at which safety operation mode switches is shown below. Safety operation mode switching direction Safety operation mode switch timing TEST MODE ...
  • Page 541 Safety operation mode state transition The Safety CPU retains the safety operation mode even in the event of a power failure, and therefore the current safety operation mode state will remain unchanged even if the CPU module is powered off and on or is reset. Safety function modules do not retain the safety operation mode in the event of a power failure, and the safety operation mode will be the same as that of the Safety CPU when the CPU module is powered off and on or is reset.
  • Page 542: Operations Restricted In Safety Mode

    Safety operation mode switching conditions The conditions under which the safety operation mode can be changed are shown below. Safety operation mode Condition switching direction TEST MODE  SAFETY MODE The user who is making the switch has "Developers" access level or higher, and is currently logged on. The safety operation mode is currently set to the TEST MODE.
  • Page 543: Continuous Run Prevention In Test Mode

    33.2 Continuous RUN Prevention in TEST MODE This function prevents the Safety CPU from running continuously for a long time in TEST MODE. When the continuous RUN time has exceeded the allowed time, a continuation error occurs. Measuring the continuous RUN time in TEST MODE When the Safety CPU enters RUN state in TEST MODE, measurement of RUN time starts.
  • Page 544: Safety Diagnostic Function

    33.3 Safety Diagnostic Function The following lists self-diagnostic functions specific to the Safety CPU. Item Description Diagnostic timing Error code Memory diagnosis RAM diagnosis Detects errors occurring at program memory, • When power is turned off and 3C20H, 3C21H, device memory, and memory used by the system. 3C22H, 3C2FH, •...
  • Page 545: Safety Data Identify Check

    33.4 Safety Data Identify Check This function checks if the project data created using the engineering tool and the data in the Safety CPU are the same, and confirms that the program executed in SAFETY MODE is the one written by the user. This function compares files in the engineering tool with files stored in the Safety CPU, and shows the comparison result.
  • Page 546: Device/Label Memory Area Setting

    33.6 Device/Label Memory Area Setting The capacity of each area on the device/label memory can be specified. Default capacity The default capacity of each area is as follows. Item R08SFCPU R16SFCPU R32SFCPU R120SFCPU Standard device area 40K words 40K words 40K words 40K words Safety device area...
  • Page 547: Setting Range Of Capacity Of Each Area

    Setting range of capacity of each area The following tables list the setting range of the capacity of each area on the device/label memory. *1 The remaining capacity of other areas is automatically set as the capacity of the standard local device area and safety local device area. (...
  • Page 548 R120SFCPU Area Setting range of capacity of each area Without an With an extended With an extended With an extended With an extended extended SRAM SRAM cassette SRAM cassette SRAM cassette SRAM cassette cassette (1MB) (2MB) (4MB) (8MB) Standard device area 2 to 1684K words 2 to 2196K words 2 to 2708K words...
  • Page 549: Setting Method

    Setting method The capacity in each data area of the device/label memory can be changed. [CPU Parameter]  [Memory/Device Setting]  [Device/Label Memory Area Setting] Operating procedure Set whether to use an extended SRAM "Device/Label Memory Area Setting" window cassette or not in "Extended SRAM Cassette Setting".
  • Page 550 Standard device area setting range The number of points of each device used in standard programs and capacity in which the total number of device points can be stored are set. Set the total number of dev