Professional Documents
Culture Documents
MK120S Manual PDF
MK120S Manual PDF
Design Precautions
Warning
Install a safety circuit external to the PLC that keeps the entire system
safe even when there are problems with the external power supply or
the PLC module. Otherwise, serious trouble could result from
erroneous output or erroneous operation.
- Outside the PLC, construct mechanical damage preventing interlock
circuits such as emergency stop, protective circuits, positioning upper
and lower limits switches and interlocking forward/reverse operation.
When the PLC detects the following problems, it will stop calculation and
turn off all output in the case of watchdog timer error, module interface
error, or other hardware errors.
However, one or more outputs could be turned on when there are
problems that the PLC CPU cannot detect, such as malfunction of output
device (relay, transistor, etc.) itself or I/O controller. Build a fail safe
circuit exterior to the PLC that will make sure the equipment operates
safely at such times. Also, build an external monitoring circuit that will
monitor any single outputs that could cause serious trouble.
Make sure all external load connected to output does NOT exceed the
rating of output module.
Overcurrent exceeding the rating of output module could cause fire, damage
or erroneous operation.
Build a circuit that turns on the external power supply when the PLC
main module power is turned on.
If the external power supply is turned on first, it could result in erroneous
output or erroneous operation.
SAFETY INSTRUCTIONS
Design Precautions
Caution
Do not bunch the control wires or communication cables with the main
circuit or power wires, or install them close to each other. They should
be installed 100mm (3.94inch) or more from each other.
Not doing so could result in noise that would cause erroneous operation.
Installation Precautions
Caution
Use the PLC in an environment that meets the general specification
contained in this manual or datasheet.
Using the PLC in an environment outside the range of the general
specifications could result in electric shock, fire, erroneous operation, and
damage to or deterioration of the product.
Completely turn off the power supply before loading or unloading the
module.
Not doing so could result in electric shock or damage to the product.
Wiring Precautions
Warning
Completely turn off the external power supply when installing or
placing wiring.
Not doing so could cause electric shock or damage to the product.
Caution
Be sure that wiring is done correctly be checking the product’s rated
voltage and the terminal layout.
Incorrect wiring could result in fire, damage, or erroneous operation.
Switch all phases of the external power supply off when cleaning the
module or retightening the terminal or module mounting screws.
Not doing so could result in electric shock or erroneous operation.
Caution
Do not disassemble or modify the modules.
Doing so could cause trouble, erroneous operation, injury, or fire.
Switch all phases of the external power supply off before mounting or
removing the module.
Not doing so could cause failure or malfunction of the module.
Use a cellular phone or walky-talky more than 30cm (11.81 inch) away
from the PLC
Not doing so can cause a malfunction.
Disposal Precaution
Caution
When disposing of this product, treat it as industrial waste.
Not doing so could cause poisonous pollution or explosion.
Revision History
Appendix ··················································································································
Chapter 1. General
This manual includes specifications, functions and handling instructions for the MASTER-K120S series PLC.
This manual is divided up into chapters as follows:
Chapter 1 General Describes configuration of this manual, unit's features and terminology.
Chapter 2 System configuration Describes available units and system configurations in the MASTER-K120S series.
Chapter 3 General Specification Describes general specifications of units used in the MASTER-K120S series.
Chapter 4 Names of Parts Describes each kind of manufacturing goods, titles, and main functions
Chapter 9 Installation and Wiring Describes installation, wiring and handling instructions for reliability of the PLC system
Describes the check items and method for long-term normal operation of the PLC
Chapter 10 Maintenance
system.
Appendix 1 System Definitions Describes parameter setting for basic I/O and communications module
Appendix 2 Flag List Describes the types and contents of various flags.
Appendix 3 Dimensions Shows dimensions of the main units and expansion modules
REMARK
-. This manual does not describes the programming method. For their own functions, refer to the related user's
manuals.
1-1
Chapter 1 General
1.2. Features
1) MASTER-K120S series is extremely compact, to fit a wide range of applications and have following features.
1-2
Chapter 1 General
1.3 Terminology
The following table gives definition of terms used in this manual.
A system which consists of the PLC and peripheral devices. A user program
PLC system
can control the system.
A hand-held loader used for program creation, edit, compile and debugging
KLD-150S
for MASTER-K series.
I/O Image Area Internal memory area of the CPU module which used to hold I/O statuses.
1-3
Chapter 1 General
Current flows from the switch to the PLC input terminal if a input signal turns on.
Sink Input
Current flows from the PLC input terminal to the switch after a input signal turns
on.
Source
Input
Current flows from the load to the output terminal and the PLC output turn on.
Output
Sink Output
Contact
Current flows from the output terminal to the load and the PLC output turn on.
Source
Output
Output Contact
1-4
Chapter 2 System Configuration
expansion
cable
2-1
Chapter 2 System Configuration
Cnet I/F System is used for communication between the main unit and external devices using RS-232C/RS-422 Interface.
The MK120S has a built-in RS-232C port, RS-485 port and has also G7L-CUEB for RS-232C, G7L-CUEC for RS-422. It is
possible to construct communication systems on demand.
(1) 1:1 ratio of an external device (computer) to main unit using a built-in port
MASTER-K120S
Monitoring Device
RS-232C
RS-485
(2) 1:1 ratio of an external device (monitoring unit) to main unit using a built-in RS-485 port
RS-485
MASTER-K120S MASTER-K120S
Monitoring Device
RS-232C
2-2
Chapter 2 System Configuration
(3) RS-232C Communication over a long distance via modem by Cnet I/F modules
Modem
Modem
MASTER-K120S G7L-CUEB
Modem
Modem
RS-232C ⇔ RS-485
Converter
Built-in RS-485 Built-in RS-485 Built-in RS-485
2-3
Chapter 2 System Configuration
Power
Input Input
supply
DC24V
Power Special/communication
supply • CPU modules
Output Output
Comm. I/F
Built-in
RS-485
Built-in RS-232C I/F Output signal Output signal
Sub-system Description
CPU • Signal processing function
-. Operating system function
-. Application program storage / memory function
-. Data storage / memory function
-. Application program execution function
Input • The input signals obtained from the machine/process to appropriate signal levels for
processing
Output • The output signals obtained from the signal processing function to appropriate signal
levels to drive actuators and/or displays
Power Supply • Provides for conversion and isolation of the PLC system power from the main supply
Communication • Provides the data exchange with other systems or PADT, such as KGLWIN, personal
Interface computers
2-4
Chapter 2 System Configuration
2-5
Chapter 2 System Configuration
3) Expansion Modules
Slim Type
Expansion G7E-DC08A • 8 DC inputs
Digital I/O module
module
G7E-TR10A • 10 Transistor outputs
Slim Type
G7E-RY08A • 8 relay outputs
Standard
G7L-FUEA • FieldBus I/F module
type only
2-6
Chapter 3 General Specifications
The following table shows the general specifications of the MASTER-K120S series.
10 Pollution degree 2
REMARK
1) IEC (International Electrotechnical Commission): An international civilian institute who establishes international standards in area of electric
and electronics.
2) Pollution degree: An indicator, which indicates pollution degree, which determine insulation performance of equipment.
* Pollution degree 2 : Normally, only non-conductive pollution occurs. Occasionally, however, a temporary conductivity caused by
condensation shall be expected.
3-1
Chapter 4 Names of Parts
⑧
BUILT_IN CNET
RUN
⑦ ②
PAU/REM ON OFF
STOP ROM MODE
①
⑥ ③
③
⑨
- +
RS-485
4 -1
Chapter 4 Names of Parts
No Name Description
⑥ RS-232C connector 9-pin DIN connector to connect with external devices like KGLWIN
⑨ Private hook DIN rail Private part hook for DIN rail
1) K7M-DR60U
4 -2
Chapter 4 Names of Parts
2) K7M-DRT60U
3) K7M-DT60U
1) K7M-DR40U
4 -3
Chapter 4 Names of Parts
2) K7M-DRT40U
3) K7M-DT40U
1) K7M-DR30U
4 -4
Chapter 4 Names of Parts
2) K7M-DRT30U
3) K7M-DT30U
1) K7M-DR20U
4 -5
Chapter 4 Names of Parts
2) K7M-DRT20U
3) K7M-DT20U
1) K7M-DR30UE
4 -6
Chapter 4 Names of Parts
1) K7M-DR20UE
1) K7M-DR14UE
1) K7M-DR10UE
4 -7
Chapter 4 Names of Parts
1) G7E-DR20A
③ ④
No. Names
① ① Input LED
② Output LED
③ Input contact
⑦ ⑧
④ Input common terminal
⑤ Output contact
②
⑥ Output common terminal
⑦ Expansion cable
⑥ ⑤
⑥
⑤ ⑧ Expansion Cable Connecting Terminal
1) G7E-DR10A
④
③
No. Names
① Input LED
①
② Output LED
③ Input contact
⑦ ⑧
④ Input common terminal
⑤ Output contact
② ⑥ Output common terminal
⑦ Expansion cable
⑥⑤ ⑥ ⑤ ⑥
⑤
⑧ Expansion Cable Connecting Terminal
1) G7E-TR10A
① No. Names
① Output LED
② Output contact
⑥
⑤ ③ Output common terminal
④ External Power Supply Terminal (DC24V)
⑤ Expansion cable
⑥ Expansion Cable Connecting Terminal
③ ② ④
4 -8
Chapter 4 Names of Parts
1) G7E-DC08A
② ③
No. Names
①
① Input LED
② Input contact
④ ⑤
③ Input common terminal
④ Expansion cable
②
③
2) G7E-RY08A
③ ②
No. Names
①
① Output LED
② Output contact
④ ⑤
③ Output common terminal
④ Expansion cable
③ ②
4 -9
Chapter 4 Names of Parts
1) G7F-ADHA
⑤ ②
No. Names
① RUN LED
⑥ Expansion Cable
2) G7F-ADHB
③
No. Names
① RUN LED
⑤ Expansion Cable
①
⑥ Expansion Cable Connecting Terminal
④ ②
4 -10
Chapter 4 Names of Parts
1) G7F-DA2I
No. Names
① RUN LED
①
④ Expansion Cable Connecting Terminal
⑤ ②
2) G7F-DA2V
⑤
No. Names
① RUN LED
③ Expansion Cable
④ ①
No. Names
24V 24G
Input
① RUN LED
⑤ Expansion Cable
4 -11
Chapter 4 Names of Parts
No. Names
① RUN LED
No. Names
① RUN LED
4 -12
Chapter 4 Names of Parts
1) G7L-CUEB
No. Names
① RS-232C connector
③ Expansion cable
2) G7L-CUEC
No. Names
① RS-422/485 connector
③ Expansion cable
1) G7L-FUEA
No. Names
③ Expansion cable
4 -13
Chapter 4 Names of Parts
1) G7L-PBEA
No. Names
③ Expansion cable
1) G7L-DBEA
No. Names
③ Expansion cable
Option modules are attached the expansion slot of main unit or expansion unit, and supplies optional functions such as
memory expansion or real time clock. MASTER-K120S series have two option modules – External memory module and RTC
module.
No. Names
① ① Option module
② Connector
②
4 -14
Chapter 5 Power Supply / CPU
5-1
Chapter 5 Power Supply / CPU
The following table shows the general specifications of the MASTER-K120S series
Specifications
Items Remarks
K7M-DR/DRT/DT20U K7M-DR/DRT/DT30U K7M-DR/DRT/DT40U K7M-DR/DR`T/DT60U
Program control method Cyclic execution of stored program, Time-driven interrupt, Process-driven interrupt
I/O points 20 30 40 60
Self-diagnosis functions Detects errors of scan time, memory, I/O and power supply
5-2
Chapter 5 Power Supply / CPU
(continued)
Specifications
Items Remarks
K7M-DR/DRT/DT20U K7M-DR/DRT/DT30U K7M-DR/DRT/DT40U K7M-DR/DRT/DT60U
5-3
Chapter 5 Power Supply / CPU
Specifications
Items Remarks
K7M-DR10UE K7M-DR14UE K7M-DR20UE K7M-DR30UE
Program control method Cyclic execution of stored program, Time-driven interrupt, Process-driven interrupt
I/O points 10 14 20 30
Self-diagnosis functions Detects errors of scan time, memory, I/O and power supply
5-4
Chapter 5 Power Supply / CPU
(continued)
Specifications
Items Remarks
K7M-DR10UE K7M-DR14UE K7M-DR20UE K7M-DR30UE
5-5
Chapter 5 Power Supply / CPU
1) Cyclic operation
A PLC program is sequentially executed from the first step to the last step, which is called scan. This sequential
processing is called cyclic operation. Cyclic operation of the PLC continues as long as conditions do not change
for interrupt processing during program execution. This processing is classified into the following stages:
Stages Processing
Operation Start -
Input conditions are read and stored into the input image area
Input image area refresh before starts processing.
Program is sequentially executed from the first step to the last step
Program operation processing Program operation processing
Program starts
~
Program ends
The contents stored in the output image area is output to output part
when operation processing of a program is finished.
Output image area refresh
Stage for return processing after the CPU part has finished 1 scan.
END processing The END processing following processing is executed.
▶ Self-diagnosis
▶ Change the present values of timer and counter, etc.
▶ Processing data communications between computer link module
and communications module.
▶ Checking the switch for mode setting.
5-6
Chapter 5 Power Supply / CPU
If a situation occurs which is requested to be urgently processed during execution of a PLC program, this opera
tion method processes immediately the operation, which corresponds to interrupt program. The signal, which infor
ms the CPU of those urgent conditions is called interrupt signal. The MASTER-K120S CPU has three kind of int
errupt operation methods, which are internal, external and high speed counter interrupt signal methods.
The momentary power failure occurs when the input line voltage to the power supply falls down below the rated
voltage. When momentary power failure within 10ms occurs, the CPU maintain operation processing. But If is exceeds
10ms, CPU stop processing and all output turns off. And The re-start process is executed as the power is re-applied.
REMARK
1) Momentary power failure
The PLC defining power failure is a state that the voltage of power has been lowered outside the allowable
variation range of it. The momentary power failure is a power failure of short interval (several to tens ms).
5-7
Chapter 5 Power Supply / CPU
Scan time is the sum of the processing time of scan program that the user has written, of the task program processing time
and the PLC internal processing time.
(1) Scan time = Scan program processing time + Interrupt program processing time + PLC internal processing time
• Scan program processing time = The processing time used to process a user program that is not specified
to a task program.
• Interrupt program processing time = Total of the processing times of interrupt programs executed during
one scan.
• PLC internal processing time = Self-diagnosis time + I/O refresh time + Internal data processing time
+ Communications service processing time
(2) Scan time differs in accordance with the execution or non-execution of interrupt programs and communications
processing, etc.
2) Flags
1) Watchdog timer is used to detect a delay which is attributable to abnormal operation of sequence program
(Watchdog time is set in menu of basic parameter of KGLWIN.)
2) When watchdog timer detects an exceeding of preset watchdog time, the operation of PLC is stopped immediately
and all output is off.
3) If an exceeding of preset watchdog time is expected in sequence program, use ‘WDT’ instruction.
‘WDT’ instruction make elapsed watchdog time as zero.
4) In order to clear watchdog error, restarting the PLC or mode change to STOP mode are available.
REMARK
-. Setting range of watchdog : 10 ~ 6,000ms(unit : 10ms)
5-8
Chapter 5 Power Supply / CPU
The MASTER-K series use up count timer. There are 5 timer instructions such as on-delay (TON), off-delay (TOFF), integral
(TMR), monostable (TMON), and re-triggerable (TRTG) timer.
The measuring range of 100msec timer is 0.1 ~ 6553.5 seconds, 10msec timer is 0.01 ~ 655.35 seconds, and that of 1msec
timer is 0.001 ~ 65.53 seconds. Please refer to the ‘MASTER-K programming manual’ for details.
Preset value
Timer output relay
Timer type
1) On delay timer
The current value of timer starts to increase from 0 when the input condition of TON instruction turns on. When the
current value reaches the preset value, the timer output relay turns on.
When the timer input condition is turned off, the current value becomes 0 and the timer output relay is turned off.
input condition
t0 t1 t2 t3 t4 t5
Output relay
t0+PT t4+PT t5
Pre value
Current value
t0 t1 t2 t3 t4 t5
Current value
5-9
Chapter 5 Power Supply / CPU
3) Integral timer
In general, its operation is same as on-delay timer. Only the difference is the current value will not be clear when the
input condition of TMR instruction is turned off. It keeps the elapsed value and restart to increase when the input
condition is turned on again. When the current value reaches preset value, the timer output relay is turned on.
The current value can be cleared by the RST instruction only.
Current value
t0 t1 t2 t3 t5 t5+PT
4) Monostable timer
In general, its operation is same as off-delay timer. However, the change of input condition is ignored while the timer is
operating (decreasing). When current value reaches preset value the timer output relay is turned off and current value is
cleared.
Current value
t0 t1 t2 t4
5-10
Chapter 5 Power Supply / CPU
5) Retriggerable timer
The operation of retriggerable timer is same as that of monostable timer. Only difference is that the retriggerable timer is
not ignore the input condition of TRTG instruction while the timer is operating (decreasing). The current value of
retriggerable timer will be set as preset value whenever the input condition of TRTG instruction is turned on.
PT
Timer output relay
(On operation)
Current value
REMARK
The Maximum timing error of timers of MASTER-K series is ‘1 scan time + the time from 0 step to timer instruction’
5-11
Chapter 5 Power Supply / CPU
1) Up counter (CTU)
-. The counter output relay is turned on when the current value reaches the preset value.
-. When the reset input is turned on, the counter output relay and current value is cleared as 0.
3) Up-down counter
-. The current value is increased with the rising edge of up-count input signal, and decreased with the rising edge of
down-count input signal.
-. The counter output relay is turned on when the current value is equal or greater than the preset value otherwise off.
5-12
Chapter 5 Power Supply / CPU
4) Ring counter
-. The current value is increased with the rising edge of the counter input signal, and the counter output relay is turned on
when the current value reaches the preset value. Then the current value and counter output relay is cleared as 0 when
the next counter input signal is applied.
(2) Duty
Duty is the ratio of the input signal’s on time to off time as a percentage.
T1 T2
OFF ON OFF
T1
If T1 ≤ T2, n= ×100 (% )
T1 + T2
T2
If T1 > T2, n= × 100 (% )
T1 + T2
5-13
Chapter 5 Power Supply / CPU
5.4 Program
All functional elements need to execute a certain control process are called as a ‘program’. In MASTER-K120 series, a
program is stored in the EEPROM mounted on a CPU module or flash memory of a external memory module. The following
table shows the classification of the program.
The following diagram shows that how the CPU module process programs when the CPU module is powered on or switched to
RUN mode.
Start processing
Subroutine program
PDI program
Scan program
TDI program
HSCDI program
END processing
5-14
Chapter 5 Power Supply / CPU
1) Scan program
-. The scan program is executed regularly in every scan from 0 step to last step.
-. When interrupts has occurred, CPU pauses scan program and executes corresponding interrupt program first.
-. When this interrupt program finished, scan program is to resume.
2) Interrupt program
-. When an interrupt occurs, the CPU module will stop the current operation and execute the corresponding interrupt routine
first. After finish the interrupt routine, the CPU resume the sequence program from the stopped step.
-. MASTER-K102S series provides 3 types of interrupt.
• The TDI (Time driven interrupt) occurs with the constant period
• The PDI (Process driven interrupt) occurs with the status of external input.
• The HSCDI(High speed counter driven interrupt) occur with comparison task signal from high speed counter.
(Standard type only)
(1) Before to use interrupt function in sequence program, the parameter setting should be done properly. Then the
corresponding interrupt routine should be written after END instruction. (Refer chapter 4 for details) If interrupt routines
are not matched with parameter settings, an error occurs and the operation of CPU will be stopped.
(2) To execute an interrupt routine, use the EI instruction to enable the corresponding interrupt. The interrupt routine is not
executed if an interrupt factor occurs before execution of an EI instruction. Once an interrupt is enabled with EI
instruction.
(3) When multiple interrupt factors occur simultaneously, interrupt routines are executed according to the priority given to
the each interrupt. If an interrupt factor that has higher priority occurs while other interrupt that has lower priority are
executing, the interrupt routine of lower priority will be stopped and the interrupt of higher priority will be executed first.
Following figure show how CPU handles multiple interrupts
1
1
Program starts
Scan Program
2
2 Interrupt 2 occurs
7 3 Stop main program and execute interrupt routine 2
4
Interrupt 1 occurs (higher priority)
Interrupt routine 1 5
5
Stop routine 2 and run routine 1
3 6
Interrupt routine 2 4
Finish routine 1 and return to routine2
6
7
Finish routine 2 and return to main program
5-15
Chapter 5 Power Supply / CPU
2) parameter setting
5-16
Chapter 5 Power Supply / CPU
REMARK
Total available interrupt points is 8(In standard type).
-. Time driven interrupt + process driven interrupt + high speed counter driven interrupt ≤ 8 points
Interrupt signal is ignored when self-interrupt occurs more than 2 times during interrupt processing is executing.
1) Error Classification
Errors occur due to various causes such as PLC system defect, system configuration fault or abnormal operation
result. Errors are classified into fatal error mode, which stops system operation for system stability, and ordinary
error mode, which continues system operation with informing the user of its error warning.
The main factors that occurs the PLC system error are given as followings.
• PLC hardware defect
• System configuration error
• Operation error during execution of the user programs
• External device malfunction
5-17
Chapter 5 Power Supply / CPU
REMARK
1) In occurrence of a error, the state is to be stored in the representative system error flag F006.
2) For details of flags, refer to Chapter 11. Troubleshooting.
5-18
Chapter 5 Power Supply / CPU
The CPU operates in one of the four modes - RUN, STOP, PAUSE and DEBUG mode. The following describes ope
ration processing in each operation mode.
No
Operation mode is changed?
Yes
Initialization of data area is executed when the first scan starts and The possibility of execution of the program
is decided with check on its effectiveness.
5-19
Chapter 5 Power Supply / CPU
5-20
Chapter 5 Power Supply / CPU
4) Operation method
(1) Execute the operation after the debug operation conditions have been set in the KGLWIN.
(2) In interrupt programs, each task can be specified to operation enable/disable.
For detailed operation method, refer to the KGLWIN User’s Manual Chapter 9.
2) Operation mode change by the mode-setting switch of CPU module.(Standard type only)
The following shows the operation mode change by the mode-setting switch of CPU module.
Mode setting switch position Operation mode
RUN Local RUN
STOP Local STOP
STOP → PAU / REM Remote STOP
PAU / REM → RUN ∗1 Local RUN
RUN → PAU / REM * 2 Local PAUSE
PAU / REM → STOP Local STOP
REMARK
-. If the operation mode changes from RUN mode to local RUN mode by the mode setting switch, the
PLC operates continuously without stopping.
5-21
Chapter 5 Power Supply / CPU
5-22
Chapter 5 Power Supply / CPU
5.6 Functions
5.6.1 Self-diagnosis
1) Functions
(1) The self-diagnosis function permits the CPU module to detect its own errors.
(2) Self-diagnosis is carried out when an error occurs during PLC power supply is turned on or operating process.
If an error is detected, the system stops operation to prevent faulty PLC operation.
4) Error history
When error occurs, Corresponding error code is stored in special relay F006.
5-23
Chapter 5 Power Supply / CPU
Click
5-24
Chapter 5 Power Supply / CPU
Click
5-25
Chapter 5 Power Supply / CPU
(3) Precautions
y Turning the power off and on, changes of the operation mode or operation by reset switch does not change
the previous force on/off setting data. They remain within the CPU module and operation is executed with
the same data.
y Forced I/O data will not be cleared even in the STOP mode.
y When setting new data, disable every I/O settings using the setting data clear function and set the new data.
REMARK
-. For detailed operation, refer to the KGLWIN user’s Manual Chapter 7 ‘Force I/O setting.
5-26
Chapter 5 Power Supply / CPU
This function is useful when reads an input relay’s state directly during execution of a program and uses in the operation, or
write the operation result directly to an output relay. Direct input/output is executed by the ‘IORF’ instruction. If this instruction is
used, the input/output image area will be directly updated and applied to the continuing operations.
REMARK
-. For detailed operation, refer to the ‘MASTER-K Manual for instruction’.
D4901 ~ D4904 The 1st error information, The 17th error information
REMARK
Refer to the KGLWIN user’s Manual Chapter 7, for details.
5-27
Chapter 5 Power Supply / CPU
The CPU module includes two types of memory that are available by the user. One is program memory, which is
used to store the user programs written to implement a system by the user. The other is data memory, which sto
res data during operation.
0 ~ F 0000 ~ FFFF
P00 D0000
I/O relay Data Register Parameter setting area
T000 S00
Timer (100ms) Step Controller
T250
59 points “T”
T251
Timer (1ms)
5 points “T”
T255
C000
Counter
“C”
C255
5-28
Chapter 5 Power Supply / CPU
I/O No. allocation means to give an address to each module in order to read data from input modules and output data to
output modules.
5-29
Chapter 5 Power Supply / CPU
5.9.1 Structure
You can see dip switches as shown when you open I/O terminal block cover.
BUILT_IN CNET
Terminal block cover
ON OFF
ROM MODE
5.9.2 Usage
ROM MODE
ROM MODE
* The lower switch is for O/S download setting. Don’t handle this switch.
5-30
Chapter 5 Power Supply / CPU
Dip switch for Built-in Cnet is placed in deep place to prevent a mistaken operation caused by terminal block cover, etc. Use
a small driver to operate it.
Driver
Dip switch
5-31
Chapter 5 Power Supply / CPU
MK120S series supplies external memory module for the user to save programs safely or download a program on the
system and use it in case of a program is damaged.
5.10.1 Structure
Installation connector
5.10.2 Usage
5-32
Chapter 5 Power Supply / CPU
(6) Select Online – Flash memory – Write to external memory in menu, and the following message box will displayed.
Through the above steps a user can save a program into the external memory module.
REMARK
1) When the PLC restarts, it always operated with the external memory module automatically if external memory is
connected.
2) Remove after writing is finished.
5-33
Chapter 5 Power Supply / CPU
MK120S series supplies RTC(Real Time Clock) module for the time-scheduling control. To use RTC function with K120S series,
the RTC operation module should be attached to the expansion slot of main unit or expansion module. Clock operation by the
RTC function is continued with a super capacitor when the CPU is powered off.
5.11.1 Structure
Installation connector
5.11.2 Usage
5-34
Chapter 5 Power Supply / CPU
3) Date expression
Number 0 1 2 3 4 5 6
Date Sunday Monday Tuesday Wednesday Thursday Friday Saturday
REMARK
1) If RTC stops or error occurs, write new data to the RTC then error is called off.
2) There is no written clock data in the RTC when shipped.
3) Before using RTC module, write clock data to the RTC first
5-35
Chapter 6 Input and Output Specification
Digital input that offers to MASTER-K120S series are made to use both of electric current sink and electric current source.
To keep use coil load as an output module, maximum opening and shutting frequency is 1 second on and 1 second off.
The following diagram shows maximum life relay for relay output.
Frequency
100
×(
50
10,000)
30
20
10
AC 125V r/load
DC 30V r/load
AC 250V r/load
0.5 1 2 3 5 10 100(A)
6-1
Chapter 6 Input and Output Specification
1) Specification
Common terminal 6 points / COM 8 points/COM 12 points/COM 18 points/ COM 12points/COM 18points/COM
2) Circuit diagram
R
R C Internal Standard Type P000 ~ P001
COM circuit Economic Type None
6-2
Chapter 6 Input and Output Specification
3) Input wiring
Main unit’s wiring method is as follows. DC input specifications offered by MASTER-K120S is to be used for both electric
current sink and electric current source.
DC24V DC24V
6-3
Chapter 6 Input and Output Specification
Relay
IN
7mA
COM
NPN open collector output type
Output IN
0V 7mA
COM +
and input
+
Constant
Output
] current IN
0V 7mA Power for
sensor + COM +
PNP current output type
+ Power for
sensor
Output
IN
0V 7mA
COM -
Voltage output type
+
COM +
Output
IN
0V
Power for
sensor
6-4
Chapter 6 Input and Output Specification
1) Specifications
2) Circuit diagram
It’s the same with the one for the main unit.
3) Input wiring
DC24V DC24V
6-5
Chapter 6 Input and Output Specification
1) Specification
Rated load voltage/current DC24V / 2A (r/load), AC220V / 2A (COS Ψ = 1)/1 point , 5A / 1COM
6-6
Chapter 6 Input and Output Specification
Rated load voltage/current DC24V / 2A (r/load), AC220V / 2A (COS Ψ = 1)/1 point , 5A / 1COM
2) Circuit
Internal
circuit Relay
L
COM
6-7
Chapter 6 Input and Output Specification
3) Output wiring
L L L L L L L L L L L L L
L L L L L L L L L L L
6-8
Chapter 6 Input and Output Specification
1) Specification
Output point 4 points / 8 point 4 points / 12 point 4 points / 16 point 4 points / 24 point
Max. load current 0.5A/1 point (DRT Type P40~P43: 0.1A/1point, DT Type P40~P41 0.1A/1point)
P40,P41
24V
Internal
TR1
Circuit
R2
R
3
P42,P43
24V
P/C
Internal
Circuit TR1
R2
R
3
REMARK
1) Output TR P000 ~ P003 of DRT Type(K7M-DRT20/30/40/60U) are for positioning function.
2) They also can be used as general transistor output, but can’t be used for AC load. When used for AC loads, they can be destroyed.
6-9
Chapter 6 Input and Output Specification
2) Output wiring
L L L L
DC12V/24V
6-10
Chapter 6 Input and Output Specification
1) Specifications
2) Circuit
It’s the same with the output circuit of the main unit.
3) Output wiring
… …
L L L L L L
6-11
Chapter 6 Input and Output Specification
Off → On 2 ms or lower
Response time
On → Off 2 ms or lower
L L L L L
L L L L L
DC12/24V
REMARK
1) Refer to 7.2 ‘Special Functions’ for the special modules
6-12
Chapter 7 Usage of Various Functions
This chapter describes the specification, handling, and programming of built-in high speed counter of MASTER-K120S. The
built-in high speed counter of MASTER-K120S(hereafter called HSC) has the following features;
Function Description
• Linear counter : Up/Down counter.
Counter format Counting range is from -2,147,483,648 to 2,147,483,647
• Ring counter : Counter value rotates from 0 to (set value-1)
4 counter functions as followings
• 1-phase operation mode
• 1-phase pulse + direction mode : Up / down is selected by direction pulse
Counter mode
• 2-phase CW/CCW mode : Up / down is selected by CW or CCW pulse input
• 2-phase multiplication mode : Up / down is automatically selected by the phase
difference between A-phase and B.(multiplied by 4)
Preset function Change current value to preset value.
Latch counter Latches current value.
Additional
Comparison output When current value is equal to comparison value, turns on the output contact points or
function
executes interrupt program
RPM function Calculate the RPM(Rotates Per Minute) of input pulse
1) Performance Specifications
Items Specifications
Standard Type Economic Type
Points
1 phase : 4 points, 2 Phase : 2 points 1 phase : 2 points, 2 Phase : 1 points
1-phase 100kHz/ 2-phase 50kHz ( Ch0, Ch1) 1-phase 10kHz/ 2-phase 5kHz
Max. counting speed
1-phase 20kHz/ 2-phase 10kHz ( Ch2, Ch3) ( Ch0, Ch1)
Input types A-Phase, B-Phase, Preset input
Counting ranges from -2,147,483,648 to 2,147,483,647(Binary 32 bits)
1-phase Up counter
1-phase Pulse +
A-Phase : Input pulse, B-Phase : Direction pulse
direction input
Up / Down
2-phase
selection A-Phase : Up counting pulse, B-Phase : Down counting pulse
CW/CCW mode
2-phase
Auto-select by phase difference of A-phase and B
multiplication mode
Additional function Ring counter, Latch counter, Preset, Comparison output, RPM function
2) Input specification
Items Specifications Items Specifications
Rated input 24VDC (7mA) Rated input 24VDC (7mA)
On voltage 20.4 ~ 28.8VDC On voltage 20.4 ~ 28.8VDC
A / B phase Preset input Off voltage 6VDC or lower
Off voltage 6VDC or lower On delay time 200 ㎲ or lower
Off delay time 200 ㎲ or lower
7-1
Chapter 7 Usage of Various Functions
Input pulse
Preset input
① ② ③④ ⑤ ⑥ ⑦ ⑧ ⑨
BUILT_IN CNET
ON OFF
ROM MODE
① P00 Ch0 Input Ch0 A Phase Input Counter input terminal A Phase Input terminal
② P01 Ch1 Input Ch0 B Phase Input Counter input terminal B Phase Input terminal
③ P02 Ch2 Input Ch2 A Phase Input Counter input terminal A Phase Input terminal
④ P03 Ch3 Input Ch2 B Phase Input Counter input terminal B Phase Input terminal
⑤ P04 Ch0 Preset 24V Ch0 Preset 24V Preset input terminal Preset input terminal
⑥ P05 Ch1 Preset 24V - Preset input terminal -
⑦ P06 Ch2 Preset 24V Ch2 Preset 24V Preset input terminal Preset input terminal
⑧ P07 Ch3 Preset 24V - Preset input terminal -
⑨ COM0 Input Common Input common terminal
< Standard Type >
① P00 Ch0 Input Ch0 A Phase Input Counter input terminal A Phase Input terminal
② P01 Ch1 Input Ch0 B Phase Input Counter input terminal B Phase Input terminal
③ P02 Ch0 Preset 24V Ch0 Preset 24V Preset input terminal Preset input terminal
④ P03 Ch1 Preset 24V - Preset input terminal -
< Econnomic Type >
7-2
Chapter 7 Usage of Various Functions
COM
Common
0
COM
Common
0
5) Wiring instructions
A high speed pulse input is sensitive to the external noise and should be handled with special care. When wiring the built-in
high speed counter of MASTER-K120S, take the following precautions against wiring noise.
(1) Be sure to use shielded twisted pair cables. Also provide Class 3 grounding.
(2) Do not run a twisted pair cable in parallel with power cables or other I/O lines which may generate noise.
(3) Before applying a power source for pulse generator, be sure to use a noise-protected power supply.
(4) For 1-phase input, connect the count input signal only to the phase A input; for 2-phase input, connect to phases A and B.
7-3
Chapter 7 Usage of Various Functions
6) Wiring example
24V
Pulse Generator
Pulse Generator
CHSC
COM
24VG
24V
CHSC
PulsePulse
Generator COM
Generator
A
24VG
7-4
Chapter 7 Usage of Various Functions
7) Instruction(HSCST)
SV ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ 7/9 ○
CV ○ ○ ○ ○ ○ ○ ○ ○
■ HSCST S SV CV
(1) Functions
• When input condition turns on, corresponding high speed counter is enabled.
• When input condition turns off, high speed counter stop counting and turns output point off . The current value is retained.
• The high speed counter can counts from -2,147,483,648 to 2,147,483,647(binary 32bits).
• When current value is greater than set value, output point F17*(* is channel number) turns on and it turns off when current
value is less than set value.
• If current value is greater than 2,147,483,647, carry flag F18* turns on and and it turns off when input condition turns off.
If HSC designated as ring counter, carry flag is set when current value reaches set value.
• If current value is smaller than -2,147,483,648, borrow flag F19* turns on and and turns off when input condition turns off
If designated as ring counter, if current value is 0, borrow flag is set at next pulse’s rising edge and current value goes ‘set
value –1’(in down counter mode)
7-5
Chapter 7 Usage of Various Functions
8) Parameter Setting
Carry occurs
2,147,483,647
Current value
Decreasing 0 Increasing
-2,147,483,648
Borrow occurs
Carry occurs
Current value
0
Decreasing Borrow occurs Increasing
7-6
Chapter 7 Usage of Various Functions
Current value
1 2 3 4 5
- Current value increases by 1 at the rising edge of A-Phase pulse when B-phase is ‘low’ state.
- Current value decreases by 1 at the rising edge of A-Phase pulse when A-phase is ‘High’ state.
Low High
B-phase input pulse
Current value
10 11 10 9 8
- Current value increases by 1 at the rising edge of A-Phase pulse when B-phase is ‘low’ state.
- Current value increases by 1 at the rising edge of B-Phase pulse when A-phase is ‘low’ state.
Current value
10 11 12 11 10
7-7
Chapter 7 Usage of Various Functions
• Up counter
- At the rising edge of A-Phase pulse when B-phase is ‘low’.
- At the falling edge of A-Phase pulse when B-phase is ‘high’.
- At the rising edge of B-Phase pulse when A-phase is ‘high’.
- At the falling edge of B-Phase pulse when A-phase is ‘low’.
• Up counter
- At the rising edge of A-Phase pulse when B-phase is ‘high’.
- At the falling edge of A-Phase pulse when B-phase is ‘low’.
- At the rising edge of B-Phase pulse when A-phase is ‘low’.
- At the falling edge of B-Phase pulse when A-phase is ‘high’.
Current value
10 11 12 13 14 15 16 17 18 17 16 15 14 13
7-8
Chapter 7 Usage of Various Functions
If this function is enabled, Current value of high speed counter is always retained.
Current value
0 Time
Latches CV Latches CV
Input pulse
Output Contact
Current value
98 99 100 101 102
7-9
Chapter 7 Usage of Various Functions
Input pulse
Output point
Current value
999 1000 2000 2001
7-10
Chapter 7 Usage of Various Functions
Input pulse
Current value
1000 2000 2001 4000
D0, D1
ⓐ 500 ⓑ 1000 ⓒ 2000
Time
1000ms 2000ms 3000ms
7-11
Chapter 7 Usage of Various Functions
9) Programming example
7-12
Chapter 7 Usage of Various Functions
(2) Programming
• When M0 turns on, HSC starts its operation
• If current value is not less than 50,000, F170 turns on.
• Current value is saved in D0(double word).
Remark
The contact point which is designated as HSC input can’t be used for pulse catch or external interrupt.
Duplicated designation may cause faults.
7-13
Chapter 7 Usage of Various Functions
In the main unit, 4(economic type) or 8(standard type) points of pulse catch input contact points are internalized. Through using
this contact point, short pulse signal short can be taken which can not be executed by general digital input.
1) Usage
When narrow width of pulse signal is input, a trouble occurs which can not be detected by general digital input, so the
operation does not perform as user's intention. But in this case through pulse catch function even narrow interval of pulse
signal as 10 ㎲ min. can be detected.
3) Operating Explanation
10 ㎲
input signal
scan1 CPU senses input when pulse signal, min. 10 ㎲, is input, then saves the status.
4) using method
(1) click twice the basic parameter on the project window of KGLMIN
(2) Select no. to use for pulse catch input of the basic parameter window.
For details of KGLWIN refers to the manual.
7-14
Chapter 7 Usage of Various Functions
Remark
1) Pulse catch input contact points operate as general digital input if they are not designated as pulse catch input.
2) Do not designate HSC input points as pulse catch input.
7-15
Chapter 7 Usage of Various Functions
1) Usage
Input signal status affects to the credibility of system in where noise occurs frequently or pulse width of input signal affects
as a crucial factor. In this case the user sets up the proper input on/off delay time, then the trouble by miss operation of input
signal may be prevented because the signal which is shorter than set up value is not adopted.
2) Operating Explanation
input signal
input signal
3) Using method
(1) Click twice the basic parameter on the project window of KGLWIN.
(2) The value of filter can be set up as one of 0,1,2,5,10,20,50,100,200,500,1000ms to the input on/off delay time of the
basic parameter window.(Input on/off delay time is set up as default value of 10ms)
(3) Set up input on/off delay time is conformed to all input is used.
7-16
Chapter 7 Usage of Various Functions
MASTER-K120S Series can perform max 4(economic) or 8(standard) points of external contact interrupt by using input of
main unit without special interrupt module.
1) Usage
This function is useful to execute a high speed execution regardless of scan time.
3) Operating explanation
External contact
In case of occurrence of external End the interrupt program
interrupt signal pause being executed interrupt program. process then resume to
scan program and process interrupt execute scan program
program
4) Function
(1) Max. 8 points can be used to external interrupt input within P000 ~ P007.(P000~P003 for economic type)
(2) The no. of external interrupt is decreased by using other interrupt (time driven interrupt and HSC driven task)
(3) The execution conditions of external interrupt is divided into following 3 kinds.
- Rising edge : Interrupt occurs at rising edge of external Interrupt contact point.
- Falling edge : Interrupt occurs at falling edge of external Interrupt contact point.
- Rising & falling edge : Interrupt occurs at both edge of external Interrupt contact point.
(4) In the economic type, falling edge and rising & falling edge interrupt are not available.
7-17
Chapter 7 Usage of Various Functions
5) Usage
(2) Designate contact point, no. of priority and movement condition of the task program which is moved by interrupt inputting.
◎ Rising
◎ Falling
◎ Rising/Falling
7-18
Chapter 7 Usage of Various Functions
1) Introduction
This chapter will provide information about the built-in PID (Proportional Integral Derivative) function of MASTER-K120S
main unit. The MASTER-K120S series does not have separated PID module like MASTER-K300S and MASTER-
K1000S series, and the PID function is integrated into the main unit.
The PID control means a control action in order to keep the object at a set value (SV). It compares the SV with a sensor
measured value (PV : Present Value) and when a difference between them (E : the deviation) is detected, the controller
output the manipulate value (MV) to the actuator to eliminate the difference. The PID control consists of three control
actions that are proportional (P), integral (I), and derivative (D).
Manual MV
SV MV Manipulation Control
D/A
Set Value PID value object
converting
calculation Automated MV module
Present Value PV
A/D converting
module Sensor
7-19
Chapter 7 Usage of Various Functions
2) Specification
① P action means a control action that obtain a manipulate value which is proportional to the deviation
(E : the difference between SV and PV)
② The deviation (E) is obtained by difference between SV and PV and the formula of deviation is as following;
MV = Kp × [SV − PV ] where, Kp : the proportional constant (gain), SV: set value, PV: present value
: Deviation
: Manipulating value
Time
Fig 7.1 MV by P operation
④ If the Kp is too large, the PV reaches to the SV swiftly, but it may causes a bad effect like oscillations.
⑤ If the Kp is too small, oscillation will not occur. However, the PV reaches to the SV slowly and an offset may
appear between PV and SV shown in the Fig. 7.2.
⑥ The manipulation value (MV) varies from 0 to 4,000. User can define the maximum value of MV (MV_MAX) and
minimum value (MV_MIN) within the range 0 ~ 4,000.
⑦ When an offset remains after the system is stabilized, the PV can be reached to the SV by adding a certain value.
This value is called as bias value, and user can define the bias value
: Kp is too large
Oscillation
PV : Kp is too small
SV
Offset
Time
Fig. 7.2 The relation between Proportional constant (Kp) and prosent value (PV)
7-20
Chapter 7 Usage of Various Functions
① With integral operation, the manipulate value (MV) is increased or decreased continuously in accordance time in
order to eliminate the deviation between the SV and PV. When the deviation is very small, the proportional
operation can not produce a proper manipulate value and an offset remains between PV and SV. The integral
operation can eliminate the offset value even the deviation is very small.
The period of the time from when the deviation has occurred in I action to when the MV of I action become that of
P action is called Integration time and represented as Ti.
② Integral action when a constant deviation has occurred is shown as the following Fig. 7.3.
Kp
Ti ∫
MV = Edt
As shown in the expression, Integral action can be made stronger or weaker by adjusting integration time (Ti) in
I action. That is, the more the integration time (the longer the integration time) as shown in Fig. 7.4, the lesser the
quantity added to or subtracted from the MV and the longer the time needed for the PV to reach the SV.
As shown in Fig. 7.5, when the integration time given is short the PV will approach the SV in short time since the
quantity added or subtracted become increased. But, If the integration time is too short then oscillations occur,
therefore, the proper P and I value is requested.
④ Integral action is used in either PI action in which P action combines with I action or PID action in which P and D
actions combine with I action.
7-21
Chapter 7 Usage of Various Functions
Fig. 2.5 The system response when a long integration time given
Fig. 7.4 The system response when a long integration time given
Fig. 2.6 The system response when a short integration time given
Fig. 7.5 The system response when a short integration time given
① When a deviation occurs due to alteration of SV or external disturbances, D action restrains the changes of the
deviation by producing MV which is proportioned with the change velocity (a velocity whose deviation changes at
every constant interval) in order to eliminate the deviation.
② D action gives quick response to control action and has an effect to reduce swiftly the deviation by applying a large
control action (in the direction that the deviation will be eliminated) at the earlier time that the deviation occurs.
③ D action can prevent the large changes of control object due to external conditions.
④ The period of time from when the deviation has occurred to when the MV of D action become the MV of P action is
called derivative time and represented as Td.
7-22
Chapter 7 Usage of Various Functions
① PID action controls the control object with the manipulation quantity produced by (P+I+D) action
② PID action when a given deviation has occurred is shown as the following Fig. 7.7.
7-23
Chapter 7 Usage of Various Functions
All devices to be controlled, actuator, has limitation of operation. The motor has speed limit, the valve can not flow over
the maximum value. When the control system has wide PV range, the PV can be over the maximum output value of
actuator. At this time, the actuator keeps the maximum output regardless the change of PV while the PV is over the
maximum output value of actuator. It can shorten the lifetime of actuator.
When the I control action is used, the deviation term is integrated continuously. It makes the output of I control action
very large, especially when the response characteristic of system is slow.
This situation that the output of actuator is saturated, is called as ‘windup’. It takes a long time that the actuator returns to
normal operating state after the windup was occurred.
The Fig. 7.8 shows the PV and MV of PI control system when the windup occurs. As shown as the Fig. 7.8, the actuator
is saturated because of the large initial deviation. The integral term increase until the PV reaches to the SV (deviation =
0), and then start to decrease while the PV is larger than SV (deviation < 0). However, the MV keeps the saturated status
until the integral term is small enough to cancel the windup of actuator. As the result of the windup, the actuator will
output positive value for a while after the PV reached to the SV, and the system show a large overshoot. A large initial
deviation, load disturbance, or miss-operation of devices can cause windup of actuator.
There are several methods to avoid the windup of actuator. The most popular methods are adding another feedback
system to actuator, using the model of actuator and stop integrating when actuator is saturated.
PV
SV
10
시간
MV
Integral
Term
시간
7-24
Chapter 7 Usage of Various Functions
(a) P control
(b) I control
dI K
= e where, e = (SV – PV) : deviation value
dt Ti
The digitized formula is as following;
I (n + 1) − I (n) K
= e( n ) where, h : sampling period
h Ti
Kh
I (n + 1) = I (n) + e( n )
Ti
(c) D control
7-25
Chapter 7 Usage of Various Functions
① Scan time
Scan time is the period of reading data (sampling), and also 10 times scaled up. The range of sampling time is
0.1 ~ 10 seconds, and actual input range is 0 ~ 100. Generally, Scan time of Digital PID control should be less
than 1/10 of time constant of system response for better performance. Time constant is the time taken the
system’s step response reaches to the 63% of steady state.
② Operation mode
Select automatic or manual operating mode
7-26
Chapter 7 Usage of Various Functions
⑥ Proportional gain
The MASTER-K120S can handle only integer, not the floating point type. Therefore, to enhance the accuracy of
PID operation, the PID8 instruction is designed to input the P_GAIN data as the 100 times scaled up. For
example, if the designated P_GAIN is 98, actual input data of P_GAIN should be 9800. If the designated
P_GAIN is 10.99, input 1099 to the P_GAIN.
⑨ PWM set
PWM(Pulse Width Modulation) is a output method which changes on-off duty of output pulses by calculated
manipulation value. Fig 7.9 shows example of PWM output. Using PWM output, PID control system can be
constructed easily without D/A conversion module and power regulator.
When PWM is designates , ‘scan time’ item is disabled and ‘PWM’ items can be designated. In this case, scan
time is set to designated PWM output period. The range of PWM output period is 1 ~ 10 seconds, and actual
input range is 10 ~ 100. PWM output point is only available for output contact of main unit.
Example) PWM output period : 1s, Output contact : P40, MV limit range : 0~4000
MV = 2000 MV = 1000
On
P40
Time
7-27
Chapter 7 Usage of Various Functions
⑩ SV Ramp
If a large amount of SV changes during PID operation, The deviation(E) changes rapidly. Then manipulation
value(MV) is changed rapidly also. This can cause damage on load or actuator. To prevent this situation, SV can
be changed step by step by parameter setting.
Setting range is 1~4000(Default value is 1). Setting value represents the number of time which taken from
starting set value to last set value.
For example, if SV-ramp is set to 1000 and SV changed from 1000 to 3000 during operation, it changes 2 every
scan and reach 3000 after 1000 scan time.
SV Ramp = 1
Changed SV
SV Ramp is designates
Time
⑪ Delta MV
This is useful when wants to limit maximum change of manipulation value.
Setting range is 0 ~ 4000 and default value is 4000.
⑫ Bias
The Bias data is used for the compensation of offset in the proportional control. The range of input is 0 ~ 4000.
Be cautious that The actual range of Bias is –2000 ~ 2000. namely, 0~2000 represents 0 ~ +2000 and 2001 ~
4000 represents -1 ~ -2000.
Example> If offset(SV-PV) is 100 → Bias should be 100.
If offset(SV-PV) is -100 → Bias should be 2100.
⑭ PID Algorithm
In MASTER-K120S, two type of PID algorithm is available, The velocity form(Speed) and positioning form.
Velocity form(Speed) operates incremental manners. Namely, It calculates the change(∆ n) required from
previous manipulate value(MVn-1), But positioning form calculates an absolute manipulate value(MVn) every
sampling steps. Generally, The velocity form is suit for the system which’s load change is slow like temperature
control system, and positioning form is useful for system which’s load change is fast.
7-28
Chapter 7 Usage of Various Functions
① Scan time
S_TIME is the period of reading data (sampling), and 10 times scaled up for more precious operation.
The range of sampling time is 0.1 ~ 10 seconds, and actual input range is 0 ~ 100.
② Control target(SV)
SV (set value : the designated value) and PV (process value : present value) of MASTER-K120S PID operation
have the range 0 ~ 4000. The range is set with the consideration of the resolution of A/D and D/A module of
MASTER-K120S series (12 bits) and offset value. When setting the SV or PV, please be careful convert the
analog value of control object (temperature, velocity, etc.) to digital value that are the output of A/D convert
module.
③ Tuning method
The MASTER-K120S perform auto-tuning operation in two methods. One is relay response method and the
other is process reaction curve method.
7-29
Chapter 7 Usage of Various Functions
MV
Period
SV
Amplitude
Time delay(L)
4000
MV
80% of SV
63% of SV
Time constant(T)
7-30
Chapter 7 Usage of Various Functions
5) instruction
(1) PID8
■ PID8 n S1
a) Usage
• when the condition of execution is on, PID operation executes.
• ‘n’ is registration No.at parameter( 0 ~ 7)
b) Example program
• When the input condition M0 turns on, PID operation executes at no.2 parameter.
• PID execution status registrate D0000 and the output value of control result registrate D0001
• If SV Ramp is designated, current SV is registrate D0005
bF bE bD bC bB bA b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
D0000
7-31
Chapter 7 Usage of Various Functions
(2) PID8AT
■ PID8AT n S1
a) Usage
• when the condition of execution is on, PID auto tuning operation executes and calculates P,I,D constant
• ‘n’ is registration No.at parameter( 0 ~ 7)
• S1 is execution status and P,I,D constant registration area
b) Example program
• When the input condition M0 turns on, PID operation executes at no.2 parameter.
• PID execution status stores D0000 and the output value of control result stores D0001 and P,I,D constant sequentially
store D002(P),D003(I),D004(D)
bF bE bD bC bB bA b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
D0000
7-32
Chapter 7 Usage of Various Functions
6) Program Example
G7F-
MASTER-K120S G7F-DA2I
RD2A
RS-232C
(PV : temperature)
KGL-WIN
V3.5 above (MV: 4~20mA)
Electric Oven
Heater
TPR
When PWM set is selected, Scan time parameter When PWM is designated, this window is activated and
is disabled and this value is ignored PID function operates by PWM period
7-33
Chapter 7 Usage of Various Functions
• Measure current temperature (-200~600°C) by RTD module then digital conversion value(0 ~ 4000) is stored to
D4780
• PID8 instruction will calculate manipulate value (MV : 0 ~ 4000) based on PID parameter settings (P_GAIN,
I_TIME, D_TIME, etc.) and PV from RTD module. Then, the calculated MV is output to the channel 0 of D/A
module.
• D/A module will convert the MV to analog signal and output to the actuator (power converter).
b) operation parameters
• Scan time : S_TIME=5 (sampling time = 0.5 seconds)
• Auto / Manual operation setting : Auto
• Output limit : Max. = 4000, Min = 0
• High frequency noise removal ratio : 10
• SV setting : 1300(60°C ),1350(70°C ),1400(80°C ),1500(100°C)
• Current value setting : D4780(Digital value of RTD module Ch0)
• BIAS setting : 0 (If only P control is used, input proper value other 0)
• EN_P, EN_I, EN_D setting: input proper values
• PWM setting : If enabled, input proper values.
• SV Ramp setting : Input proper values.
• Delta MV setting : Input proper values.
• PID Algorithm setting : Select proper algorithm.
7-34
Chapter 7 Usage of Various Functions
e) Program Explanation
• When the input condition M0 turns on, PID operation executes at no.0 parameter.
• PID execution status registrate D0000 and the output value of control result registrate D0001
• If SV Ramp is designated, current SV is registrate D0005
• D/A module converts the MV to analog signal and output to the actuator (power converter).
• When the input condition M0 turns off, output 0 to the D/A conversion module.
(3) In case of using combined function of PID operation and Auto tuning.
a) PID operation explanation (with A/T function)
• Measure current temperature (-200~600°C) by RTD module then digital conversion value(0 ~ 4000) is stored to
D4780
• PID8AT instruction will calculate manipulate value (MV : 0 ~ 4000) based on the SV and PV from RTD module.
Simultaneously, the PID8AT instruction will calculate P,I and D parameters.
• The END bit of auto tuning status device will be 1 when the auto tuning is completed. Then, MASTER-K120S
will start PID operation with PID parameters that are calculated by A/T module.
7-35
Chapter 7 Usage of Various Functions
c) operation parameters
• Scan time : S_TIME=5 (sampling time = 0.5 seconds)
• Auto / Manual operation setting : Auto
• Output limit : Max. = 4000, Min = 0
• High frequency noise removal ratio : 10
• SV setting : 1300(60°C ),1350(70°C ),1400(80°C ),1500(100°C)
• Current value setting : D4780(Digital value of RTD module Ch0)
• BIAS setting : 0 (If only P control is used, input proper value other 0)
• EN_P, EN_I, EN_D setting: input proper values
• PWM setting : If enabled, input proper values.
• SV Ramp setting : Input proper values.
• Delta MV setting : Input proper values.
• PID Algorithm setting : Select proper algorithm.
7-36
Chapter 7 Usage of Various Functions
f) Program Explanation
• When the input condition M2 turns on, PID auto tuning operation executes at no.0 parameter.
• When auto tuning finished, PID operation executes with calculated P,I,D parameter.
• PID execution status registrate D0000 and the output value of control result registrate D0001
• If SV Ramp is designated, current SV is registrate D0005
• D/A module converts the MV to analog signal and output to the actuator (power converter).
• When the input condition M2 turns off, output 0 to the D/A conversion module
7-37
Chapter 7 Usage of Various Functions
(1) PID8AT
H0100 Scan time setting range error Set scan time to available setting range
(2) PID8
H0100 Scan time setting range error Set scan time to available setting range
H0200 Manual operation range error Setmanual opration value to available setting range
H0500 High frequency noise removal ratio setting error Set this parameter to available setting range
H0700 PWM period setting error Set PWM period to available setting range
H0800 P gain setting error Set P gain period to available setting range
H0900 I time setting error Set I time period to available setting range
H0A00 D time setting error Set D time period to available setting range
7-38
Chapter 7 Usage of Various Functions
7. 2 Special module
RTD input module store digital conversion value of temperature value to data registers as below
Temperature Digital conversion value
Expansion
Ch 0 Ch 1 Ch 2 Ch 3 Ch 0 Ch 1 Ch 2 Ch 3
#1 D4980 D4981 D4982 D4983 D4780 D4781 D4782 D4783
#2 D4984 D4985 D4986 D4987 D4784 D4785 D4786 D4787
#3 D4988 D4989 D4990 D4991 D4788 D4789 D4790 D4791
Remark
7-39
Chapter 7 Usage of Various Functions
1) Performance specification
The performance specification of the analog mixture module are following.
Specifications
Item
G7F-ADHA G7F-ADHB
Voltage DC 0∼10V (input resistance more than 1 ㏁)
DC 0∼20 ㎃ (input resistance 250Ω)
Input range
Current DC 4∼20 ㎃ (input resistance 250Ω)
Classified by parameter
Digital output 12Bit( 0~4000)
Analog Input 1.Setting by jumper pin for V/I selection 1.Setting by dipswitch for V/I selection
on upper part of product on left side of product
Voltage/Current
(Up: voltage, Down: Current) (Left voltage, Right: Current)
selection
2. Voltage/current selected by KGLWIN parameter
3. When current input is used, short the V and I terminal
No. of channel 2 Channels/ 1 module
Voltage DC +12V
Absolute max. input
Current DC +24 ㎃
Voltage DC 0∼10V (External load resistance 2 ㏀∼1 ㏁)
DC 0∼20 ㎃ (External load resistance 510Ω)
Output range
Current DC 4∼20 ㎃ (External load resistance 510Ω)
Classified by parameter
Digital Input 12Bit( 0~4000)
Analog output
Voltage/Current
Separated from terminal
selection
No. of channel 1Channel / 1 module 1Channel / 2 module
Voltage DC +12V
Absolute max. output
Current DC +24 ㎃
Voltage DC0∼10V : 2.5 ㎷ (1/4000)
Max. resolution DC0∼20 ㎃: 5 ㎂ (1/4000 )
Current
DC4∼20 ㎃: 6.25 ㎂ (1/3200 )
Accuracy ±0.5% [Full scale ]
Max. conversion
1 ㎳/CH + scan time
speed
Photo coupler insulation between I/O terminals and PLC power supply
Common Isolation
(No isolation between channels)
Connect terminal 9 Points terminals *2 8 Points terminals *2
Internal current
20 ㎃
Consumption
External power DC 21.6 ∼ 26.4V
supply 80 ㎃ 95 ㎃
Remark
7-40
Chapter 7 Usage of Various Functions
No Contents.
RUN LED
①
Indicate the operating status the G7F-ADHA
Analog input terminal
Voltage Input
Current input
CH0 (INPUT) CH0 (INPUT)
V0 I0 COM0 V0 I0 COM0
②
Input
Select Voltage Input Current Input
CHO CH1
③
⑥ ⑦
Right is CH.1selecting Connect upper Connect lower parts by
left is CH. 0 selecting parts by jumper
pins jumper pins.
①
Analog output terminal
Current output
Voltage output
③ ②
④
V+ V- I+ I- V+ V- I+ I-
OUTPUT OUTPUT
7-41
Chapter 7 Usage of Various Functions
(2) G7F-ADHB
No Contents.
RUN LED
①
Indicate the operating status the G7F-ADHB
Analog input terminal
Voltage Input Current input
C CH0 (INPUT)
④ V0 I0 COM0 V0 I0 COM0
②
①
When current input is used, short the V and I terminal.
V0+ I0+ V1+ I1+
V0- I0- V1- I1- Dip switch of analog input
OUTPUT CH0 CH1
Input Select
C
③ h0
C
G7F-ADHB ⑦ 1
⑥ PROGRAMMABLE
LOGIC
CONTROLLER
Right : current input
PWR Left : voltage input
Input INPUT Analog output terminal
CH0 CH1
24V V0 COM0 I1 Current output
24G I0 V1 COM1 Voltage output
③
④
V+ V- I+ I- V+ V- I+ I-
OUTPUT OUTPUT
⑤ ①
7-42
Chapter 7 Usage of Various Functions
3) Parameter setting
4000
4000
800
0 0
0㎃ 20 ㎃ 20 ㎃
-1000 4㎃
Resolution : 20 ㎃/4000 = 5 ㎂
Resolution : 20 ㎃/3200 = 6.25 ㎂
7-43
Chapter 7 Usage of Various Functions
4) Wiring
+ V0
+ V1
input input
I0 I1
COM0 COM1
*1 *1
b) Analog output
Voltage output
V+
2K~1 ㏁
V−
*1
GND
Current output
Less than
I+
510Ω
I−
*1
GND
7-44
Chapter 7 Usage of Various Functions
a) Voltage input
4000
2004
2003
2002
2001
2000
2000
5.0025V
5.000V
0
0V 5V 10V
Analog input voltage Input Voltage
In voltage input, digital amount 0 is output by 0V input and 4,000 is output by 10V input. Therefore input 2.5mV equals to
digital amount 1, but value less than 2.5mV can’t be converted.
b) Current input
4000
2004
2003
Digital output value
Digital output value
2002
2001
2000
2000
10.000 ㎃
10.005 ㎃
0
0㎃ 10 ㎃ 20 ㎃
Analog input current Input Current
Current input 0mA becomes output 0, 10mA does 2000 and 20mA does 4000. therefore input 5 ㎂ equals to digital
amount 1, but value less tan 5 ㎂ can’t be converted. So abandon it.
7-45
Chapter 7 Usage of Various Functions
a) Voltage output
10V
Analog output voltage
5V
Input of digital amount 0 outputs analog amount 0V, 4000 does 10V.Digital input 1 equals to 2.5mV of analog amount.
b) Current output
20 ㎃
Analog output current
10 ㎃
5㎂
10.005
10.000
In current output, digital amount 0 exchanges to 0mA, and 4,000 does 20mA.
Analog amount of digital input 1 equals to 5 ㎂.
7-46
Chapter 7 Usage of Various Functions
6) Program example
a) Program explanation
- When digital value of channel 0 is less than 2000, P090 is on.
- when digital value of channel 0 is more than 3000, P091 is on.
- When digital value of channel 0 is more or same than 2000 or lesser than 3000, P092 is on.
b) System configuration
I/O allocation
Main unit input : P000 ~ P03F
Main unit output : P050 ~ P07F
Expansion module input : P080 ~ P08F
Expansion module output : P090 ~ P09F
c) Program
7-47
Chapter 7 Usage of Various Functions
(2) Program which controls speed of inverter by analog output voltage of 5 steps
a) Program explanation
-.When P80 becomes On, 2000 (5V) is output.
-. When P81 becomes On, 2400 (6V) is output.
-.When P82 becomes On, 2800 (7V) is output.
-.When P83 becomes On, 3200 (8V) is output.
-.When P84 becomes On, 3600 (9V) is output.
b) System configuration
c) Program
7-48
Chapter 7 Usage of Various Functions
1) Performance specifications
Item Specifications
Voltage 0∼10VDC ( input resistance 1 ㏁ )
DC 4∼20 ㎃ ( input resistance 250Ω )
Current
Analog DC 0∼20 ㎃ ( input resistance 250Ω ))
input -.Setting by input terminal
Voltage/Current
(When current input is used, short the V and I terminal)
Selection
- Voltage/Current is selected by KGLWIN parameter
Digital output 12bit binary (0∼4000)
0∼10VDC 2.5 ㎷ (1/4000)
Maximum
DC 0∼20 ㎃ 5 ㎂ (1/4000)
resolution
DC 4∼20 ㎃ 5 ㎂ (1/3200)
Overall accuracy ±0.5% [Full Scale]
Max. conversion speed 1 ㎳/CH + scan time
Max. absolute input Voltage : ±15V, Current : ±25 ㎃
Number of analog input point 4channels/1module
Between input terminal and PLC power supply
Isolation : Photo coupler isolation
(No isolation between channels)
Terminal connected 2 points/16 points terminal block
Current
+5V 100mA
Consumption
Voltage DC 21.6 ~ 26.4V
External Power
supply Current
100 ㎃
consumption
Weight 300g
Remark
7-49
Chapter 7 Usage of Various Functions
No Contents
RUN LED
①
Indicate the operating status the G7F-AD2A
Analog input terminal
Voltage input Current input
④ ①
CH0 CH0
V0 COM0 V0 COM0
②
I0 · I0 ·
24V 24G
Input
V I
7-50
Chapter 7 Usage of Various Functions
3) Parameter setting
4) Wiring
(2) Wiring
V0 V1
Analog Analog
Input
I0 I1
Input
COM0 COM1
*1 *1
7-51
Chapter 7 Usage of Various Functions
a) Voltage input
4000
2004
2002
Digital Output Value
2001
2000
2000
5.000V
5.0025V
0
0V 5V 10V Voltage Input
In voltage input, digital amount 0 is output by 0V input and 4,000 is output by 10V input. Therefore input 2.5mV equals
to digital amount 1, but value less than 2.5mV can’t be converted.
b) Current input
4000
2004
2003
Digital Output Value
Digital Output Value
2002
2001
2000
2000
10.000 ㎃
10.005 ㎃
0
0㎃ 10 ㎃ 20 ㎃
Current Input
Analog Input Current
Current input 0mA becomes output 0, 10mA does 2000 and 20mA does 4000. therefore input 5 ㎂ equals to digital
amount 1, but value less tan 5 ㎂ can’t be converted. So abandon it.
7-52
Chapter 7 Usage of Various Functions
6) Program example
(1) Distinction program of A/D conversion value(Analog input range: DC4∼20 ㎃, 0~10VDC)
ⓒ System configuration
Main Unit A/D conversion module Expansion module
I/O allocation
Main unit input : P000 ~ P03F
Main unit output : P050 ~ P07F
Expansion module input : P080 ~ P08F
Expansion module output : P090 ~ P09F
7-53
Chapter 7 Usage of Various Functions
(c) Program
7-54
Chapter 7 Usage of Various Functions
1) Performance specifications
The performance specifications of the analog output module are following.
Specifications
Item
G7F-DA2I G7F-DA2V
DC 0∼20 ㎃( Load resistance 510Ω)
Output Range DC 4∼20 ㎃( Load resistance 510Ω) DC 0 ~ 10V(Lod resistance 2 ㏀∼1 ㏁)
Classified by parameter
Digital Output 12bit (0∼4000)
Number of output 4channels/1module
Max. absolute output DC +24 ㎃ DC 12V
Maximum DC 0∼20 ㎃ : 5 ㎂ (1/4000)
2.5 ㎷ (1/4000)
resolution DC 4∼20 ㎃ : 6.25 ㎂ (1/3200)
Overall accuracy ±0.5% [Full Scale]
Max. conversion speed 0.5 ㎳/CH + scan time 1 ㎳/CH + scan time
Between input terminal and PLC power supply: Photo coupler isolation
Isolation
(No isolation between channels)
Terminal connected 16 points terminal block 8 points terminal block * 2
Current
20mA 15mA
Consumption
Voltage DC 21.6 ~ 26.4V
External
Power supply Current
80 ㎃ 90 ㎃
consumption
Weight 280g 160g
7-55
Chapter 7 Usage of Various Functions
③ ① ③
①
24V 24G
Inpu
G7F-DA2I
PROGRAMMABLE
LOGIC ⑤ G7F-DA2V
PROGRAMMABLE
⑤
CONTROLLER
LOGIC
CONTROLLER
24V CH0 CH1 CH2 CH3 PWR
24V I+ I+ I+ I+
④ 24G I- I- I- I- · ④ V0+ V1+ V2+ V3+
V0- V1- V2- V3-
② ②
G7F – DA2I G7F – DA2V
RUN LED
①
Indicate the operating status the G7F-DA2I
7-56
Chapter 7 Usage of Various Functions
3) Parameter setting
7-57
Chapter 7 Usage of Various Functions
5) Scaling function
The scaling function is the same that of A/D, D/A combination module.
6) Wiring
(2) Wiring
CH0
I+
510Ω
I−
*1
GND
CH3
I+ Less than
I− 510Ω
*1 GND
Remark
The common grounding with other devices is permitted when D/A conversion module is used as current
output type.
. CH 0
Devices
5
D/A 6
CH 3
11
D/A 12
+15V
DC/DC 1 DC +24V
AGND 2 DC 0V
Converter
-15V
7-58
Chapter 7 Usage of Various Functions
(1) G7F-DA2I
a) 0~20mA output
20 ㎃
Output current
Output current
10 ㎃
5㎂
10.005 ㎃
10.000
Digital amount 0 outputs analog amount 0mA, 4000 does 20mA.Digital input 1 equals to 5 ㎂ of analog amount.
b) 4~20mA output
20mA
Output voltage
Output voltage
12mA 6.25 ㎂
12.006
12.000
Digital amount 0 outputs analog amount 4mA, 4000 does 20mA.Digital input 1 equals to 6.25 ㎂ of analog amount.
7-59
Chapter 7 Usage of Various Functions
8) Program example
(1) Program which controls speed of inverter by analog output voltage of 5 steps(0 ~ 20mA output)
a) Program explanation
• When P80 becomes On, 2000 (10mA) is output.
• When P81 becomes On, 2400 (12mA) is output.
• When P82 becomes On, 2800 (14mA) is output.
• When P83 becomes On, 3200 (16mA) is output.
• When P84 becomes On, 3600 (18mA) is output.
b) System configuration
Main Unit D/A conversion module Expansion module
I/O allocation
Main unit input : P000 ~ P03F
Main unit output : P040 ~ P07F
Expansion module input : P080 ~ P08F
Expansion module output : P090 ~ P09F
c) Program
7-60
Chapter 7 Usage of Various Functions
1) Performance specification
The performance specification of the analog timer module are following.
Item Specification
Number of channels 4
Output value range 8 Bit (Digital output range: 0 ∼ 200)
Setting type Setting by variable resistance
Accuracy of timer ±2.0% (Accuracy about max. value)
Operation method Storing data register automatically
Internal current consumption 50 ㎃
Number of module installment Max 3 modules
Weight 200g
③ ④
7-61
Chapter 7 Usage of Various Functions
3) Program example
(3) Program
7-62
Chapter 7 Usage of Various Functions
1) Performance specification
The performance specification of the RTD input module are following.
Item Specification
Pt 100 (JIS C1640-1989, DIN 43760-1980)
Connectable RTD
JPt100 (KS C1603-1991, JIS C1604-1981)
Pt 100 : -200 ~ 600℃ (18.48 to 313.59Ω)
Temperature input range
JPt100 : -200 ~ 600℃ (17.14 to 317.28Ω)
Digital conversion value : 0 to 4,000
Digital output
Detected temperature value : -2000 to 6000 (one digit after point * 10)
Burn out detection Each of three wires at every channel has detection function.
Accuracy ±0.5% [Full Scale]
Maximum conversion
40 scan / 1 module
speed
Number of temperature
4Channel / 1module
input device points
Photo-coupler insulation between the input terminal and the PLC power
Insulation method
supply (non-insulation between channels)
Connection terminal block 8-point terminal block * 2
Current consumption 25 ㎃
External power Voltage DC21.6 ∼ 26.4V
supply Current 70 ㎃
Weight 240g
③ ②
No Name Contents
① ① RUN LED Indicate the operating status the G7F-RD2A
24V A b B
24G B A b RTD input
Input CH2 CH3 ② Terminal which connects Pt100 or JPt100
terminal
External power
③ External voltage 24VDC needs to this terminal
⑤ input terminal
④ G7F-RD2A
PROGRAMMABLE
LOGIC This cable is used to connect while RTD input
CONTROLLER ④ Extension cable
PWR module is used
CH0 CH1 Extension cable The connector connects extension cable when
A b A b ④
B · B · connector extended module is used.
3) Parameter setting
bF bE bD bC bB bA b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
D4880
CH1 CH0
The RTD input module, as shown below, linearlizes the non-linear characteristic resistance input of the RTD
The RTD input module, as shown below, outputs digital converted value of detected temperature value.(Range 0 ~ 4000)
4000
Example) Assume that Detected temperature value(D4980) is 2345, then real temperature = 234.5℃, and Digital
conversion value(D4770) is (2345+2000)/2 = 2172.
7-65
Chapter 7 Usage of Various Functions
The RTD input module has the function of burn-out detection on the Pt100, JPt100 or cable.
• As shown below, if disconnection occurs in the RTD or cable then a voltage outside the measurable range voltage is
inputted by the internal burn-out detection circuit and burn-out detection error code is generated.
• The RTD input module can detect disconnection for each channel. But, burn-out detection is possible only in the
channels enabled.
• If disconnection is detected in two or more wires, first, disconnection error code is generated by ‘b’ and then
disconnection error code is generated by ‘A’ or ‘b’ sequentially. If disconnection is detected simultaneously in ‘A’ and
‘B’, only disconnection error code is generated by ‘b’.
Connection
Connection Example Remark
Method
2-wire burn-out detection area
- In 4-wire type, only all wires marked '2'
type
connected to the terminal block A are all
detected as disconnection then the A
disconnection error can be detected.
type
type
No wiring *1 : Pt
*2: Shield wire
7-66
Chapter 7 Usage of Various Functions
9) Wiring
Connection
Connection Example Wire Conditions
Method
2-wired type
wire resistance≤10Ω
wire resistance≤10Ω
wire resistance≤10Ω
3-wired type
7-67
Chapter 7 Usage of Various Functions
a) Program explanation
The present A/D conversion value of the detected temperature value which is detected from the temperature-measuring
resistor Pt 100 is displayed on the BCD digital display by use of channel 0 of the temperature-measuring resistor input
module. The lamp turns on when the detected temperature value is a negative number and turns off when it is a positive
number
b) System configuration and parameter setting
Detected temperature
c) Program
7-68
Chapter 7 Usage of Various Functions
The DRT/DT type of MASTER-K120S series support 2 axes of positioning function. The purpose of positioning function is to
transfer the moving objects by setting speed from the current position and stop them on the setting position correctly. And it also
control the position of high precision by positioning pulse string signal as it is connected to various servo running devices or
stepping motor control running devices.
Pulse
Direction M
Motor
Driver
K7M-DRT/DTxxU
7.3.1 Specification
1) Performance Specification
Items Specification
No. of control axis 2 axes
Control method PTP(Point-To-Point), speed control
Control unit Pulse
Positioning data 20 data per each axis( Operation step No. : 1 ∼ 20)
Positioning method Absolute / Incremental method
Address range -2,147,483,648 ∼ 2,147,483,647
Speed Max. 100kpps , Speed setting range : 5 ∼ 100,000pps(unit of pulse)
Operation pattern : Trapezoidal method
Acceleration/
Positioning Acceleration time : 0 ∼10,000 ㎳(unit of 1ms)
Deceleration method
Deceleration time : 0 ∼10,000 ㎳(unit of 1ms)
Backlash compensation 0 ~ 1,000 Pulse
Bias speed 5 ∼ 100,000pps
Speed limit 5 ∼ 100,000pps
Operation mode End, Keep, Continuous operation
Operation method Single, Repeated operation
High speed Speed setting range: 5 ∼ 100,000pps
Speed
Low speed Speed setting range: 5 ∼ 100,000pps
Return to Dwell time Setting range : 0∼10,000 ㎳
origin 1 Origin detection when approximate origin turns off
Method 2 Origin detection after deceleration when approximate origin turns on.
3 Origin detection by approximate origin
High speed Speed setting range: 5 ∼ 100,000pps
JOG Speed
Low speed Speed setting range: 5 ∼ 100,000pps
Period setting range: 1 ∼ 20,000 ㎳
PWM Output
Duty setting range: 0 ∼ 100%
7-69
Chapter 7 Usage of Various Functions
Signal Name Rated load voltage Load voltage range Max. load current Max. voltage drop during On
DC 12/24V DC 10.2∼26.4V 100 ㎃ ≤DC 0.3V
Positioning
Forward direction Reverse direction
CW/Pulse
CCW/Directio
n
⑤ ①⑤ ② ⑤ ③④ ⑥ Motor driver
Direction pulse
COM
Pulse output
Remark
Positioning function is sensitive to the external noise and should be handled with special care.
1) Be sure to use shielded twisted pair cables. Also provide Class 3 grounding
2) Do not run a twisted pair cable in parallel with power cables or other I/O lines which may generate noise
3) Before applying a power source for pulse generator, be sure to use a noise-protected power supply
7-70
Chapter 7 Usage of Various Functions
Internal
COM1 – Output common 1
circuit
P42 – Direction pulse(Ch0)
Motor driver
For Ch0
P (24V)
R
COM0 Output common 0
P41 pulse output(Ch1) R
R
Internal COM1 Output common 1 Motor driver
For Ch1
circuit (24V)
P42 Direction pulse(Ch0)
R
R
P43 Direction pulse(Ch1)
R
COM2 Output common 2 R
- +
DC 24V
7-71
Chapter 7 Usage of Various Functions
1) Positioning function
Positioning Control includes position control, speed control.
Example] When Start address is 1000 and goal address is 8000, this will be forward direction and transfer amount
shall be 7000 (7000=8000-1000).
0 1000 8000
Items of positioning data Step No. Coordinate Operation mode Operation method Goal address Speed(pps) Dwell time(㎳)
Setting 1 Absolute End Single 8,000 5,000 100
Start Address
Normal Reverse
Transfer direction when transfer amount (-) Transfer direction when transfer amount (+)
Example) When start address is 5000 and goal address is -7000, this will be reverse direction and positioning will be at
the point of 2000
-2000 0 5000
• Parameter setting
Items of positioning data Step No. Coordinate Operation mode Operation method Goal address Speed(pps) Dwell time(㎳)
Setting 1 Incremental End Single -7,000 5,000 100
7-72
Chapter 7 Usage of Various Functions
• Timing diagram
Speed
Setting speed
Dwell time
Time
On
Speed control command
(POSVEL)
On
Remark
7-73
Chapter 7 Usage of Various Functions
2) Operation pattern
• Operation pattern describes various configuration for how to operate the positioning data using several operation step no
and how to determine the speed of position data.
• Operation mode types are as follows
7-74
Chapter 7 Usage of Various Functions
3) Operation Mode
Speed
Dwell time
Time
On
Start command
(POSIST)
Speed
Operation Operation
step no.: 1 Operation step no.: 3 Operation
step no.: 2 step no.: 4 Time
On
Start command
• Parameter setting
7-75
Chapter 7 Usage of Various Functions
Speed
Start command
(POSIST)
Dwell time Dwell time
• Parameter setting
7-76
Chapter 7 Usage of Various Functions
Speed
Operation step 2
On
Start command
(POSIST)
• Parameter setting
7-77
Chapter 7 Usage of Various Functions
4) Operation Method
Start command
(POSIST)
• Parameter setting
7-78
Chapter 7 Usage of Various Functions
5) Positioning start
6) Positioning stop
7-79
Chapter 7 Usage of Various Functions
• The items that effects to the origin return from parameter are as follows.
(A) Origin return speed (high speed, low speed)
(B) Origin return dwell time
Speed
Deceleration when approximate return “ON”
Origin return high speed
Time
Transfer amount after approximate origin “ON”
Origin return
command
7-80
Chapter 7 Usage of Various Functions
Speed
Deceleration when approximate return “ON”
Time
Transfer amount after approximate origin “ON”
Origin return
command
Normal rotation
Direction conversion at the rising edge of approximate origin signal
Origin return high speed Direction conversion at the falling edge of approximate origin signal
Origin return low speed
Time
Origin determination
Reverse rotation
Origin return
command
Origin determined
state
7-81
Chapter 7 Usage of Various Functions
Time
Speed
Time
(B) If speed operand of POSJOG command as device not constant, JOG speed can be changed from low speed to high
speed or high speed to low speed during operation
(C) If Jog speed is set out of the setting range, error will occur and the operation does not work.
Remark
If POSSOR is executed in deceleration section, error code H44 will occur and continues operation
7-82
Chapter 7 Usage of Various Functions
High Low
The range available to positioning
Stopper Stopper
Transfer direction Transfer direction
Start Start
K120S
Driver
• If positioning module stops out of the range available to control, the positioning operation does not work.
If it stops by external input stroke limit detection, move within the range of positioning module available to control by
manual operation (Jog operation).
• As external input stroke high/low limit error is detected by the edge of positioning module, it is available to release the
output prohibit out of stroke range and carry out manual operation.
• The flags related with external input stroke limit are as followings.
- F284(Ch0) Off : External input stroke Low limit has not detected, On : External input stroke Low limit has detected
- F285(Ch0) Off : External input stroke High limit has not detected, On : External input stroke High limit has detected
- F304(Ch1) Off : External input stroke Low limit has not detected, On : External input stroke Low limit has detected
- F305(Ch1) Off : External input stroke High limit has not detected, On : External input stroke High limit has detected
Point
If external input stroke High/Low limit signal is occur during origin return, it stops operation immediately,
Then, changes direction and continues origin return operation.
7-83
Chapter 7 Usage of Various Functions
• Timing diagram
1) Unused the M Code Output
Continues End
Positioning
Indirect start
Completed Flag
Continues End
Positioning
Indirect start
Completed Flag
M1911
M1912
7-84
Chapter 7 Usage of Various Functions
1) Positioning parameter
• Positioning parameter setting
• Parameter should be assigned for each axis
Basic parameter
7-85
Chapter 7 Usage of Various Functions
Gear
1m movement right side (normal)
Direction change
1m movement left side (reverse) Backlash
Backlash
Speed
Speed limit
Bias speed Positioning speed
setting action Origin return speed
JOG Speed Bias speed not-setting
Interpolation operation action
speed
Bias speed
Time
Acceleration Deceleration
time time
7-86
Chapter 7 Usage of Various Functions
Ch 0 Ch 1
DOG P0005 P0007
Origin P0004 P0006
Remark
When setting the origin return speed, it is recommended to set the origin return-low speed as low speed as
possible. If setting the low speed as “too fast”, it may cause the incorrect origin signal detection.
7-87
Chapter 7 Usage of Various Functions
2) Positioning parameter
Here describes Positioning parameter
Remark
If step No. set to 0, operating step increase to next step automatically when current operation step finished
7-88
Chapter 7 Usage of Various Functions
(2) Coordinate
• The coordinate of position data includes Absolute and Incremental
(A) Absolute Coordinate (Control by Absolute method)
① This carries out the positioning control from the current position to the goal position (the goal position assigned by
positioning data).
② Positioning control is carried out based on the assigned position of origin return or POSPRS command
(origin address).
③ Transfer direction shall be determined by the current position and goal position.
- Start position < Goal position : forward direction positioning
- Start position > Goal position : reverse direction positioning
Current position
Reverse Normal
Transfer direction when transfer amount is (+) Transfer direction when transfer amount is (-)
7-89
Chapter 7 Usage of Various Functions
(6) Speed
• Operation speed can be assigned for each operation step No.
• Setting range of operation speed : 5 ~ 100,000( Setting unit: 1pps )
• The change of speed value is available when assigned by D area
7-90
Chapter 7 Usage of Various Functions
7.3.4 Instructions
■ POSIST S n
(1) Functions
• When input condition turns on, corresponding positioning control starts from assigned step No.
• Positioning operation is edge triggered.
(2) Example program
• When input condition turns on, Ch.0 starts positioning from Step no.1
7-91
Chapter 7 Usage of Various Functions
2) JOG Operation(POSJOG)
n1 ○ ○ ○ ○ ○ ○ ○ 7 ○
n2 ○ ○ ○ ○ ○ ○ ○
■ POSJOG S n1 n2
(1) Functions
• When input condition turns on, corresponding Ch. Starts JOG operation.
• If input condition turns off, corresponding Ch stops JOG operation.
• The speed can be changed during operation but the direction can’t be changed.
7-92
Chapter 7 Usage of Various Functions
S Channel designation(0~1)
Error Control instruction designation
Error flag turns on when designating area is over
(F110) n1 0: Deceleration stop. 1:Emergency stop.
2: Error reset
■ POSCTR S n1
(1) Functions
• Operates designated control operation at the rising edge of input condition.
- Deceleration stop : Stops positioning after deceleration
- Emergency stop : Stops positioning immediately without deceleration
- Error Reset : Resets occurred error and output prohibition signal.
7-93
Chapter 7 Usage of Various Functions
S Channel designation(0~1)
Error
Error flag turns on when designating area is over Preset value designation
(F110) SV1
(-2,147,483,648 ~ 2,147,483,647)
■ POSPRS S SV1
(1) Functions
• Current address is changed to preset value at the rising edge of input condition.
7-94
Chapter 7 Usage of Various Functions
SV1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ 7 ○
SV2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
Positioning Ch 1(P41)
450ms 50ms
Input condition(M0000)
500ms
7-95
Chapter 7 Usage of Various Functions
n1 ○ ○ ○ ○ ○ ○ ○ ○ 7/9 ○
SV ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
■ POSVEL S n1 SV
(1) Functions
• When input condition turns on(Rising edge), Corresponding Ch. Starts speed control by designated direction and speed.
7-96
Chapter 7 Usage of Various Functions
■ POSSOR S SV
(1) Functions
• When input condition turns on(Rising edge), Operation speed of corresponding Ch. changed to designated speed.
• This instruction is valid to current operating channel only
• Speed changing within deceleration section is not available.
7-97
Chapter 7 Usage of Various Functions
n1 ○ ○ ○ ○ ○ ○ ○ ○
9/11/13 ○
SV1 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
SV2 ○ ○ ○ ○ ○ ○ ○ ○ ○ ○
7-98
Chapter 7 Usage of Various Functions
9) Return to origin(POSORG)
n1 ○ 7 ○
SV ○
■ POSORG S n1 SV
(1) Functions
• When input condition turns on, corresponding origin return operation starts(Rising edge trigger)
• After operation, Current address is preset to designated origin address
7-99
Chapter 7 Usage of Various Functions
1) Flag list
F0282 End of positioning Indicates end of operation for Ch0 (0: operating, 1: End) *1Scan On
F0283 End of Origin return Indicates end of origin return operation of Ch0(0:operating, 1: End)
F0284 Low limit detection Indicates stroke low limit detection of Ch0
F0285 High limit detection Indicates stroke high limit detection of Ch0
F0286 Emergency stop status Indicates emergency stop status Ch0 (0: enable, 1: Disable)
F0302 End of positioning Indicates end of operation for Ch1 (0: operating, 1: End) *1Scan On
F0303 End of Origin return Indicates end of origin return operation of Ch1(0:operating, 1: End)
F0304 Low limit detection Indicates stroke low limit detection of Ch1
F0305 High limit detection Indicates stroke high limit detection of Ch1
F0306 Emergency stop status Indicates emergency stop status Ch1(0: enable, 1: Disable)
7-100
Chapter 7 Usage of Various Functions
7-101
Chapter 7 Usage of Various Functions
2) Error code
Error
Condition Operation Corrective action
code
H10 Acceleration time of basic parameter is out of range Stop Set Acceleration time within 0~10,000 range
H11 Deceleration time of basic parameter is out of range Stop Set Deceleration time within 0~10,000 range
H12 Speed limit of basic parameter is out of range Stop Set speed limit within 5~ 100,000 range.
H13 Bias speed of basic parameter is out of range Stop Set bias speed within 5 ~ 100,000 range.
H14 Backlash compensation of basic parameter is out of range Stop Set backlash compensation within 0~ 1,000 range
H15 JOG high speed of parameter is out of range Stop Set JOG high speed within bias speed ~ speed limit
H16 JOG low speed of parameter is out of range Stop Set JOG high speed within 5 ~ JOG high speed
H17 Origin return high speed of parameter is out of range Stop Set Origin return high speed within bias speed ~ speed limit
H18 Origin return low speed of parameter is out of range Stop Set Origin return low speed within bias speed ~ Origin return high speed
H19 Dwell time of parameter is out of range Stop Set Dwell time within 0 ~ 10000.
H20 Operation speed of positioning parameter is out of range Stop Set Operation speed within bias speed ~ speed limit
H21 Dwell time of pulse out parameter is out of range Stop Set Dwell time of pulse out parameter within 0 ~ 10000
H30 POSIST command can’t be executed during operation Operating Check if positioning operation is executing when POSIST signal occur.
H33 Step No. of POSIST command can’t be over 20 Stop Set step No. within 0~20
H34 POSDST command can’t be executed during operation Operating Check if positioning operation is executing when POSDST signal occur.
POSDST command can’t be executed when output is Check if output is prohibited when POSDST signal occur. Output can be
H35 Stop
prohibited enabled by POSCTR command.
POSDST command can’t be executed when origin is not Check if origin is not designated when POSDST signal occur.
H36 Stop
determined Origin can be designated by POSORG or POSPRS command.
H37 Operation speed of POSDST command is out of range Stop Set Operation speed within 5 ~ speed limit
H38 POSVEL command can’t be executed during operation Operating Check if positioning operation is executing when POSVEL signal occur.
POSVEL command can’t be executed when output is Check if output is prohibited when POSVEL signal occur. Output can be
H39 Stop
prohibited enabled by POSCTR command.
H3A Operation speed of POSVEL command is out of range Stop Set Operation speed within 5 ~ speed limit
H3B POSJOG command can’t be executed during operation Operating Check if positioning operation is executing when POSJOG signal occur.
POSJOG command can’t be executed when output is Check if output is prohibited when POSJOG signal occur. Output can be
H3C Stop
prohibited enabled by POSCTR command.
H3D Direction can’t be changed in JOG operation Operating Change direction after JOG operation end.
H3E PWM command can’t be executed during operation Operating Check if positioning operation is executing when PWM signal occur.
Check if output is prohibited when PWM signal occur. Output can be enabled
H3F PWM command can’t be executed when output is prohibited Stop
by POSCTR command.
H40 PWM period of PWM command is out of range Stop Set period within 1 ~ 20,000
H41 Off duty of PWM command is out of range Stop Set duty within 0 ~ 100
H42 POSSOR command is available during operating only Stop Check if positioning operation is not executing when POSSOR signal occur.
H43 Speed override value of POSSOR command is out of range Operating Set override value within 5 ~ speed limit
7-102
Chapter 7 Usage of Various Functions
Error
Condition Operation Corrective action
code
Check if positioning is in the decelerating section when POSSOR signal
H44 POSSOR command can’t be executed during decelerating Operating
occur.
H45 POSORG command can’t be executed during operation Operating Check if positioning operation is executing when POSORG signal occur.
POSORG command can’t be executed when output is Check if output is prohibited when POSORG signal occur. Output can be
H46 Stop
prohibited enabled by POSCTR command.
H49 POSORG command can’t be executed when JOG operating Operating Check if JOG operation is executing when deceleration stop command occur
H50 POSPRS command can’t be executed during operation Operating Check if positioning operation is executing when POSPRS signal occur
H51 Direction can’t be changed in continuous operation Stop Set operation mode as end or keep mode
Get rid of the external upper limit signal range by POSJOG command and
H53 Stroke high limit error Stop then carry out POSCTR command and clear the error. Output prohibit shall
Get rid of the external lower limit signal range by POSJOG command and then
H54 Stroke low limit error Stop carry out RST command and clear the error. Output prohibit shall be released
Install the upper limit detection sensor in the direction that the current
H55 The position of High/Low limit detection Sensor has been changed. Stop position increases and the lower limit detection sensor in the direction that the
7-103
Chapter 7 Usage of Various Functions
7.3.6 Wiring with servo and stepping motor driver (Open Collector)
1) Wiring with stepping motor driver(DC 5V)
Max : 2m *4
K7M-DRT**U
Stepping Motor Driver
Signal name Ch0 Ch1
Pulse P40 P41 CW-
Common COM0 COM1 CW+
*2
Direction P42 P43 CCW-
Common COM2 COM2 CCW+
Input +24V P P DC5V
*1
Origin P04 P06 TIMING
DOG P05 P07 COM
Low limit P00 P02
High Limit P01 P03
*3 Emergency stop Input Point
DC5V
Common COM0(Input)
*1
Origin P04 P06 TIMING
DOG P05 P07 COM
Low limit P00 P02
High Limit P01 P03
*3 Emergency stop Input Point
DC24V
Common COM0(Input)
Remark
1 ) In case of VEXTA RK series, TIMMING output turns on when a motor rotates at every 7.2 degree.
For exact ‘return to origin’, we suggest you to configure ‘AND’ operation using TIMMING output and DOG
sensor. It may be different to each system features to return to origin by the DOG sensor without TIMMING
output signal (The rated input for the origin of K120S is DC 24V.)
2) Using DC 24V, wire a proper resistor to driver in series.
3) Input points for origin, approximate origin point, and upper/lower limit signal are fixed but, if they’re not used you
able to use them general input point. You can use emergency stop with the command(POSCTR)
4) Positioning phase of K120S is as follow: Set the input mode of a step mode driver to 1 phase input mode
because motor operation mode is determined by rotating direction input.
7-104
Chapter 7 Usage of Various Functions
HC-MF HA-FF
Series motor
NF MC MR-J2S- A
TE11 U
L1 U
Power V
L2 V SM
3Phase 200VAC W
L3 W
E
L11
L21 PE
EMG B1
CTE2 PE
D
P 24VDC B2 electronic brake
SG 10 Plate ER
SG 20 Within 2m
VDD 3
COM 13
RA1
failure ALM 18
zero speed detection RA2
ZSP 19
in torque limit RA3 TLC 6
P15R 11
Analog torque limit
TLA 12
+10V/max. current
LG 1
SD Plate
Within 2m
Remark
7-105
Chapter 7 Usage of Various Functions
*4
K7M-DRT**U Max 2m
FDA-5000
Signal name Ch0 Ch1 *3
Pulse P40 P41 10 PFIN
Common COM0 COM1 1.5K,1/2W 11 PPFIN
Direction P42 P43 12 PRIN
Common COM2 COM2 24G P24V 1.5K,1/2W 9 PPRIN
Input +24V P P
Origin P04 P06 5 PZO+
SSR 30 PZO-
21 RDY
*1
DOG P05 P07 22 INPOS
Low Limit P00 P02 47 0 SPEED
*2
High Limit P01 P03 48 BRAKE
Emergency Stop Input point 20 ALARM
45 A_CODE0
Common COM0(Input) P24V 19 A_CODE1
44 A_CODE2
24 GND24
25 GND24
18 SVONEN
38 CLR
15 CCWLIM
40 CWLIM
39 ESTOP
38 ALMRST
24G 41 P/P1
14 TLIM
49 +24VIN
Remark
1) The rated input for the origin of K120S is DC 24V. Linedriver output, wire a DC SSR and return to origin by DOG
signal or using a origin sensor of original signal.
2) Input points for origin, approximate origin point, and upper/lower limit signal are fixed but, if they’re not used you
able to use them general input point. You can use emergency stop with the command(POSCTR)
3) Using DC 24V, wire a proper resistor(1.5K, 1/2W) to driver in series.
4) Positioning phase of K120S is as follow: Set the input mode of a step mode driver to 1 phase input mode
because motor operation mode is determined by rotating direction input.
7-106
Chapter 8 Communication Functions
8.1.1 Introduction
MASTER-K120S’s built-in Cnet communication uses only MASTER-K120S main unit for a dedicated communication. That is, it
doesn’t need a separate Cnet I/F module to facilitate the user-intended communication system by utilizing reading or writing of
any area in CPU, and monitoring function.
Remark
MASTER-K120S built-in communication function supports Cnet communication without any separate Cnet I/F module.
It must be used under the following instructions.
1) Channel 0 of MASTER-K120S main unit supports 1:1 communication only. For 1:N system having master-slave
Format, use RS-485 communication in channel 1 or MASTER-K120S main unit with G7L-CUEC module connected.
G7L-CUEC module supports RS-422/485 protocol.
2) RS-232C communication cable for MASTER-K120S main unit is different from RS-232C cable for KGLWIN in pin
arrangement and from the cable for Cnet I/F module, too. The cable can’t be used without any treatment. For the
detailed wiring method, refer to 8.1.2.
It’s possible to set baud rate type and station No. in KGLWIN.
8-1
Chapter 8 Communication Functions
According to the method of connection, the system using MASTER-K120S built-in communication can be composed.
RS-232C interface
b) Wiring method
MASTER-K120S main
PC
Pin assignment And direction unit
1 1 5V
1 2 2 RXD1
6
2
7 3 3 TXD1
3
8
4 4 4 RXD2
9
5
5 5 SG
6 6 5V
7 7 TXD2
Female Type 8 8 SG
9 9 SG
TXD1, RXD1 are for loader communication and TXD2, RXD2 are for Cnet
8-2
Chapter 8 Communication Functions
RS-485 interface
RS-232C interface
MASTER-K120S main
PMU
Pin assignment and direction unit
1 1 5V
1 2 2 RXD1
6
2
7
3
3 3 TXD1
8
4 4 4 RXD2
9
5
5 5 SG
6 6 5V
7 7 TXD2
Female Type 8 8 SG
9 9 SG
485+ 485+
485- 485-
8-3
Chapter 8 Communication Functions
.
RS-232C interface
RS-485 interface
MASTER-K120S
MASTER-K120S main unit
main unit Pin assignment and direction
Pin no. Pin no. Signal
1 1 5V
5
2 2 RXD1
9
4 3 3 TXD1
8
3
7 4 4 RXD2
2
6
1 5 5 SG
6 6 5V
7 7 TXD2
8 8 SG
Male Type
9 9 SG
MASTER-K120S main unit Connection method and signal direction MASTER-K120S main unit
485+ 485+
485- 485-
8-4
Chapter 8 Communication Functions
1) Base Format
(1) Request frame(external communication device → MASTER-K120S main unit), (Max. 256 Bytes)
(2) ACK Response frame (MASTER-K120S main unit → external communication device, when receiving data normally)
(max. 256 Bytes)
(3) NAK Response frame (MASTER-K120S main unit → external communication device,
when receiving data abnormally) (max. 256 Bytes)
Remark
1) Used control codes are as follows. Be familiar with the following control codes. Because they are importantly
used for communication.
8-5
Chapter 8 Communication Functions
Remark
1) The numerical data of all frames are ASCII codes equal to hexadecimal value, if there’s no clear statement.
The terms in hexadecimal are as follows.
• Station No.
• When the main command is R(r) or W (w) and the command type is numerical (means a data type)
• All of the terms indicating size of all data in the Formatted data area.
ENQ Station No. Command Fomatted data EOT BCC (PLC ACK response)
8-6
Chapter 8 Communication Functions
Classification Command
Main command Command type Treatment
Items Code ASCII code Code ASCII code
H72
Individual r(R) SS 5353 Reads data from device of Bit, Byte, Word type.
Reading (H52)
device H72 Reads device Word in block unit.
Continuous r(R) SB 5342 (Continuous reading Bit is unavailable)
(H52)
H77
Individual w (W) SS 5353 Writes data to device of Bit, Byte and Word type.
Writing (H57)
device H77 Writes data to Byte and Word type in block unit.
Continuous w(W) SB 5342 (Continuous reading Bit is unavailable)
(H57)
CPU H73 Reads flag list like PLC operation status and error
r(R) ST 5354
Status reading (H53) information.
Command
Classification
Main command Register No. Treatment
Item Register
Code ASCII code ASCII code
no.
Monitoring variable H78
x(X) H00~H09 3030 ~ 3039 Register device to monitor.
register H58
Execution of H79
y(Y) H00~H09 3030 ~ 3039 Execute registered device to monitor.
monitoring (H59)
Remark
MASTER-K120S main unit identifies capitals or small letters for main commands, but not for the others.
8-7
Chapter 8 Communication Functions
It’s possible to read and write device in built-in communication. When device is used, be aware of data type.
Remark
1) Timer/Counter used in bit command means contact point values.(word command means current values.)
2) Data register and Step relay can uses only word or byte commands.
3) In byte type commands, address is doubled
For example, D1234 is addressed to ‘%D1234’ in word type, and is addressed to ‘%2468’ in byte type.
8-8
Chapter 8 Communication Functions
(1) Introduction
This is a function that reads PLC device specified in accord with memory data type. Separate device memory can be read
up to 16 at a time.
Ex. of frame ENQ H20 R(r) SS H01 H06 %MW100 EOT BCC
ASCII value H05 H3230 H52(72) H5353 H3031 H3036 H254D57313030 H04
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
each to ASCII values from ENQ to EOT is converted into ASCII and added to BCC. For
BCC example, the BCC of the above frame is gotten as below:
H05+H32+H30+H72+H53+H53+H30+H31+H30+H36+H25+H4D+H57+H31+H30+H30+H04
=H03A4 Therefore BCC value is A4.
This specifies how much of the blocks composed of "[device length][device name]" are in this
Number of
request format. This can be set up to 16. Therefore, the value of [Number of blocks] must be
Blocks
set between H01(ASCII value:3031)-H10(ASCII value:3030).
This indicates the number of name's characters that means device, which is allowable up to 16
Device length
characters. This value is one of ASCII converted from hex type, and the range is from
(Length of
H01(ASCII value:3031) to H10(ASCII value:3130). For example, if the device name is %MW0,
device name)
it has 4 characters to be H04 as its length. If %MW000 characters to be H06.
Address to be actually read is entered. This must be ASCII value within 16 characters, and in
Device name
this name, digits, upper/lower case, '%' only is allowable to be entered.
Remark
‘H’ of example frame represents hex value, and is unnecessary during preparing real frame.
8-9
Chapter 8 Communication Functions
Ex. of frame ACK H20 R(r) SS H01 H02 HA9F3 ETX BCC
ASCII value H06 H3230 H52(72) H5353 H3031 H3032 H41394633 H04
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC each to ASCII values from ACK to ETX is converted into ASCII and added to BCC, and
sent.
Number of data means byte number of hex type, and is converted into ASCII. This number
is determined according to data type(X,B,W) included in device name of computer request
Format.
• Number of data in accordance with its data type is as follows:
Number of data
Data type Available variable Number of data
Bitl(X) %(P,M,L,K,T,C,F)X 1
Byte(B) %(P,M,L,K,T,C,D,S,F)B 1
Word(W) %(P,M,L,K,T,C,D,S,F)W 2
Data In data area, there are the values of hex data converted to ASCII code saved.
Ex.1
The fact that number of data is H04(ASCII code value:H3034) means that there is hex data of 4 bytes in data .
Hex data of 4 bytes is converted into ASCII code in data.
Ex.2
If number of data is H04 and the data is H12345678, ASCII code converted value of this is "31 32 33 34 35 36 37
38," and this contents is entered in data area. Name directly, highest value is entered first, lowest value last.
Remark
1) If data type is Bit, data read is indicated by bytes of hex. Namely, if Bit value is 0, it indicated by H00,
and if 1, by H01.
8-10
Chapter 8 Communication Functions
Error code
Format name Header Station No. Command Command type Tail Frame check
(Hex 2 Byte)
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1
BCC
Byte each to ASCII values from NAK to ETX is converted into ASCII and added to BCC.
Hex and 2 bytes(ASCII code, 4 bytes) indicate error type. For the details, see 8.1.8 Error
Error code
codes.
(5) Example
This example supposes when 1 WORD from M20 and 1 WORD from P001 address of station No.1 are read and BCC value
is checked. Also it is supposed that H1234 is entered in M20, and data of H5678 is entered in P001.
Ex. of frame ENQ H01 r SS H02 H05 %MW20 H06 %PW001 EOT BCC
H254D57 H25505730
ASCII value H05 H3031 H72 H5353 H3032 H3035 H3036 H04
3230 3031
Ex. of frame ACK H01 r SS H02 H02 H1234 H02 H5678 ETX BCC
ASCII value H06 H3031 H72 H5353 H3032 H3032 H31323334 H3032 H35363738 H03
8-11
Chapter 8 Communication Functions
Format name Header Station No. Command Command type Error code Tail Frame check
ASCII value H15 H3031 H72 H5353 Error code (4 bytes) H03
(1) Introduction
This is a function that reads the PLC device memory directly specified in accord with memory data type. With this, data is
read from specified address as much as specified continuously.
Ex. of frame ENQ H10 R(r) SB H06 %MW100 H05 EOT BCC
ASCII value H05 H3130 H52(72) H5342 H3036 H254D57313030 H3035 H04
Remark
1) Number of data specifies the number to read according to the type of data. Namely, if the data type of device
is word and number is 5, it means that 5 words should be read.
2) Max. of %MW in number of data can be used up to 120(240bytes).
3) Protocol of RSB doesn't have number of blocks.
4) R(r)SB command of bit devices is not available.
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC
each to ASCII values from ENQ to EOT is converted into ASCII and added to BCC.
Device length This indicates the number of name's characters that means device, which is allowable up to
(Length of 16 characters. This value is one of ASCII converted from hex type, and the range is from
device name) H01(ASCII value:3031) to H10(ASCII value:3130).
Address to be actually read is entered. This must be ASCII value within 16 characters, and in
Device name
this name, digits, upper/lowercase, and '%' only are allowable to be entered.
8-12
Chapter 8 Communication Functions
Ex. of frame ACK H10 R(r) SB H01 H02 H1122 EOT BCC
ASCII value H06 H3130 H52(72) H5342 H3031 H3134 H31313232 H03
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC each to ASCII values from ACK to ETX is converted into ASCII and added to BCC, and
sent.
It means byte number of hex type, and is converted into ASCII. This number is determined
by multiplying the data number of computer request Format by the data size(in below
table) according to memory type(B,W,D) included in variable name of computer request
Number of data Format.
Data .In data area, there are the values of hex data converted to ASCII code saved.
Ex.1
When memory type included in variable name of computer request Format is W(Word), and data number of
computer request Format is 03, data number of PLC ACK response after execution of command is indicated by
H06(2*03 = 06 bytes)Byte and ASCII code value 3036 is entered in data area.
Ex.2
In just above example, when data contents of 3 words are 1234, 5678, and 9ABC in order, actual ASCII code
converted values are 31323334 35363738 39414243, and the contents are entered in data area.
8-13
Chapter 8 Communication Functions
Error code
Format name Header Station No. Command Command type Tail Frame check
(Hex 2 Byte)
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC
each to ASCII values from NAK to ETX is converted into ASCII and added to BCC, and sent.
Hex and 2 bytes(ASCII code, 4 bytes) indicate error type. For the details, see 8.1.8 Error
Error code
codes.
(5) Example
This example supposes that 2 WORDs from M000 of station No. 10 is read and BCC value is checked. Also it is supposed
that data in M000 and in M001 is as follow:
M000 = H1234
M001 = H5678
Command
Format name Header Station No. Command Device length Device name Number of data Tail Frame check
type
Frame (Example) ENQ H0A r SB H06 %MW000 H02 EOT BCC
H254D5730
ASCII value H05 H3041 H72 H5342 H3036 H3032 H04
3030
Command Number of
Format name Header Station No. Command Data Tail Frame check
type data
Format name Header Station No> Command Command type Error code Tail BCC
Frame (Example) NAK H0A r SB Error code (2Byte) ETX BCC
ASCII value H15 H3041 H72 H5342 Error code (4Byte) H03
8-14
Chapter 8 Communication Functions
(1) Introduction
This is a function that writes the PLC device memory directly specified in accord with memory data type.
Frame (Example) ENQ H20 W(w) SS H01 H06 %MW100 H00E2 EOT BCC
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC
each to ASCII values from ENQ to EOT is converted into ASCII and added to BCC.
This specifies how much of the blocks composed of "[device length][device name]" are in
Number of blocks this request Format. This can be set up to 16. Therefore, the value of [Number of blocks]
must be set between H01(ASCII value:3031)-H10(ASCII value:3030).
Device This indicates the number of name's characters that means device, which is allowable up to
length(Name 16 characters. This value is one of ASCII converted from hex type, and the range is from
length of device) H01(ASCII value:3031) to H10(ASCII value:3130).
Address to be actually read is entered. This must be ASCII value within 16 characters, and
device
in this name, digits, upper/lower case, and '%' only are allowable to be entered.
If the value to be written in %MW100 area is H A, the data Format must be H000A. If the
Data value to be written in %MW100 area is H A, the data Format must be H000A. In data area,
the ASCII value converted from hex data is entered.
Ex.1
If type of data to be currently written is WORD, the data is H1234, ASCII code converted value of this is
"31323334" and this content must be entered in data area. Namely, most significant value must be sent first, least
significant value last.
Remark
8-15
Chapter 8 Communication Functions
Format name Header Station No. Command Command type Tail Frame check
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC
each to ASCII values from ACK to ETX is converted into ASCII and added to BCC, and sent.
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC
each to ASCII values from NAK to ETX is converted into ASCII and added to BCC, and sent.
Hex and 2 bytes(ASCII code, 4 bytes) indicate error type. For the details, see 8.1.8 Error
Error code
codes.
8-16
Chapter 8 Communication Functions
(5) Example
This example supposes that "HFF" is written in M230 of station No. 1 and BCC value is checked.
Frame (Example) ENQ H01 w SS H01 H06 %MW230 H00FF EOT BCC
H254D5732
ASCII value H05 H3031 H77 H5353 H3031 H3036 H30304646 H04
3330
Format name Header Station No. Command Command type Tail Frame check
Format name Header Station No. Command Command type Error code Tail Frame check
ASCII value H15 H3031 H77 H5353 Error code (4) H03
8-17
Chapter 8 Communication Functions
(1) Introduction
This is a function that directly specifies PLC device memory and continuously writes data from specified address as much as
specified length.
Frame
ENQ H10 W(w) SB H06 %MW100 H02 H11112222 EOT BCC
(Example)
Remark
1) Number of data specifies the number according to the type of device. Namely, if the data type of
device is WORD, and number of data is 5, it means that 5 WORDs should be written.
2) Number of data can be used up to 240Bytes(120 Words).
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC
each to ASCII values from ENQ to EOT is converted into ASCII and added to BCC.
Device This indicates the number of name's characters that means device, which is allowable up to
length(Name length 16 characters. This value is one of ASCII converted from hex type, and the range is from
of variable) H01(ASCII value:3031) to H10(ASCII value:3130).
Address to be actually read. This must be ASCII value within 16 characters, and in this
device
name, digits, upper/lower case, and '%' only are allowable to be entered.
8-18
Chapter 8 Communication Functions
Format name Header Station No. Command Command type Tail Frame check
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC each to ASCII values from ACK to ETX is converted into ASCII and added to BCC, and
sent.
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC each to ASCII values from NAK to ETX is converted into ASCII and added to BCC, and
sent.
Hex and 2 bytes(ASCII code, 4 bytes) indicate error type. For the details, see 8.1.8 Error
Error code
codes.
8-19
Chapter 8 Communication Functions
(5) Example
This example supposes that 2 byte H’AA15 is written in D000 of station No. 1 and BCC value is checked.
Frame (Example) ENQ H01 w SB H06 %DW0000 H01 HAA15056F EOT BCC
H414131353
ASCII value H05 H3031 H77 H5342 H3036 H254457303030 H3031 H04
0353646
② For ACK response after execution of command (PC ← MASTER-K120S main unit)
Format name Header Station No. Command Command type Tail Frame check
Format name Header Station No. Command Command type Error code Tail Frame check
ASCII value H15 H3031 H77 H5342 Error code (4) H03
8-20
Chapter 8 Communication Functions
5) Monitor register(X##)
(1) Introduction
Monitor register can separately register up to 10 in combination with actual variable reading command, and carries out the
registered one through monitor command after registration.
Frame
Format name Header Station No. Command Registration No. Registration Format Tail
check
Frame (Example) ENQ H10 X(x) H09 Refer to registration Format EOT BCC
Item Explanation
When command is lowercase(x), only one lower byte of the value resulted by adding 1 byte
BCC
each to ASCII values from ENQ to EOT is converted into ASCII, added to BCC.
This can be registered up to 10(0 to 9, H00-H09), and if an already registered No. is
Register No.
registered again, the one currently being executed is registered.
This is used to before EOT in command of Formats of separate reading of variable,
Register Format
continuous reading, and named variable reading.
※ Register Format : Register Format of request Formats must select and use only one of the followings.
RSS Number of blocks(2 Byte) Device length (2 Byte) Device name (16 Byte) ...
1 block(max. 16 blocks)
② Continuous reading of device
RSB Device length (2 Byte) Device name (16 Byte) Number of data
8-21
Chapter 8 Communication Functions
Format name Header Station No. Command Registration No. Tail Frame check
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC each to ASCII values from ACK to ETX is converted into ASCII and added to BCC, and
sent.
Item Explanation
When command is one of lower case(r), only one lower byte of the value resulted by adding
BCC 1 Byte each to ASCII values from NAK to ETX is converted into ASCII and added to BCC,
and sent.
Hex and 2 bytes(ASCII code, 4 bytes) indicate error type. For the details, see 8.1.8 Error
Error code
codes.
8-22
Chapter 8 Communication Functions
(5) Example
This example supposes that device M000 of station NO. 1 is monitor registered.
Registration Format
Registration
Format name Header Station No. Command Number of Tail Frame check
No. R## Device length Device name
blocks
Frame (Example) ENQ H01 x H01 RSS H01 H06 %MW000 EOT BCC
H255457
ASCII value H05 H3031 H78 H3031 H525353 H3031 H3036 H04
303030
Format name Header Station No. Command Registration No. Tail Frame check
③ For NAK response after execution of command (PC ← MASTER-K120S main unit)
Format name Header Station No. Command Registration No. Error code Tail Frame check
Frame (Example) NAK H01 x H01 Error code (2) ETX BCC
ASCII value H15 H3031 H78 H3031 Error code (4) H03
8-23
Chapter 8 Communication Functions
6) Monitor execution(Y##)
(1) Introduction
This is a function that carries out the reading of the variable registered by monitor register. This also specifies a registered
number and carries out reading of the variable registered by the number.
Format name Header Station No. Command Registration No. Tail Frame check
Item Explanation
Register No. uses the same number registered during monitor register for monitor execution.
Register No.
It is possible to set from 00-09(H00-H09).
When command is lower case(y), only one lower byte of the value resulted by adding 1 byte
BCC
each to ASCII values from ENQ to EOT is converted into ASCII, added to BCC.
① In case that the register Format of register No. is the Individual reading of device
Frame (Example) ACK H10 Y(y) H09 H01 H04 H9183AABB ETX BCC
H3931383341
ASCII value H06 H3130 H59(79) H3039 H3031 H3034 H03
414242
② In case that the register Format of register No. is the continuous reading of device
Frame (Example) ACK H10 Y(y) H09 H04 H9183AABB ETX BCC
8-24
Chapter 8 Communication Functions
Item Explanation
When command is lowercase(y), only one lower byte of the value resulted by adding 1 Byte
BCC each to ASCII values from NAK to ETX is converted into ASCII and added to BCC, and
sent.
Hex and 2 bytes (ASCII code, 4 bytes) indicate error type. For the details, see 8.1.8 Error
Error code
codes.
(5) Example
This example supposes that registered device No. 1 of station No. 1 is read. and BCC value is checked. And it is supposed
that device M000 is registered and the number of blocks is 1.
Format name Header Station No. Command Registration No. Tail Frame check
② For ACK response after execution of command (PC ← MASTER-K120S Main Unit)
Frame (Example) ACK H01 y H01 H01 H04 H23422339 ETX BCC
H3233343232
ASCII value H06 H3031 H79 H3031 H3031 H3034 H03
333339
③ For NAK response after execution of command (PC ← MASTER-K120S Main Unit)
Format name Header Station No. Command Registration No. Error code Tail Frame check
Frame (Example) NAK H01 y H01 Error code (2) ETX BCC
ASCII value H15 H3031 H79 H3031 Error code (4) H03
8-25
Chapter 8 Communication Functions
(1) Introduction
This is a function that reads flag list including operating status of PLC and error information.
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC
each to ASCII values from ENQ to EOT is converted into ASCII and added to BCC.
Item Explanation
When command is lowercase(r), only one lower byte of the value resulted by adding 1 Byte
BCC
each to ASCII values from ACK to ETX is converted into ASCII and added to BCC, and sent.
※1 PLC status data: data Format is 20 bytes in hex Format and converted into ASCII code. Its contents are constituted as
• CPU Type
CPU Type K120S K80S K200SA K200SB K200SC K300S K1000S
Code 42 41 3A 3B 3C 33 32
• Version No.
Ex) Bit
0 0 0 1 0 0 1 0 Version 1.2
8-26
Chapter 8 Communication Functions
Error code
Format name Header Station No. Command Command type Tail Frame check
(Hex 2 Byte)
* When command is one of lower case(r), only one lower byte of the value resulted by adding 1 Byte each to ASCII values
from NAK to ETX is converted into ASCII and added to BCC, and sent.
* Hex and 2 bytes(ASCII code, 4 bytes) indicate error type. For the details, see 8.1.8 Error codes.
(5) Example
This example supposes that the status of MASTER-K120S Main unit of station No. 1 is read.
Format name Header Station No. Command Command type Tail Frame check
② For ACK response after execution of command (PC ← MASTER-K120S Main Unit)
Format name Header Station No. Command Command type Status data Tail Frame check
③ For NAK response after execution of command (PC ← MASTER-K120S Main Unit)
Format name Header Station No. Command Command type Error code Tail Frame check
Frame (Example) NAK H01 R(r) ST Error code (2) ETX BCC
ASCII value H15 H3031 H52(72) H5354 Error code (4) H03
8-27
Chapter 8 Communication Functions
1) Introduction
1:1 built-in communication between MASTER-K120S's is that which constitutes a built-in communication system with the
method of 1(master) : 1(slave). Setting Base parameter and communication parameter in KGLWIN can easily constitute this
system. Communication protocol currently applied is the same with Cnet I/F used for MASTER-K. Main functions are following.
• It can organize device area into 64 data access blocks by WORD unit, and set a communication time-out limit for each
block.
• It can reestablish flag in relation with error codes and slave PLC operating mode according to parameter setting.
• It can reset flag related with error codes and sending/receiving error frequency of each parameter.
• It monitors communication status, using monitoring function of KGLWIN.
MASTER-K120S MASTER-K120S
main unit G7E-DR10A
main unit
(Master: station no. 1) (Slave: station No. 31)
This communication cabling map is the same for (3) 1:1 Connecting with other MASTER-K120S in 8.1.2 "System configuration
method using built-in communication."
8-28
Chapter 8 Communication Functions
2) Parameter setting
8-29
Chapter 8 Communication Functions
8-30
Chapter 8 Communication Functions
• Total 64 data blocks can be assigned. But it's not possible to set a register number.
• Sending and receiving data size can be set up to 60 Words.
• Set device area
- Sending: reading device area P,M,L,K,T,C,D,S saving device area : P,M,L,K,T,C,D,S
- Receiving : reading device area P,M,L,K,T,C,D,S saving device area : P,M,L,K,T,C,D,S
8-31
Chapter 8 Communication Functions
Error code
(3) Slave PLC mode and error contents of each station (total 32 stations)
8-32
Chapter 8 Communication Functions
• Error bit
b7 b6 b5 b4 b3 b2 b1 b0
b15 b3 b2 b1 b0
----------- D4448
8-33
Chapter 8 Communication Functions
4) Example
The following example uses the above diagram to explain the operation of MASTER-K120S main unit.
• The data of the master MASTER-K120S main unit is increased by INCP instruction and sent to be written on the output
contact point P004 of the slave MASTER-K120S main unit. And in return, the master MASTER-K120S main unit reads
the data that is written on the output contact point of the slave MASTER-K120S to write them on the output contact
point of extended digital input/output module, G7E-DR10A.
(1) Setting communication parameter of the master station and its program
① Work on the master station 0.
② Open a new project file and a new program for the master station.
③ Double click parameter item for parameter settings. If you click the Comm. button in parameter window in KGLWIN,
you can see the following window of the communication parameter.
8-34
Chapter 8 Communication Functions
Protocol
Communication Method
and mode
Comm-
Station no. Baud rate Data bit Parity bit Stop bit Communication channel Timeout Dedicated
unication
RS232C null modem or
Enable 0 19200 8 None 1 500ms Master
RS422/485
⑥ double click list number ‘0’ in ‘List’ window , then following window for ‘Private 1 item 0 edit’ is open
⑦ Set parameters like the following table and click ‘OK’ button.
8-35
Chapter 8 Communication Functions
⑧ The registration list ‘0’ registered in the registration list can be confirmed through a window like the following.
⑨ Double click the No. 1 for receive parameter setting and Set parameters like the following table and click ‘OK’ button.
8-36
Chapter 8 Communication Functions
(2) Program
Protocol
Communication Method
and mode
Commu-
Station no. Baud rate Data bit Parity bit Stop bit Communication channel Timeout Dedicated
nication
8-37
Chapter 8 Communication Functions
When use commands that aren’t supported. Be familiar with the manual.
H6001 Syntax error Ex1) When use device Check if the system stopped.
H6010 Syntax error OVER-RUN, FRAME error Be familiar with the manual.
reset
H6030 Syntax error Syntax error in commands Check if each sends frame has ENQ, EOT.
H6040 Syntax error When a FRAME text exceeds over 256 bytes. Rearrange send frame not to go over 256 bytes.
8-38
Chapter 8 Communication Functions
8.2.1 Introduction
User Defined Protocol Communication allows users who do communication between MASTER-K120S main unit and other kind
of device to define the other company’s protocol at MASTER-K PLC. There’re a number of kinds of protocols made by many
companies, that it’s difficult to have all protocols in it. So if a user defines a protocol that can be applied to his/her purpose,
MASTER-K120S main unit executes the communication with the other kind of device through the defined protocol.
For this, protocol frame must be defined in KGLWIN (Version 2.0 or higher). And exact knowledge about the contents of the
protocol defined by the user is vital in making the communication possible. KGLWIN can download a user defined protocol
frame into MASTER-K120S main unit and it is saved. it is not erased by power’s off/on. For using user-defined mode, he/she
should program with instruction controlling sending of PLC as well as edit frames. This section explains User Defined Protocol
Communication setting & usage.
(1) Open a new project file from KGLWIN and select K120S as PLC type
(2) After setting communication parameter at KGLWIN. Double click it to activate this window.
8-39
Chapter 8 Communication Functions
2) Setting frame
(2) Select one of 1∼15 in frame list to open the following window.
① Frame specification
• Header
- Used in [Header] type.
- Possible characters, as headers are 1 alphabet letter, 1 numeric number, or control characters as below.
8-40
Chapter 8 Communication Functions
Example 1) [NUL] , [ENQ] , [1] , [A] : Possible Example 2) NUL, ENQ , [12] , [ABC] : impossible
- It is allowed to be only 3 consecutive characters.
Example 3) [ENQ][STX][NUL] : Possible Example 4) [A][NUL][ENQ][STX] : impossible
• Send / Receive
- Not defined : It is the initial value that doesn’t declare a frame format.
- Send : It is that declares send frame.
- Receive : It is that declares receive frame.
- When Frame 0 window is activated, Tx/Rx term is set as “Not defined,” and all the segments are not in
activation.
• Segment (1-8): Enter segment by segment to separate fixed sending data area (CONSTANT) and device
area (Array).
Item Contents
To set a segment type, there’re NONE (not defined), CONST (fixed data
area), ARRAY (Device area). CONST declares commands and fixed data
that are used for communication frame and ARRAY is used to input and save
the data needed for interactive communication. ARRAY type must be always
set by byte.
This field is to declare commands and fixed data that will be used in communication
frame and constant data to be declared by inputting. ASCII input must be done
within 10 characters and hex within 20 characters. If the number exceeds the limit,
set the next segment as the same type and continue to input there. As an
dedicated protocol communication, 10RSB06%MW10006 is a frame to execute
reading 6 word data from M100 at the slave station no. 16.
Ex1) 10RSB06%MW10006
8-41
Chapter 8 Communication Functions
Item Contents
It is a radio button to select the input type of commands. There’re 2 kinds as hex or
ASCII value.
Ex1) ASCII : 1 0 R S B 0 6 % M W 1 0 0
Ex2) Hex : 31 30 52 53 42 30 36 25 57 44 31 30 30
If ARRAY is set, it asks whether it would convert data to ASCII to send (at send
frame), or convert to hexadecimal to receive(at receive frame).
If ARRAY is set, the size of area is to be set by byte. The unit is a byte.
• Tail
- Used in [Tail] type.
- Possible characters as headers are 1 alphabet letter, 1 numeric number, or control characters as below
Example 1) [NUL] , [ENQ] , [1] , [A] : Possible Example 2) NUL, ENQ , [12] , [ABC] : impossible
- It’s possible to use BCC that can detect errors. BCC must be set as [BCC] to be used. To set BCC contents,
click “BCC Setting” button on the right side.
Example 5)
8-42
Chapter 8 Communication Functions
Item Contents
ASCII adds 2 bytes BCC value in ASCII type to frame. Hex adds 1 byte BCC value in Hex type to
Data Type
frame. For the detailed setting BCC, refer to 8.1.6 “Execution of Commands”.
It is that sum all the data from 2nd data to the data before the data marked as [BCC] and input the
Default
result to the [BCC] area
SUM 1 BCC method uses sum like defaults, but the user can set the BCC area.
BCC method is the same with SUM 1, but it’s used when the user masks any value to the last BCC
SUM 2
value.
Check Rule
BCC method is the same with XOR 1, but it’s used when the user masks any value to the last BCC
XOR 2
value.
BCC method is the same with MUL 1, but it’s used when the user masks any value to the last BCC
MUL 2
value.
H signifies header, S is for segment, and T is for tail.
Range Ex1) When header is set as [ENQ][STX], tail is set as [EOT][ETX], and the range of setting
BCC is to be from [STX] to [ETX], then set as H [1]~T [1].
It is to set whether not to take complement number or to take the complement number of 1 or 2 at
Complement [BCC] value. If mask setting is done after taking a complement number, the user can set any value to
do masking.
Sets any value and method of masking.
Ex1) When masking by XOR method, using a value, HFF : ^FF
Mask
Ex2) When masking by OR method, using a value, HFF : |FF
When masking by AND method, using a value, HFF : &FF
8-43
Chapter 8 Communication Functions
• Frame size
- ASCII communication : max. 128 bytes
- Hex communication : max. 256 bytes
• When frame receiving is done, MASTER-K120S main unit check if there’s any match between the received frame
and the declared frame in frame list. If there is, let the Link relay L(n) flag blink and save the received data in the
assigned area.
BCC calculation example> When frame is set as below, the result of calculation is as follow.
8-44
Chapter 8 Communication Functions
① SUM 1
② XOR 1
③ MUL 1
8-45
Chapter 8 Communication Functions
bit 7 bit 0
1 1 0 1 0 0 1 1 = h D3(sum check value)
bit 7 bit 0
0 0 1 0 1 1 0 0 1’ complement = h 2C(the last sum check value)
bit 7 bit 0
0 0 1 0 1 1 0 1 2’ complement = 1’ complement + 1 = h 2D(the last sum check
l )
bit 7 bit 0
1 1 0 1 0 0 1 1 = h D3 (sum check value)
bit 7 bit 0
1 1 1 1 1 1 1 1 = hFF (masking value)
bit 7 bit 0
1 1 0 1 0 0 1 1 AND masking = hD3
bit 7 bit 0
1 1 0 1 0 0 1 1 OR masking = hFF
bit 7 bit 0
0 0 1 0 1 1 0 0 Exclusive OR masking = h2C
8-46
Chapter 8 Communication Functions
8.2.3 Instruction
■ SNDCOM Ch n1 D
(1) Function
• When the execution condition is on, the communication starts with protocol at parameter which is designated early.
• ‘Ch’ is communication channel and ‘n’ is a frame number at parameter which is designated
• ‘D’ is a device which the communication status is stored.
• Done bit : When transfer is completed normally, this bit turns on during 1 scan.
• Error bit : When communication error occurs, ,this bit turns on.
• Error code : When error bit turns on, the error code is stored.
8-47
Chapter 8 Communication Functions
3) Error code
This example is supposed that there’s a communication between MASTER-K120S’s by the user-defined protocol. The system
configuration is as follows and the cable is the same with the one of 1:1 dedicated protocol communication.
The data in M area of the master station is sent to the slave station and the slave station saves received data in M area, output as direct
variable, and sends the data back to the master. This process repeats between the master and the slave.
① Select the communication parameter and then select communication method and communication channel.
② Select ‘user Defined’ at protocol and mode item(‘list item is activated), then Click the ‘list’
8-48
Chapter 8 Communication Functions
④ Designate the header, segment, send/receive , tail as below and then click the BCC Setting
8-49
Chapter 8 Communication Functions
⑤ Designate BCC Setting as below and Click the OK button, then you can see the frame list window which is designated
8-50
Chapter 8 Communication Functions
8-51
Chapter 8 Communication Functions
⑧ Program
• When the data is received at frame no. 1, link relay L001 turns on during 1 scan. At that moment, M000 increases and the
value of M000 moves output relay P004.
• The new value of M000 is sending again every 1 second period (F092 is 1second period flag)
• The number of sending normally stores D000.
• When error occurs, the number of sending error stored in D001.
8-52
Chapter 8 Communication Functions
④ Click the BCC Setting after set the header , segment , tail as below.
8-53
Chapter 8 Communication Functions
⑤ Click the OK button after BCC setting as below. Then you can see the frame list which is designated.
8-54
Chapter 8 Communication Functions
⑥ Set the frame number ‘1’ as below and click the BCC Setting
8-55
Chapter 8 Communication Functions
⑧ After the frame setting and BCC setting completes, click the OK button.
⑨ You can see the frame list window which is designated as below
⑩ Program
• When the data is received at frame no. 0, link relay L000 turns on during 1 scan. At that moment P004 increases and
the value of P004 moves M000.
• The new value of P004 is sending again every 1 second period (F092 is 1second period flag)
• The number of sending normally is stored in D000.
• When error occurs the number of sending error is stored in D001.
8-56
Chapter 8 Communication Functions
8.3.1 Introduction
MASTER-K120S built-in communication supports Modbus, the Modicon product’s communication protocol. It supports ASCII
mode, using ASCII data and RTU mode using Hex data. Function code used in Modbus is supported by instruction and
especially function code 01, 02, 03, 04, 05, 06, 15 and 16. Refer to "Modicon Modbus Protocol Reference Guide"
1) ASCII mode
(1) It communicates, using ASCII data.
(2) Each frame uses ': (colon : H3A)', for header, CRLF (Carriage Return-Line Feed : H0D H0A), for tail.
(3) It allows Max. 1 second interval between characters.
(4) It checks errors, using LRC.
(5) Frame structure (ASCII data)
2) RTU mode
(1) It communicates, using hex data.
(2) There's no header and tail. It starts with address and finishes frame with CRC.
(3) It has at least 3.5 character times between two frames.
(4) It ignores the current frame when 1.5 character times elapse between characters.
(5) It checks errors, using 16 bit CRC.
(6) Frame structure (hex data).
REMARK
8-57
Chapter 8 Communication Functions
3) Address area
(1) Setting range is available from 1 to 247, but MASTER-K120S supports from 0 to 31.
(2) Address 0 is used for broadcast address. Broadcast address is all slave device recognize and respond to like the self-
address, which can't be supported by MASTER-K120S.
(1) MASTER-K120S supports only 01, 02, 03, 04, 05, 06, 15, and 16 among Modicon products' function codes.
(2) If the response format is confirm+(ACK), it uses the same function code.
(3) If the response format is confirm-(NCK), it returns as it sets the 8th bit of function code as 1.
Ex) If function code is 03, (we write here only function code part. Because only function codes are different.)
[Request] 0000 0011 (H03)
[Confirm+] 0000 0011 (H03)
[Confirm-] 1000 0011 (H83)
5) Data area
(1) It sends data, using ASCII data(ASCII mode) or hex (RTU mode).
(2) Data is changed according to each function code.
(3) Response frame uses data area as response data or error code.
REMARK
1) All numerical data can use hexadecimal, decimal, and binary type. If we convert decimal 7 and 10 into each type:
Hexadecimal : H07, H0A or 16#07, 16#0A
Decimal : 7, 10
Binary : 2#0111, 2#1010
8-58
Chapter 8 Communication Functions
Modicon PLC
Code Function code name Remark
Data address
01 Read Coil Status 0XXXX(bit-output) Read bits
• MASTER-K120S Mapping
MASTER-K120S main unit starts its address from 0 and matches with 1 of Modicon products' data address. So MASTER-
K120S's address n matches n+1 of Modicon products' address. This means that the output contact point 1 (0001) of
Modicon products is marked as communication address 0 and the input contact point 1 (0001) of Modicon products is
marked as communication address 0 in MASTER-K120S.
As for data size, MASTER-K120S main unit supports 128 bytes in ASCII mode and 256 bytes in RTU mode. The maximum
size of the Modicon products is different from each other kind. So refer to "Modicon Modbus Protocol Reference Guide."
8-59
Chapter 8 Communication Functions
MASTER-
K120S Quantum (9PIN)
main unit Connecting no. and direction
Pin no. Pin no. Signal
1 1 CD
5
9 2 2 RXD
4
8
3 3 3 TXD
7
2
6 4 4 DTR
1
5 5 SG
6 6 DSR
7 7 RTS
9 9
• Use RS-485 connector when using channel 2.
(2) Select a communication parameter at KGLWIN and double click to open the following window.
8-60
Chapter 8 Communication Functions
8-61
Chapter 8 Communication Functions
S1 ○ ○ ○ ○ ○ ○ ○ ○ ○
7 ○
S2 ○ ○ ○ ○ ○ ○ ○ ○
S3 ○ ○ ○ ○ ○ ○ ○ ○
Flag Designation
■ MODCOM Ch S1 S2 S3
• When operates as slave, MASTER-K120S responses to master station without commands. And When operates as master,
MASTER-K120S sends data in S1 with MODBUS protocol at rising edges of execution condition.
8-62
Chapter 8 Communication Functions
• S3 format is as below.
• NDR : when the communication ends normally, this bit turns on during 1 scan.
• Error bit : when communication error occurs, this bit turns on during 1 scan. At that time error code stores bit 8 ~ bit 15.
• Error code is as follow
Remark
-. In MASTER-K120S series, the ‘MODBUS’ command which has been used in MK80S series can be used.
In this case, communication channel is fixed to channel 0.
8-63
Chapter 8 Communication Functions
2) Example program 1
It’s supposed that MASTER-K120S main unit is the master and it reads Coil Status of the station no. 17, a Modicon product.
The master reads status of the Coil 00020 ~ 00056 of the slave station no. 17. The Coil of the slave station is supposed to
be as follows and the data that are read is saved in D1000
Coil 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40
Status X X X 1 1 0 1 1 0 0 0 0 1 1 1 0 1 0 1 1
Hex 1 B 0 E B
Coil 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20
Status 0 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 1 1 0 1
Hex 2 6 B C D
① It designates slave station and function code (No. of station : h11(17) , function code : h01)
② Address setting
- Address ‘0’ at MODBUS protocol means address ‘1’ actually .So if you want to designate address ‘20’ , write
address ‘19’
③ Reading number setting ( Reading number is 37 from 20 to 56.)
④ This is MODBUS Communication instruction.
- Data is sent starting from the low bit by byte unit. If the deficient bit of a byte is filled with 0. An example of sending
the above data is as follows.
- The data transmission starts lower byte. The remnant part of byte is filled with ‘0’
⑤ Stored data at D1000,D1001,D1002 are :
8-64
Chapter 8 Communication Functions
3) Example program 2
It’s supposed that MASTER-K120S main unit is the master and it reads Coil Status of the station no. 17, a Modicon product.
The master reads status of the input contact 10197 ~ 10218 of the slave station no. 17.
The input contact of the slave station is supposed to be as follows and the data that are read is saved in M015.
Input 10220 10219 10218 10217 10216 10215 10214 10213 10212 10211 10210 10209
Status X X 1 1 0 1 0 1 1 1 0 1
Hex 3 5 D
Input 10208 10207 10206 10205 10204 10203 10202 10201 10200 10199 10198 10197
Status 1 0 1 1 1 0 1 0 1 1 0 0
Hex B A C
① : It designates slave station and function code ( No. of station : h11(17) , function code : h02 )
② : Address setting
Address ‘0’ at MODBUS protocol means address ‘1’ actually .So if you want to designate address ‘10197’ ,
write address ‘10196’
③ : Reading number setting ( Reading number is 22 from 10197 to 10220.)
④ : This is MODBUS Communication instruction.
The data transmission starts lower byte. The remnant part of byte is filled with ‘0’
⑤ Stored data at D200,D201 are :
8-65
Chapter 8 Communication Functions
4) Example program 3
The master writes data D1000 ~ D1003 to contact 40000 of the slave station no. 10.
① : It designates slave station and function code ( No. of station : h0A(10) , function code : h10 )
② : Address setting
Address ‘0’ of function code ‘16’ at MODBUS protocol means address ‘40000’ actually.
③ : Writing number setting ( Writing number is 4)
④ : This is MODBUS Communication instruction.
5) Example program 4
The master writes data in D1000 to contact 40000 of the slave station no. 10.
① : It designates slave station and function code ( No. of station : h0A(10) , function code : h06 )
② : Address setting
Address ‘0’ of function code ‘16’ at MODBUS protocol means address ‘40000’ actually.
③ : Writing number setting ( Writing number is 1)
④ : This is MODBUS Communication instruction.
8-66
Chapter 8 Communication Functions
8.4.1 Introduction
No protocol communication is useful when communication between MASTER-K120S main unit and other kind of devices
with user defined protocol is impossible. User defined protocol is very convenient when there are enough interval between
frames or a kind of frame is less than 16. But, When the kind of frame is greater than 16 or frames are continued without
interval, user defined protocol is not available.
When the kinds of frame are more than 16, they can’t be registered in parameter area, therefore MASTER-K120s can’t
transfer these frames. Also, if there are no interval between frame, MASTER-K120S can’t find end of frame.
To overcome these defects of user defined protocol, MASTER-K120S provide ‘No Protocol Communication ’.
In the No Protocol Communication, frames are designated by commands, not by parameter setting. So Max. 128 frames can
be designated when using this communication mode. This section explains No protocol Communication setting & usage.
1) Sending Data
• Command : DSND
• Sends stored data in designated device at the rising edge of input condition.
• Data and the number of character must be stored in designated device before they are sent.
• Operands
(a) First operand – Designates communication channel
(b) Second operand – Number of data to sending (Unit of byte)
(c) Third operand – Starting address of devices which stores sending data
(d) Fourth operand – Device address which indicates communication status.
2) Receiving Data
• Command : DRCV
• Saves received data to pre-defined receiving devices when designated ending condition is occurs.
• The ending condition can be designated by following two kinds.
- By number of character which is received.
- By designated last byte. It is useful when there is no interval between received frames.
• Supports hexdecimal type.
• Operands
(a) First operand – Designates communication channel
(b) Second operand – Designates receiving format
(c) Third operand – Starting address of devices which stores receiving data
(d) Fourth operand – Device which indicates end of receiving
8-67
Chapter 8 Communication Functions
- When designated as length of frame : Stores received data to devices when number of received byte is equal to designated
lower byte value of receiving format.(setting range : 1~255)
- When designated last byte : Stores received data to devices when receives designated ending byte.
(1) Open a new project file from KGLWIN and select MK120S as PLC type
(2) After selecting communication parameter at KGLWIN. Double click it to activate this window
(3) Set the communication methods and channel (Refer to Chapter 8.1.7 for details.)
(4) Click ‘No protocol’, then parameter setting is finished
8-68
Chapter 8 Communication Functions
8.4.3 Instructions
1) No protocol receive(DRCV)
Flag Designation
■ DRCV Ch Cw D SS
(1) Function
• When the execution condition is on, the communication starts with No protocol.
• Received data is stored in device ‘D’
• If received data is not match to the designated format by ‘Cw’, data is not saved to ‘D’
• The communication status is saved in ‘SS’ .
• When the execution condition M0000 is on, the communication starts with channel 1
• When ‘EXT(h’03)’ is received, Received frames are saved to D0100
• When NDR is on, the length of received frames is saved to M010 by byte.
8-69
Chapter 8 Communication Functions
1) No protocol send(DSND)
Flag Designation
■ DSND Ch n S SS
(1) Function
• When the execution condition is on, the No protocol communication starts
• ‘n’ represents the number of data to send (unit of byte) and Sending data is stored in device ‘D’
• ‘Ch’ is designated communication channel and Communication status is saved in ‘SS’.
• When the execution condition P0040 is on, the communication starts with channel 1
• Length of sending data which is stored in D0100 is 10 byte and the communication status is stored in M000.
8-70
Chapter 8 Communication Functions
8.4.4 Examples
Assume that a electrical weighing machine sends data which has unfixed size continuously. MASTER-K120S can communicates with it
using no protocol.
For no protocol communication, one of following ending condition is designated. One is size of received data and the other is whether it
has some pre-defined data.
In this example, assume that received data is as following.
“ ENQ(1Byte) + Station No.(1Byte’) + Data(1~10 Words) + EOT(1Byte)”
When above frame is received, Received framed is saved to designated device If designated ‘Receiving Format(Cw)’ is h0104. and
decides if use these data or not. After that, sends data which is in sending device if required.
Assume that the sending data format is as following.
“ ACK(1Byte) + Station No.(1Byte’) + OK(2Bytes) + EOT(1Byte)”
In this example the size of received data is 1 word.
8-71
Chapter 8 Communication Functions
2) Program
8-72
Chapter 8 Communication Functions
Remote connection by built-in Cnet I/F is available by dedicated communication protocol only.
If KGLWIN and Master station is connected physically, it can connect to each slave station using remote connection
function.
KGLWIN
Local connection
RS-422/485 I/F
Ch.1 Slave, station #2 Ch0, Slave station#2
RS-485 I/F
8-73
Chapter 8 Communication Functions
G7L-CUEB G7L-CUEB
Modem
Modem
8-74
Chapter 8 Communication Functions
• Dedicated modem and dial-up modem are both available and Set connection option of KGLWIN as below.
G7L-FUEA G7L-FUEA
• Remote connection by Fnet interface is available by setting connection option of KGLWIN as below
8-75
Chapter 8 Communication Functions
BUILT_IN CNET
ON OFF Must be off
ROM MODE
1) Usage of G7L-CUEB
Using G7L-CUEB, MASTER-K120S can connect to other PLC by dedicated modem or dial-up modem
TM/TC Switch
2) Usage of G7L-CUEC
8-76
Chapter 8 Communication Functions
3) Usage of G7L-FUEA/RUEA
G7L-FUEA and G7L-RUEA are Field Bus Interface module of LGIS and they support High speed link communication
service by parameter setting. But communication by command(Read, Write) are not available
• After selecting communication parameter from KGLWIN and select FIELDBUS MASTER as below
8-77
Chapter 8 Communication Functions
4) Usage of G7L-PBEA/DBEA
G7L-PBEA support profibus slave function only and G7L-DBEAsupports DeviceNet slave interface function only.
• After selecting communication parameter from KGLWIN and select FIELDBUS slave as below
8-78
Chapter 9 Installation and Wiring
9.1 Installation
This unit has high reliability regardless of its installation environment, but be sure to check the following for system reliability.
1) Environment requirements
Avoid installing this unit in locations which are subjected or exposed to:
(1) During drilling or wiring, do not allow any wire scraps to enter into the PLC.
(2) Install it on locations that are convenient for operation.
(3) Make sure that it is not located on the same panel that high voltage equipment located.
(4) Make sure that the distance from the walls of duct and external equipment be 50mm or more.
(5) Be sure to be grounded to locations that have good ambient noise immunity.
(1) When installing the PLC in a closed control box, be sure to design heat protection of control box with consideration of the
heat generated by the PLC itself and other devices.
(2) It is recommended that filters or closed heat exchangers be used.
(3) The following shows the procedure for calculating the PLC system power consumption.
9-1
Chapter 9 Installation and Wiring
Main Unit
I5V 5VDC line
Expansion
power Input module
supply
output part input part special Output part Input part
part CPU part module (Transistor)
(transistor)
AC power Output Current. Input Current
Output Current. Input Current
Supply (IOUT)×Vdrop (IOUT)×Vdrop (IIN)×Vdrop
(IIN)×Vdrop
I24V
Output Input Output Input
Current Current Current
Current
24VDC line (IOUT) (IOUT) (IOUT)
(IOUT) Load Load
External
24VDC
power
Supply
(3) Average DC24V power consumption (with points simultaneously switched ON)
The total power consumption of all modules is the average power of the DC24V output circuit of the power supply part.
• W24V = I24V × 24 (W)
(4) Average power consumption by voltage drop of output part (with points simultaneously switched ON)
• Wout = Iout × Vdrop × output points × the rate of points switched on simultaneously (W)
Iout : output current (actual operating current) (A)
Vdrop : voltage dropped across each output load (V)
(5) Average power consumption of input parts (with points simultaneously ON)
• Win = lin ×E × input points × the rate of points switched on simultaneously (W)
Iin : input current (effective value for AC) (A)
E : input voltage (actual operating voltage) (V)
9-2
Chapter 9 Installation and Wiring
(7) The sum of the above values is the power consumption of the entire PLC system.
• W = WPW + W5V + W24V + Wout + Win + Ws (W)
(8) Check the temperature rise within the control panel with calculation of that total power consumption(W).
The temperature rise in the control panel is expressed as:
T = W / UA [°C]
W : Power consumption of the entire PLC system(obtained as shown above)
A : Control panel inside surface area [m2]
U : if the control panel temperature is controlled by a fan, etc 6
if control panel air is not circulated 4
• Do not drop it off, and make sure that strong shock should not be applied.
• Do not unload the PCB from its case. It can cause faults.
• During wiring, be sure to check any foreign matter like wire scraps should not enter into the upper side of the PLC. If any
foreign matter has entered into it, always eliminate it.
(3) Environment
When wiring the I/O part, if it locates near a device generating an cause short circuit, destruction or malfunction.
(4) Polarity
Before applying the power to part that has polarities, be sure to check its polarities.
9-3
Chapter 9 Installation and Wiring
(6) Wiring
• Wiring I/O wires with high voltage cable or power supply line can cause malfunction or disorder.
• Be sure that any wire does not pass across during input LED(I/O status will not be clearly identified).
• If an inductive load has been connected to output part, connect parallel surge killer or diode to a load. Connect the cathode of
diode to the ‘+’ part of the power supply.
Output part
Surge Killer
COM
Output part +
Diode -
COM
(7) Be cautious that strong shock does not applied to the I/O part.
(8) Do not separate the PCB from its case.
2) Mounting instructions
The following explains instructions for mounting the PLC onto the control panel.
(1) Allow sufficient distance from upper part of the Unit for easy module replacement and ventilation.
(2) Make sure that MASTER-K120S is installed in figure below for most effective heat radiation.
K7M-DR30U
(3) Do not mount the base board together with a large-sized electromagnetic contact or no-fuse breaker, which produces vibration,
on the same panel. Mount them on different panels, or keep the unit or module away from such a vibration source
9-4
Chapter 9 Installation and Wiring
• If the wire duct is mounted on the upper part of the PLC, make the wiring duct clearance 50 ㎜ or less for good
ventilation. Also, allow the distance enough to press the hook in the upper part from the upper part of the PLC.
• If the wire duct is mounted on the lower part of the PLC, make optic or coaxial cables contact it and consider the
minimum diameter of the cable.
(5) To protect the PLC from radiating noise or heat, allow 100 ㎜ or more clearances between it and parts. Left or right
clearance and clearance from other device in the left or right side should be 100 ㎜ or more.
80mm or more
80mm or more
Other High voltage
device
device
100mm or more
(6) MASTER-K120S has hooks for DIN rail in the base unit and expansion modules.
DIN rail
K7M-DR30U
9-5
Chapter 9 Installation and Wiring
②
③ ①: Main unit
① ②: Connector cover
③: expansion module
④: expansion cable
9-6
Chapter 9 Installation and Wiring
9.2 Wiring
The followings explains the wiring instructions for use of the system.
(1) When voltage fluctuations are larger than the specified value, connect a constant-voltage transformer.
(2) Use a power supply which generates minimal noise across wire and across PLC and ground. (When excessive noise is
generated, connect an insulating transformer)
AC100-240V
MASTER-K120S FG
main unit
Constant-voltage transformer
(4) When wiring, separate the PLC power supply from those for I/O and power device as shown below.
I/O power
T2
(5) To minimize voltage drop, use the thickest (max. 2 ㎟) wires possible
(6) Do not bundle the 100 VAC and 24VDC cables with main-circuit (high voltage, large current) wires or the I/O signal wires.
If possible, provide more than 80 ㎜ distance between the cables and wires.
9-7
Chapter 9 Installation and Wiring
(7) As a measure against very large surge(e.g. due to lightening),connect a surge absorber as shown below.
PLC
E1
E2
(8) Use a insulating transformer or noise filter for protection against noise.
(9) Twist every input power supply wires as closely as possible. Do not allow the transformer or noise filter across the duct.
Remark
1) Ground the surge absorber(E1) and the PLC(E2) separately from each other.
(1) Applicable size of wire to the terminal block connector is 0.18 to 2 ㎟. However, it is recommended to use wire of 0.5 ㎟ for
convenience.
(3) I/O signal wires must be at least 100 ㎜(3.94 in) away from high voltage and large current circuit wires.
(4) When the I/O signal wires cannot be separated from the main circuit wires and power wires, ground on the PLC side with batch-
shielded cables. Under some conditions it may be preferable to ground on the other side.
DC
(5) If wiring has been done with of piping, ground the piping.
(6) Separate the 24VDC I/O cables from the 110VAC and 220VAC cables.
(7) If wiring over 200m or longer distance, trouble can be caused by leakage currents due to line capacity.
Refer to the section ’11.4 Troubleshooting Examples.’
9-8
Chapter 9 Installation and Wiring
9.2.3 Grounding
(1) This PLC has sufficient protection against noise, so it can be used without grounding except for special much noise. However,
when grounding it should be done conforming to below items.
(2) Ground the PLC as independently as possible. Class 3 grounding should be used (grounding resistance 80Ωor less).
(3) When independent grounding is impossible, use the joint grounding method as shown in the figure below (B).
(A)Independent grounding : Best (B) Joint grounding : Good (C) Joint grounding : Not allowed
(4) Use 2 ㎟(14AWG) or thicker grounding wire. Grounding point should be as near as possible to the PLC to minimize the
distance of grounding cable.
• Be sure to use solderless terminal for power supply and I/O wiring.
• Be sure to use M3 type as terminal screw.
• Make sure that terminal screw is connected by 6∼9 ㎏·㎝ torque..
• Be sure to use fork shaped terminal screw as shown below.
9-9
Chapter 10 Maintenance
Chapter 10 Maintenance
Be sure to perform daily and periodic maintenance and inspection in order to maintain the PLC in the best conditions.
The I/O module mainly consist of semiconductor devices and its service life is semi-permanent. However, periodic inspection is
requested for ambient environment may cause damage to the devices. When inspecting one or two times per six months, check
the following items.
Temperature 0 ~ + 55°C Adjust the operating temperature and humidity with the
Ambient Humidity 5 ~ 95%RH defined range.
environment
Use vibration resisting rubber or the vibration prevention
Vibration No vibration
method.
Play of modules No play allowed Securely enrage the hook.
Connecting conditions of
No loose allowed Retighten terminal screws.
terminal screws
Change rate of input voltage − 15% to 10% Hold it with the allowable range.
Check the number of
Spare parts Spare parts and their Cover the shortage and improve the conditions
Store conditions
The following table shows the inspection and items which are to be checked daily.
Corrective
Check Items Check Points Judgement
Actions
Retighten
Connecting conditions check for loose mounting screws Screws should not be loose
Screws
of terminal block or
Check the distance between solderless
extension cable Proper clearance should be provided Correct
terminals
PWR LED Check that the LED is ON ON(OFF indicates an error) See chapter 11
Run LED Check that the LED is ON during Run ON (flickering indicates an error) See chapter 11
LED
ERR LED Check that the LED is OFF during Run OFF(ON indicates an error) See chapter 11
status
ON when input is ON,
Input LED Check that the LEO turns ON and OFF See chapter 11
OFF when input is off
ON when output is ON,
Output LED Check that the LEO turns ON and OFF See chapter 11
OFF when output is off
10-1
Chapter 10 Maintenance
Check the following items once or twice every six months, and perform the needed corrective actions.
10-2
Chapter 11 Troubleshooting
Chapter 11 Troubleshooting
The following explains contents, diagnosis and corrective actions for various errors that can occur during system operation.
System reliability not only depends on reliable equipment but also on short downtimes in the event of faults.
The short discovery and corrective action is needed for speedy operation of system.
The following shows the basic instructions for troubleshooting.
1) Visual checks
Check the following points.
• Machine operating condition (in stop and operating status)
• Power On/Off
- Status of I/O devices
- Condition of wiring (I/O wires, extension and communications cables)
- Display states of various indicators (such as POWER LED, RUN LED, ERR. LED and I/O LED).
After checking them, connect peripheral devices and check the operation status of the PLC and the
program contents.
2) Trouble Check
Observe any change in the error conditions during the following.
• Switch to the STOP position, and then turn the power on and off.
3) Narrow down the possible causes of the trouble where the fault lies, i.e.:
• Inside or outside of the PLC?
• I/O module or another module?
• PLC program?
11.2 Troubleshooting
This section explains the procedure for determining the cause of troubles as well as the errors and corrective actions.
Is the power LED turned OFF? Flowchart used when the POWER LED is turned OFF
Is the ERR LED flickering? Flowchart used when the ERR LED is flickering
Are the RUN LED turned OFF? Flowchart used when the RUN turned OFF.
I/O module doesn’t operate properly Flowchart used when the output load of the output module
doesn’t turn on.
Program cannot be written Flowchart used when a program can’t be written to the PLC
11-1
Chapter 11 Troubleshooting
11.2.1 Troubleshooting flowchart used when the POWER LED turns OFF.
The following flowchart explains corrective action procedure used when the power is supplied or the power led turns off during
operation.
Yes
No Yes
Does the power led turn on?
No
Is the voltage within the rated See the power supply be within
AC 85-264 V.
power?
Yes Yes
No Does the power led turn on?
No
No Yes
Does the power led turn on?
No
Is the power supply cable
connected?
Connect the power cable correctly.
Yes
No Yes
Does the power led turn on?
Yes
Over current protection device 1)Eliminate the excess current
activated? 2) Switch the input power OFF then
ON
No
Yes
No Does the power led turn on?
Write down the troubleshooting
questionnaire and contact
the nearest service center
Complete
11-2
Chapter 11 Troubleshooting
The following flowchart explains corrective action procedure use when the power is supplied starts or the ERR LED is flickering during
operation.
Yes
See App-2 “System Warning Flag”
Warning error?
and remove the cause of the error.
No
Yes
No
REMARK
Though warning error appears, PLC system doesn’t stop but corrective action is needed promptly. If not, it may cause the
system failure.
11-3
Chapter 11 Troubleshooting
11.2.3 Troubleshooting flowchart used when the RUN LED turns off.
The following flowchart explains corrective action procedure to treat the lights-out of RUN LED when the power is supplied,
operation starts or operation is in the process.
No
Yes
11-4
Chapter 11 Troubleshooting
11.2.4 Troubleshooting flowchart used when the I/O part doesn’t operate normally.
The following flowchart explains corrective action procedure used when the I/O module doesn’t operate normally.
Yes
Measure the voltage of power Replace the connector of the Check the status of P40 by
Correct wiring.
supply in P40 terminal board KGLWIN
No
No
No
Is the Yes
Is the Is it normal condition?
No Is the output terminal connector
voltage of power supply for load
wiring correct? connector appropriate?
applied?
Yes
Yes
Yes
Separate the external wiring than check the condition of
output module.
Yes
Is it normal condition? No Continue
11-5
Chapter 11 Troubleshooting
Continue
Yes
Is the
Is input wiring correct? Is input wiring correct? Yes terminal screw tighten
securely?
No NO
Yes No Yes
Is the condition
Yes
Is input wiring correct? of the terminal board connector
appropriate?
No
Yes
Unit replacement is Check the status of the switch Check from the beginning Unit replacement is
needed 1 and 2 needed
11-6
Chapter 11 Troubleshooting
11.2.5 Troubleshooting flowchart used when a program cannot be written to the CPU part
The following flowchart shows the corrective action procedure used when a program cannot be written to the PLC module.
Yes
No
Complete
11-7
Chapter 11 Troubleshooting
When problems have been met during operation of the MASTER-K120S series, please write down this Questionnaires and contact the
service center via telephone or facsimile.
y For errors relating to special or communication modules, use the questionnaire included in the User’s manual of the unit.
11-8
Chapter 11 Troubleshooting
~ ~
External device External device
External device
L DC input
E1
E1 E2
L
E
11-9
Chapter 11 Troubleshooting
When the load is y Leakage current by surge absorbing circuit, which is y Drive the relay using a contact and drive the C-R type
C-R type timer, time connected to output element in parallel. timer using the since contact.
constant fluctuates. y Use other timer than the C−R contact some timers have
Output
half-ware rectified internal circuits therefore, be cautious.
Load
C Timer
~ T
R Leakage current
Output X
~
The load does not y Sneak current due to the use of two different power y Use only one power supply.
turn off. supplies. y Connect a sneak current prevention diode.
Output Output
Load
Load
E1 E
E2 E
11-10
Chapter 11 Troubleshooting
Output Output
Off current
Load
E Load
E1 R E
A surge current of 10 times or more when turned on. Sink type transistor output
Output
11-11
Chapter 11 Troubleshooting
Error
Code Message CPU state Message Cause Corrective Actions
Internal system Fault of some area of operating ROM,
0001h error Stop System Error or H/W defect Contact the service center.
0002h OS ROM error Stop OS ROM Error Internal system ROM is defected Contact the service center.
0003h OS RAM error Stop OS RAM Error Internal system RAM is defected Contact the service center.
0004h Data RAM error Stop DATA RAM Error Data RAM is defected Contact the service center.
Program RAM
0005h error Stop PGM RAM Error Program RAM is defected Contact the service center.
Defect of dedicated LSI for sequence
0006h Gate array error Stop G/A Error instruction processing Contact the service center.
Sub rack power Check the power of the
0007h Stop Sub Power Error Extension Rack Power down or Error
down error extension rack
Turn the power off and
0008h OS WDT error Stop OS WDT Error CPU OS watch dog error restart the system.
Contact the service center.
Common RAM
0009h Stop Common RAM Error Common RAM interface error Contact the service center.
error
Check the fuse LED of the
Continue Break of fuse used in output units or
000Ah Fuse break error I/O Fuse Error unit. Turn the power off
(stop) Mixed I/O
and replace the fuse.
Instruction code Instructions unreadable by the CPU
000Bh Stop OP Code Error Contact the service center.
error are included. (during execution)
Flash memory
Read to/Write from the inserted Flash Check and replace the
000Ch error(during Stop User Memory Error
memory is not performed. flash memory.
execution)
Turn the power off and
Mounting/dismounting of I/O units
mount the unit firmly, and
during operation, or connection fault
0010h I/O slot error Stop I/O Slot Error restart the system.
I/O unit defect or extension cable
Replace the I/O unit or
defect
extension cable.
Points of mounted I/O units overrun
Maximum I/O the maximum I/O points. (FMM
0011h Stop MAX I/O Error Replace the I/O unit.
error mounting number over error,
MINI_MAP over…)
Special card
0012h Stop Special I/F Error Special Card Interface error Contact the service center.
interface error
0013h FMM 0 I/F error Stop FMM 0 I/F Error FMM 0 I/F Error Contact the service center.
0014h FMM 1 I/F error Stop FMM 1 I/F Error FMM 1 I/F Error Contact the service center.
0015h FMM 2 I/F error Stop FMM 2 I/F Error FMM 2 I/F Error Contact the service center.
0016h FMM 3 I/F error Stop FMM 3 I/F Error FMM 3 I/F Error Contact the service center.
A written parameter has changed, or Correct the content of the
0020h Parameter Error Stop Parameter Error
checksum error parameter.
When the power is applied or RUN
Correct the content of the
I/O Parameter Stop starts, I/O unit reservation information
0021h I/O Parameter Error parameter, or reallocate or
Error (continue) differs from the types of real loaded
replace the I/O unit.
I/O units.
The point of the reserved I/O
Maximum I/O Correct the content of the
0022h Stop I/O PARA Error information or real loaded I/O units
Over parameter.
overruns the maximum I/O point.
FMM 0 Parameter
0023h Stop FMM 0 PARA Error FMM 0 Parameter Error Correct the parameter.
Error
FMM 1 Parameter
0024h Stop FMM 1 PARA Error FMM 1 Parameter Error Correct the parameter.
Error
FMM 2 Parameter
0025h Stop FMM 2 PARA Error FMM 2 Parameter Error Correct the parameter.
Error
11-12
Chapter 11 Troubleshooting
(continued)
Error
Error CPU state Message Cause Corrective Actions
Code
FMM 3 Parameter
0026h Stop FMM 3 PARA Error FMM 3 Parameter Error Correct the parameter.
Error
• A digit of other than 0 to 9 has met
during BCD conversion. Correct the content of the
0030h Operation Error Stop Operation Error
• An operand value is outside the error step.
defined operand range.
Check the maximum scan
Continue Scan time has overrun the watch dog time of the program and
0031h WDT Over WDT Over Error
(stop) time. modify the program or
insert programs.
Program replacement has
Error of Program An error has occurred at program not been completed during
0032h Change during Stop PGM Change Error change during run. (NO SBRT, JME run. (JMP ~ JME, FOR ~
run. and END …) NEXT, CALLx and SBRTx
…)
Program Check An error has occurred while checking
0033h Continue Code Check Error Correct the error.
Error a program.
An instruction unreadable by the CPU
0040h Code Check Error Stop Code Check Error Correct the error step.
is included.
Missing the END Insert the END instruction
The program does not have the END
0041h instruction in the Stop Miss END Error at the bottom of the
instruction.
program. program.
Missing the RET Insert the END instruction
The subroutine does not has the RET
0042h instruction in the Stop Miss RET Error at the bottom of the
instruction at its bottom.
program. program.
Missing the SBRT
instruction in the The subroutine does not has the Insert the SBRT
0043h Stop Miss SBRT Error
subroutine SBRT instruction. instruction.
program.
The JMP ~ JME Correct the JMP ~ JME
0044h Stop JMP(E) Error The JMP ~ JME instruction error
instruction error instruction.
The FOR ~ NEXT Correct the FOR ~ NEXT
0045h Stop FOR~NEXT Error The FOR ~ NEXT instruction error
instruction error instruction.
The MCS ~
MCS~MCSCLR Correct the MCS ~
0046h MCSCLR Stop The MCS ~ MCSCLR instruction error
Error MCSCLR instruction.
instruction error
The MPUSH ~
MPUSH ~ MPOP Correct the MPUSH ~
0047h MPOP instruction Stop The MPUSH ~ MPOP instruction error
Error MPOP instruction
error
0048h Dual coil error Stop DUAL COIL Error Timer or counter has been duplicated. Correct timer, counter.
Input condition error, or too much use Check and correct the
0049h Syntax error Stop Syntax Error
of LOAD or AND(OR) LOAD. program.
11-13
Appendix 1 System Definitions
App1-1
Appendix 1 System Definitions
• Auto save
- This function is to set the time interval for Auto saving (Range : 0 ~60 min)
- Automatically saved file is saved in the current directory.
- The file is automatically deleted when the program window is closed. Therefore if a program cannot be saved by
"Program Error" before program is not saved, you can recover some program by loading auto saved file.
- This function is to set the time interval for Auto saving.
- When set to 0, auto save function is disabled.
App1-2
Appendix 1 System Definitions
App1-3
Appendix 1 System Definitions
2) Basic Parameters
App1-4
Appendix 2 Flag List
App2-1
Appendix 2 Flag List
(Continued)
Relay Function Description
When the reserved I/O module (set by the parameter) differs
F0040 to F005F I/O error from the real loaded I/O module or a I/O module has been
mounted or dismounted, the corresponding bit turns on.
F0060 to F006F Storing error code Stores the system error code, (See Section 2.9)
F0070 to F008F Unused
F0090 20-ms cycle clock
F0091 100-ms cycle clock Turning On/Off is repeated with a constant cycle.
F0092 200-ms cycle clock
F0093 1-sec cycle clock On Off
F0094 2-sec cycle clock
F0095 10-sec cycle clock
F0096 20-sec cycle clock
F0097 60-sec cycle clock
F0098 to F009F Unused
F0100 User clock 0 Turning On/Off is repeated as many times as the scan specified
F0101 User clock 1 by Duty instruction.
App2-2
Appendix 2 Flag List
(Continued)
Relay Function Description
F190 to F193 Borrow flag for HSC Turn on when borrow is occurred on the HSC current value
F200 to F20F Unit ID
F0210 to F021F HSC error code Stores error of HSC Ch0
F0220 to F022F HSC error code Stores error of HSC Ch1
F0230 to F023F HSC error code Stores error of HSC Ch2
F0240 to F024F HSC error code Stores error of HSC Ch3
F0250 to F027F Unused
F0280 to F045F Positioning flags Refer to 7.3.5 Flag list and error code
F0500 to F050F Maximum scan time Stores the maximum scan time.
F0510 to F051F Minimum scan time Stores the minimum scan time.
F0520 to F052F Present scan time Stores the present scan time.
F0530 to F053F Clock data (year/month) Clock data (year/month)
F0540 to F054F Clock data (day/hour) Clock data (day/hour)
F0550 to F055F Clock data (minute/second) Clock data (minute/second)
F0560 to F056F Clock data (day of the week) Clock data (day of the week)
F0570 to F058F Unused
F0590 to F059F Storing error step Stores the error step of the program.
F0600 to F063F Unused
App2-3
Appendix 2 Flag List
When communication function is used, its status are stored in D register, and they can be monitored. And If correspond
communication function is unused, these flags can be used as general data register.
App2-4
Appendix 2 Flag List
D4400 Communication Error Code of station 0 and1 D4432 Mode and Error of Slave station 0 and 1
D4401 Communication Error Code of station 2 and 3 D4433 Mode and Error of Slave station 2 and 3
D4401 Communication Error Code of station 4 and 5 D4434 Mode and Error of Slave station 4 and 5
D4403 Communication Error Code of station 6 and 7 D4435 Mode and Error of Slave station 6 and 7
D4404 Communication Error Code of station 8 and 9 D4436 Mode and Error of Slave station 8 and 9
D4405 Communication Error Code of station 10 and 11 D4437 Mode and Error of Slave station 10 and 11
D4406 Communication Error Code of station 12 and 13 D4438 Mode and Error of Slave station 12 and 13
D4407 Communication Error Code of station 14 and 15 D4439 Mode and Error of Slave station 14 and 15
D4408 Communication Error Code of station 16 and 17 D4440 Mode and Error of Slave station 16 and 17
D4409 Communication Error Code of station 18 and 19 D4441 Mode and Error of Slave station 18 and 19
D4410 Communication Error Code of station 20 and 21 D4442 Mode and Error of Slave station 20 and 21
D4411 Communication Error Code of station 22 and 23 D4443 Mode and Error of Slave station 22 and 23
D4412 Communication Error Code of station 24 and 25 D4444 Mode and Error of Slave station 24 and 25
D4413 Communication Error Code of station 26 and 27 D4445 Mode and Error of Slave station 26 and 27
D4414 Communication Error Code of station 28 and 29 D4446 Mode and Error of Slave station 28 and 29
D4415 Communication Error Code of station 30 and 31 D4447 Mode and Error of Slave station 30 and 31
D4416 Error count of station 0 and 1
App2-5
Appendix 2 Flag List
D4300 Communication Error Code of station 0 and1 D4332 Mode and Error of Slave station 0 and 1
D4301 Communication Error Code of station 2 and 3 D4333 Mode and Error of Slave station 2 and 3
D4301 Communication Error Code of station 4 and 5 D4334 Mode and Error of Slave station 4 and 5
D4303 Communication Error Code of station 6 and 7 D4335 Mode and Error of Slave station 6 and 7
D4304 Communication Error Code of station 8 and 9 D4336 Mode and Error of Slave station 8 and 9
D4305 Communication Error Code of station 10 and 11 D4337 Mode and Error of Slave station 10 and 11
D4306 Communication Error Code of station 12 and 13 D4338 Mode and Error of Slave station 12 and 13
D4307 Communication Error Code of station 14 and 15 D4339 Mode and Error of Slave station 14 and 15
D4308 Communication Error Code of station 16 and 17 D4340 Mode and Error of Slave station 16 and 17
D4309 Communication Error Code of station 18 and 19 D4341 Mode and Error of Slave station 18 and 19
D4310 Communication Error Code of station 20 and 21 D4342 Mode and Error of Slave station 20 and 21
D4311 Communication Error Code of station 22 and 23 D4343 Mode and Error of Slave station 22 and 23
D4312 Communication Error Code of station 24 and 25 D4344 Mode and Error of Slave station 24 and 25
D4313 Communication Error Code of station 26 and 27 D4345 Mode and Error of Slave station 26 and 27
D4314 Communication Error Code of station 28 and 29 D4346 Mode and Error of Slave station 28 and 29
D4315 Communication Error Code of station 30 and 31 D4347 Mode and Error of Slave station 30 and 31
D4316 Error count of station 0 and 1
App2-6
Appendix 2 Flag List
App2-7
Appendix 2 Flag List
Relay Description
D4900 Error pointer
Relay Description
D4990 Year, Month
App2-8
Appendix 3 External Dimensions
1) Main unit
Model A B
K7M-DR10/14UE 85 95
K7M-DR20/30UE
135 145
95 105 115 K7M-DR(T)20/30U
K7M-DR(T)40U 165 175
K7M-DR(T)60U 215 225
A
B
73
2) Extension module
95 105 115
5
95
73
App3-1
Appendix 3 External Dimensions
App3-2