Kinco KS, KS105-16DT, KS105C1-16DT, KS105C2-16DT Series Manual

K
inco
-K
S
K
inco
K
K inco
inco -K
CONTENT
CONTENT
CONTENT
CONTENT
CHAPTER 1 GENERAL INTRODUCTION .............................................................................. 3
1.1 S UMMARY ............................................................................................................................ 3
1.2 P RODUCT L IST ..................................................................................................................... 3
1.3 E NVIRONMENTAL C ONDITION ............................................................................................. 4
CHAPTER 2 CPU MODULE INTRODUCTION ....................................................................... 5
2.1 O VERVIEW ........................................................................................................................... 5
2.1.1 Structure ....................................................................................................................... 5
2.1.2 CPU Types .................................................................................................................... 5
2.2 F UNCTIONS .......................................................................................................................... 7
2.2.1 CPU Status and LEDs ................................................................................................... 7
-K
S
-K S
S series
2.2.2 Programming port and serial port ................................................................................. 8
2.2.3 CAN port ...................................................................................................................... 9
2.2.4 Expansion modules ....................................................................................................... 9
2.2.5 High Speed Counter and High Speed Pulse Output ...................................................... 9
2.2.6 Edge Interrupts ............................................................................................................. 9
2.2.7 Data Retentive and Data Backup ................................................................................ 10
2.2.8 Real-time Clock (RTC) ............................................................................................... 10
2.2.9 Backup Battery ........................................................................................................... 11
2.3 W IRING DIAGRAM .............................................................................................................. 12
2.4 D IMENSION ........................................................................................................................ 15
2.5 T ECHNICAL S PECIFICATION ................................................................................................ 15
CHAPTER 3 SOFTWARE INTRODUCTION .......................................................................... 16
2.1 O VERVIEW ......................................................................................................................... 16
1
K
inco
-K
S
K
inco
K
K inco
inco -K
-K
S
-K S
S series
2.2 H IGH SPEED COUNTER ....................................................................................................... 17
2.2.1 Operation Modes and Inputs of the High-speed Counters .......................................... 17
2.2.2 Control Byte and Status Byte ..................................................................................... 18
2.2.3 Preset value (PV value) setting ................................................................................... 20
2.2.4 “ CV=PV Envent No. ................................................................................................. 22
2.2.5 How to use high speed counter ................................................................................... 23
2.3 H OW TO USE HIGH SPEED PULSE OUTPUT .......................................................................... 25
2.3.2 How to use PLS instruction ........................................................................................ 26
2.3.3 How to Use Position Control Instructions .................................................................. 33
2.4 H OW TO USE CAN OPEN ................................................................................................ 37
2
K
inco
-K
K
inco
K
K inco
inco -K
S
-K
S
-K S
S series

Chapter 1 General Introduction

1.1
Summary
1.1
Summary
1.1
1.1 Summary
Summary
Kinco-K 5 series PLC is a small and integrated PLC . It is Kinco new thin and high performance PLC.
Based on high performance, high reliability and powerful function s of K5/K2 , KS series use higher level
CPU. KS has CANopen port, higher speed input and output, small size for installation.
It can fit more user ’ s requirement.
1.2
Product
1.2
Product
1.2
1.2 Product
Product List
List
List
List
Name
Name
Name
Name Order
CPU
Module
CPU
Module
CPU
CPU Module
Module
CPU 105
1.3
Environmental
1.3
Environmental
1.3
1.3 Environmental
Environmental Condition
Kinco-K S accords with GB/T 15969.3-2007 idt IEC61131-2 2007 standard and test specifications.
The following table lists the conditions and requirements for Kinco-K S to work properly. It is the user's
responsibility to ensure that the service conditions are not exceeded.
Transport
Transport
Transport
Transport and
Order
Order
Order No.
K S1 05-16DT
KS105C1-16DT
K S1 05 C2 -16D T
and
storage
and
storage
and storage
storage
No.
No.
No. Description
DC 24V, DI 8* DC24V DO 8* DC24V .
1* RS232( programming port),1*RS485.
Expandable(max 14 modules)
DC 24V, DI 8* DC24V DO 8* DC24V
1* RS232( programming port),1*RS485,1*CAN
DC 24V, DI 8* DC24V DO 8* DC24V
1* RS232( programming port),1*RS485,2*CAN
Expandable(max 14 modules)
Condition
Condition
Condition
Description
Description
Description
Ambient
conditions
temperature -40 --- +70 ° C
relative humidity
10%~95%, no condensation
3
Mechanical
conditions
Normal Operation
K
inco
-K
S
K
inco
K
K inco
inco -K
Altitude Up to 3 000 m
Free falls With manufacturer's original packaging , 5 falls from 1m of height .
air temperature Open equipment : -10 --- +55 ° C; Enclosed equipment: -10 --- +40 ° C
-K
S
-K S
S series
Ambient
conditions
Mechanical
conditions
Electromagnetic
compatibility
(EMC)
relative
humidity
Altitude Up to 2000 m
Pollution degree for use in pollution degree 2.
Sinusoidal
vibrations
Shock
Electrostatic
discharge
High energy
surge
Fast transient
bursts
Voltage drops
and
interruptions
10%~95%, no condensation
5<f<8.4Hz, Occasional : 3.5mm amplitude ; Continuous : 1.75mm
mplitude .
8.4<f<150, Occasional : 1.0g acceleration ; Continuous : 0.5g
acceleration .
occasional excursions to 15g, 11 ms, half-sine, in each of 3 mutually
perpendicular axes.
± 4 kV Contact , ± 8 kV Air . Performance criteria B.
a.c. main power:2KV CM, 1KV DM;
d .c. main power : 0.5KV CM, 0.5KV DM;
I/Os and Communication port: 1KVCM.
Performance criteria B .
main power : 2KV,
5KHz.
Performance criteria B .
a.c . supply : at 50Hz, 0% voltage for 1 period; 40% voltage for 10
periods; 75% voltage for 20 periods.
Performance criteria A.
5KHz.
I/Os and Communication port: 1KV,
Ingress Protection Rating IP20
4

Chapter 2 CPU Module Introduction

2.1
Overview
2.1
Overview
2.1
2.1 Overview
Overview
2.1.1
Structure
2.1.1
Structure
2.1.1

2.1.1 Structure

Structure
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
2.1.2
CPU
2.1.2
2.1.2
2.1.2 CPU
Kinco-K S provides different CPU models with a diversity of features and capabilities, all the CPU use
DC24V power supply. The following table describes main technical data of each CPU model.
Parameters KS105-16DT KS105C1-16DT KS105C2-16DT
Power supply
Rated voltage DC24V
Voltage range
I/O
Digital 8*DI / 8*DO
Types
CPU
Types
CPU Types
Types
DC20.4V 28.8V
5
K
inco
-K
K
inco
K
K inco
inco -K
Analog --
Expansion 14 --- 14
CAN --- CANopen master or CAN free potocol
PORT0,RS232 support programming protocol, MODBUS RTU slave, free protocol
S erial port
PORT1,RS485,support programming protocol, MODBUS RTU master, free protocol
S
-K
S
-K S
S series
High speed
counter
H igh speed
output
Interrupt
S torage
P rogramming Max 4K bytes instruction
Data
Data backup
Data retention
Other
Timer
4, Max 200KHz,support single and double
4
C hannel 0&1& 2 Max 200KHz load resistance is less than 1.5 K Ω at highest
frequency
C hannel 3 Max 1 0KHz
4 , I0.0-I0.3 interrupt up and down
M area 1K bytes V area 4K bytes
E2PROM 448 bytes
2 K bytes. Lithium battery 3 years at normal environment
256
1ms 4
10ms 16
Timer
interrupt ion
Counter 256
RTC
100ms 236
2 0.1ms
yes the difference is 5 min/month at 25
6
K
inco
-K
S
K
inco
K
K inco
inco -K
2.2
Functions
2.2
Functions
2.2
2.2 Functions
Functions
2.2.1
CPU
2.2.1
2.2.1
2.2.1 CPU
The CPU has two mode s : STOP mode and RUN mode.
In RUN mode, the CPU executes the main scan cycle and all interrupt tasks.
In STOP mode, the CPU will set all output channels (including DO and AO) to the known values which are
Status
CPU
Status
CPU Status
Status and
and
LEDs
and
LEDs
and LEDs
LEDs
-K
S
-K S
S series
Hardware
specified in the [ Hardware
which comes from KincoBuilder software and other Modbus RTU master device.
Change
Change
Change
Change CPU
Kinco-K S provides two ways for manually changing the CPU status:
Set all switch of CAN port [ OFF ] ,then PLC will be in STOP status.if any switch is [ ON ] ,PLC will be in RUN
status. (use all 5 switches for KS105,use 1~4 switches for KS105C1,use 1~3 switches for KS105C2.
Using the operation switch (RUN/STOP); Executing [Debug] -> [RUN] or [STOP] menu command in
Kincobuilder.
The following table lists the combined results of these two ways.
Operation
Operation
Operation
Operation Switch
Some Switch Position
All Switch Position
Besides, if CPU detects any seriously fault, it will enter STOP status immediately.
Hardware
Hardware Configuration
CPU
status
CPU
status
CPU status
status
Switch
Position
Switch
Position
Switch Position
Position KincoBuilder
Position
Position
Position is ON
Position
Position
Position is OFF
Configuration
Configuration
Configuration ] through Kincobuilder, and only p rocess communication requests
KincoBuilder
KincoBuilder
KincoBuilder command
[RUN] RUN
[STOP] STOP
[RUN] STOP
[STOP] STOP
command
command
command Actual
Actual
Actual
Actual Operation
Operation
Operation
Operation Mode
Mode
Mode
Mode
CPU
Status
Status
Status LED
LED
LED
LED
RUN
STOP
RUN
STOP
RUN , STOP
STOP , Comm.
Comm.
Comm.
Comm. and Err.
Err.
Err.
Err.
CPU
CPU
CPU Status
The CPU module provides 4 status LEDs: RUN
Run,
Err
Run,
Err
Run,
Run, Err
Err LEDs show the CPU operation status.
Run 】: If CPU is in RUN status,it will turn on. If CPU is in STOP status,it will turn off.
Err. 】: If CPU detects error in user program or module, it will turn on.
7
K
inco
-K
K
inco
K
K inco
inco -K
K S separates errors into three level s : Fatal error, Serious error, Normal error. When CPU detects an
error, it will use different way to handle according to error level and turn on Err LED, then it will save the
error code in sequence for user analysis.
2.2.2
Programming
2.2.2
Programming
2.2.2
2.2.2 Programming
Programming port
KS provides 2 communication ports,PORT1 and PORT2.It supports baudrate up to 115.2kbps.PORT1 can
be used as programming port and also support Modbus RTU slave protocol and free protocol.PORT2
supports Modbus RTU protocol (as a slave or master) and free protocol.
PS232 programming port is in the RJ45 port. Pins and functions as below,
port
port
port and
and
and
and serial
serial
port
serial
port
serial port
port
S
-K
S
-K S
S series
RS232 can ’ t insert and release with power. So we should turn off power of CPU or PC, otherwise i t will
break ports.
8
K
inco
-K
S
K
inco
K
K inco
inco -K
2.2.
3
CAN
2.2.
3
2.2.
2.2. 3
3 CAN
KS105C1-16DT has 1 CAN port, CAN2.It can support CANopen master and free protocol .
KS105C2-16DT has 2 CAN port,,CAN1 and CAN2. CAN2 can support CANopen master and free
protocol.CAN1 can support free protocol.
2.2.4
2.2.4
2.2.4
2.2.4 Expansion
KS105-16DT has expansion port, it can connect KS series expansion modules
CAN1 port of KS105C2-16DT can work as expansion port, also it support protocol. Users can use them
directly without setup , PLC can identify it automatically.
2.2.5
2.2.5
2.2.5
2.2.5 High
K S provides 4 high speed counters (HSC0~HSC3).High speed counter supports multiple modes: single phase,
CW/CCW(Up/Down),AB phase (1 multiplication and 4 multiplication). All can support up to
20 0KHz(Include single phase and AB phase).
port
CAN
port
CAN port
port
Expansion
Expansion
Expansion modules
High
High
High Speed
modules
modules
modules
Speed
Counter
Speed
Counter
Speed Counter
Counter and
and
and
and High
High
Speed
High
Speed
High Speed
Speed Pulse
Pulse
Output
Pulse
Output
Pulse Output
Output
-K
S
-K S
S series
K S provides 4 high speed pulse outputs(Q0.0,Q0.1 and Q0.4 , Q0. 5 ).All support PTO and PWM.Q0.0 and
Q0.1 ,Q0.5 support up to 20 0KHz (The resistor of load should be less than 3K Ω ),Q0.4 supports up to 10KHz.
2.2.6
Edge
2.2.6
2.2.6
2.2.6 Edge
I0.0-I0.3 in CPU support edge interrupt function, it can execute interrupt by rising edge and falling edge of
input signal. By using this function, it can capture the rising edge and falling edge of input signal quickly. For
some input signal whose pulse width is less than the CPU scan time, it can respond quickly.
2.2.7
2.2.7
2.2.7
2.2.7 Data
Data retentive means the data in RAM can retain after power failure.CPU provides a lithium battery
(Replaceable but un-rechargeable) for data retentive. When CPU loses power, the data in the RAM will be
maintained by the lithium battery , and the retentive ranges will be left unchanged at next power on. Through
[Hardware]
[Hardware]
[Hardware]
[Hardware] configuration in KincoBuilder, user can select the type of data retentive (Such as V,C area) and
the range. The life of battery is 5 years and the retaining duration is 3 years at normal temperature.
Interrupts
Edge
Interrupts
Edge Interrupts
Interrupts
Data
Retentive
Data
Retentive
Data Retentive
Retentive and
and
Data
and
Data
and Data
Data Backup
Backup
Backup
Backup
9
K
inco
-K
S
K
inco
K
K inco
inco -K
Data backup is that CPU provides an E2PROM to store data permanently. At power on, the CPU will restore
the data from E2PROM into RAM to execute.
Note:
Because
Note:
Because
Note:
Note: Because
Because E2PROM has a writing limit of 1 million times, users should avoid to write data into data
backup area frequently.
There are 448 bytes in V area for data backup (VB3648--VB4095),the data in this area will save in E2PROM
automatically.K2 sets VB3648--VB3902 as data backup by default,if user needs to use VB3903--VB4095 for
data backup,it needs to configure in PLC hardware configuration .The configuration interface is as
following figure.
2.2.8
Real-time
2.2.8
Real-time
2.2.8
2.2.8 Real-time
Real-time Clock
Clock
(RTC)
Clock
(RTC)
Clock (RTC)
(RTC)
-K
S
-K S
S series
The real-time clock built in the all CPU modules can provide real-time clock/calendar indication. Users need to
use KincoBuilder PLC -> Time of Day Clock... to set the clock when using RTC first time. Then users can
use real-time clock instructions READ_RTC SET_RTC RTC_W RTC_R .
After CPU power off , the real-time clock can be maintained by lithium battery. The life of battery is 5 years
and the retaining duration is 3 years at normal temperature.
2.2.9
Backup
2.2.9
Backup
2.2.9
2.2.9 Backup
Backup Battery
K S can use certain specification lithium battery as backup battery. When PLC is power -off , it will use the
backup battery to maintain real-time clock and RAM.
The backup battery is removable, user can replace new battery by themselves when the battery is empty.
The lithium battery is CR2032(3V) with connector. As shown in figure,
user can order the battery separately.
Battery
Battery
Battery
10
2.3
Wiring
2.3
Wiring
2.3
2.3 Wiring
Wiring diagram
diagram
diagram
diagram
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
11
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
12
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
13
2.4
Dimension
2.4
Dimension
2.4
2.4 Dimension
Dimension
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
2.5
Technical
2.5
Technical
2.5
2.5 Technical
Technical Specification
DI Specifications
Input type Source/Sink
Rated input voltage DC 24V (Max. 30V)
Rated input current 3.5mA@24VDC
Max input voltage of logic 0 5V@0.7mA
Minimum input voltage of logic 1 Common channel: 11V@2.0mA
Input filter time delay
· off-to-on
· on-to-off
Isolation between input and internal circuit
Specification
Specification
Specification
1.2 μ s
0.5 μ s;
14
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
· Mode
· Voltage
DO Specifications(Transistor type)
Output type Source
Rated power supply voltage
Output current per channel Rated current:200mA,max.300mA @24VDC
Instant impulse current per channel 1A,less than 1s
Output leakage current Max.0.5 ц A
Output impedance Max. 0.2 Ω
Output delay
· off-to-on
· on-to-off
Protection
· Reverse polarity protection of power supply
· Inductive load protection
· Short-circuit protection
· Reverse polarity protection of output
Isolation between output and internal circuit
· Mode
· Voltage
Opto-electrical isolation
500VAC/1 min
DC24V,allowance range: DC20.4V DC28.8V.(Same
as power supply)
Common channel: 1 2 μ s; HSC channel: 0.5 s;
Common channel: 35 μ s; HSC channel: 1 μ s;
No
Yes
Yes
Yes,
less than 10s.
Opto-electrical isolation
500VAC/1 min

Chapter 3 Software Introduction

2.1
Overview
2.1
Overview
2.1

2.1 Overview

Overview
Based on K5, KS use same Kincobuilder software and instructions. Users can reference K5/K2 manual
for most functions. The main difference is the new functions.
15
K
inco
-K
S
K
inco
K
K inco
inco -K
2.2
High
speed
2.2
High
2.2
2.2 High
High speed
K S provides 4 high speed counters HSC0-HSC3. All can support up to 20 0KHz
High speed counter supports multiple modes: single phase, CW/CCW,AB phase (1 multiplication and 4
multiplication).
All high speed counter can support maximum 32 PV and support 32 “ CV=PV interrupts. PV can be set as
relative value or absolute value. If it is relative value ,
2.2.1
Operation
2.2.1
Operation
2.2.1
2.2.1 Operation
Operation Modes
Input signals of high-speed counter include: clock (input impulse), direction, start and reset.
In different operation modes input signals is different. Please see below:
counter
speed
counter
speed counter
counter
Modes
Modes
Modes and
and
Inputs
and
Inputs
and Inputs
Inputs of
of
the
High-speed
of
the
High-speed
of the
the High-speed
High-speed Counters
Counters
Counters
Counters
-K
S
-K S
S series
HSC
HSC
HSC
HSC 0
Mode
Mode
Mode
Mode Description
0
Single-phase up/down counter
with internal direction control: SM37.3
2 Reset Start
3
Single-phase up/down counter
with external direction control
4 Reset Direction
Two-phase counter with up/down clock
6
inputs
9 A/B phase quadrature counter Clock
Mode
Mode
Mode
Mode Description
0
Single-phase up/down counter
with internal direction control: SM47.3
2 Reset Start
3
Single-phase up/down counter
with external direction control
4 Reset Direction
6
Two-phase counter
with up/down clock inputs
7 Reset
Description
Description
Description I0.1
Description
Description
Description I0.4
0
0
0
I0.1
I0.1
I0.1 I0.0
Clock1 Reset
Clock
Clock Down Clock Up
HSC1
HSC1
HSC1
HSC1
I0.4
I0.4
I0.4 I0.6
A
I0.6
I0.6
I0.6 I0.3
Clock B
I0.0
I0.0
I0.0 I0.5
I0.3
I0.3
I0.3 I0.2
Clock1 Reset
Clock
Clock
Down
I0.5
I0.5
I0.5
Direction
I0.2
I0.2
I0.2
Direction
Clock Up
16
9
A/B phase quadrature counter Clock
10 Reset
HSC
2
HSC
2
HSC
HSC 2
2
Mode
Mode
Mode
Mode Description
Single-phase up/down counter
0
with internal direction control: S M57.3
9 A/B phase quadrature counter Clock
Mode
Mode
Mode
Mode Description
Single-phase up/down counter
0
with internal direction control: S M1 2 7.3
9 A/B phase quadrature counter Clock
2.2.2
Control
2.2.2
Control
2.2.2
2.2.2 Control
Control Byte
Byte
Byte
Byte and
Description
Description
Description I0.4
HSC
3
HSC
3
HSC
HSC 3
3
Description
Description
Description I0.6
and
Status
and
Status
and Status
Status Byte
Byte
Byte
Byte
K
inco
K
inco
K
K inco
inco -K
A
I0.4
I0.4
I0.4 I0.5
Clock
A
I0.6
I0.6
I0.6 I0.7
A
Clock B
Clock
Clock B
I0.5
I0.5
I0.5
I0.7
I0.7
I0.7
Clock B
-K
S
-K
S
-K S
S series
Control
Control
Control
Control Byte
In SM area,each high-speed counter is assigned control byte to save its configuration data: one control
word (8 bit), current value and pre-set (double-integer with 32 bit). Initial value of current assigned value. If
the current value is written in the high-speed counter, it will start counting from that value. Please see below:
HSC0
HSC0
HSC0
HSC0 HSC1
SM37.0 SM47.0 SM57.0 SM1 2 7.0
SM37.1 SM47.1 SM57.1 SM1 2 7.1
SM37.2 SM47.2 SM57.2 SM1 2 7.2
SM37.3 SM47.3 SM57.3 SM1 2 7.3
SM37.4 SM47.4 SM57.4 SM1 2 7.4 Write counting direction in HSC? 0= NO; 1=
SM37.5 SM47.5 SM57.5 SM1 2 7.5 Write new pre-set value in HSC? 0= NO; 1=
SM37.6 SM47.6 SM57.6 SM1 2 7.6 Write new current value in HSC? 0= NO; 1=
SM37.7 SM47.7 SM57.7 SM1 2 7.7 Allow this high-speed counter? 0=NO; 1= YES
HSC0
HSC0
HSC0
HSC0 HSC1
SMD38 SMD48 SMD58 SMD1 2 8 Current value
SMD42 SMD52 SMD62 SMD1 3 2 Pre-set value
Byte
Byte
Byte
HSC1
HSC1
HSC1 HSC2
HSC1
HSC1
HSC1 HSC2
HSC2
HSC2
HSC2 HSC3
HSC2
HSC2
HSC2 HSC3
HSC3
HSC3
HSC3 Description
Effective electrical level of reset signal:0=high;1=low
Effective electrical level to start signal 0=high 1=low
Orthogonal counter rate 0=1x rate 1=4x rate
Counting direction:0=Decrease 1=Increase
HSC3
HSC3
HSC3 Description
Description
Description
Description
*
*
*
*
Yes
Yes
Yes
17
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
HSC0
HSC0
HSC0
HSC0 HSC1
SM141.0 SM151.0 SM161.0 SM171.0 Use multiple preset value:0=No. 1=Yes.
SM141.1 SM151.1 SM161.1 SM171.1
SM141.2 SM151.2 SM161.2 SM171.2
SM141.3 SM151.3 SM161.3 SM171.3 Reserved
SM141.4 SM151.4 SM161.4 SM171.4
SM141.5 SM151.5 SM161.5 SM171.5 Reset interrupt variable:0=Yes. 1=No.
SM141.6 SM151.6 SM161.6 SM171.6 Reserved
SM141.7 SM151.7 SM161.7 SM171.7 Reserved
HSC0
HSC0
HSC0
HSC0 HSC1
SMW142 SMW152 SMW162 SMW172
HSC1
HSC1
HSC1 HSC2
HSC1
HSC1
HSC1 HSC2
HSC2
HSC2
HSC2 HSC3
HSC2
HSC2
HSC2 HSC2
HSC3
HSC3
HSC3 Description
HSC2
HSC2
HSC2 Description
Description
Description
Description
Preset value type:0=Absolute value. 1=Relative
value.
Preset value comparison interrupt ( “ CV=PV ” ) cyclic
execution.
0=No. 1=Yes.
Note:Only valid when preset value is relative value.
Update multiple PV segment and preset value:0=No.
1=Yes
Description
Description
Description
Starting value of preset value table It is offset
corresponding to VB0),it must be odd value.
It needs to pay attention that not all the control bits of the control byte is suitable for all operation mode. For
example, “ Counting direction and “ Write counting direction in HSC can be only used in mode 0,1 and 2
(Single-phase up/down counter
with internal direction control),if the operation mode is with external direction control, then these two bits
will be ignored.
The control byte, current value and preset value are 0 by default after power on.
Status
Byte
Status
Status
counter.
HSC0
HSC0
HSC0
HSC0 HSC1
SM36.0 SM46.0 SM56.0 SM1 2 6.0 Reserved
SM36.1 SM46.1 SM56.1 SM1 2 6.1 Reserved
SM36.2 SM46.2 SM56.2 SM1 2 6.2 Reserved
SM36.3 SM46.3 SM56.3 SM1 2 6.3 Fault in multiple PV value table:0=No,1=Yes
Byte
Status Byte
Byte
In SM area, each high-speed counter has a status byte, which indicates the current status of high speed
HSC1
HSC1
HSC1 HSC2
HSC2
HSC2
HSC2 HSC3
HSC3
HSC3
HSC3 Description
Description
Description
Description
18
K
inco
-K
S
K
inco
K
K inco
inco -K
SM36.4 SM46.4 SM56.4 SM1 2 6.4 Reserved
SM36.5 SM46.5 SM56.5 SM1 2 6.5
SM36.6 SM46.6 SM56.6 SM1 2 6.6
SM36.7 SM46.7 SM56.7 SM1 2 6.7
HSC0 HSC1 HSC2 HSC3 Description
SMB140 SMB150 SMB160 SMB170 Current PV segment No.(Start from 0)
2.2.3
Preset
2.2.3
Preset
2.2.3
2.2.3 Preset
Preset value
K S supports up to 32 PV value for each high speed counter, and supports setting PV value as relative value or
absolute value. It supports “ CV=PV interrupt cyclic execution.
Follows take HSC0 as example to describe PV value function and setting.
How
How
How
How to
value
value
value (PV
to
select
to
select
to select
select
(PV
(PV
(PV value)
multiple
multiple
“ multiple
multiple PV
value)
setting
value)
setting
value) setting
setting
PV
mode
PV
mode
PV
mode
mode
Current counting direction:
0 = Down; 1= Up
Current value equal to preset value:
0 = No,1 =
Current value greater than preset value:
0 = No,1 =
Yes
Yes
-K
S
-K S
S series
In the control byte of each high speed counter, there is one control bit for enable multiple preset value.
In HSC0, this control bit is SM141.0.
If SM141.0 is 0,it will use single PV value, same as K5 PLC.SMD42 is for new PV value,SM37.5 is to
update this new PV value.
If SM141.0 is 1,it will use multiple PV values. In this situation,SM37.5 and SMD42 is invalid. All the PV
values will be in the PV table(SMW142 is for starting address of the table),SM141.4 defines whether it use
the data in PV table or not.If SM141.4 is 1,it means when HSC starts, it will get the data from PV table. If
SM141.4 is 0,when HSC starts,it will ignore the data in PV table and get the data from last preset value.
Multiple
Multiple
Multiple
Multiple PV
If using PV table,all the PV value will get from PV table.
Each HSC provides one control word which is used to set the starting address of PV table.If using multiple
PV,then all PV value will get from PV table.The starting address of PV table is odd address of V area,such as
301(Means VB301).
The format of PV table is as follows.
PV
table
PV
table
PV table
table
19
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
OFFSET
OFFSET
OFFSET
OFFSET
1
4
(1)
0 BYTE Quantity of PV
1 DINT First PV
5 DINT Second PV
DINT
1
1
1 All the offset value are the offset bytes related to the table.
2
2
2
2
When it is set as relative value,then the absolute value of PV data must be greater than 1,or PLC
will consider the segment of multiple PV finish and count the number of PV according to
this(Higher priority than setting quantity of PV).
When it is set as absolute value,the difference between two adjacent PV ’ s absolute value must be
greater than 1,or PLC will consider the segment of multiple PV finish and count the number of PV
according to this(Higher priority than setting quantity of PV).
3
3
3
3
“ CV=PV interrupts must execute in sequence,it means that after the counter reaches the first PV
and executes interrupt,then it will compare with the second PV and so forth.
4
4
4 PV must be set reasonably.Here takes relative value as example,if it is positive counting,PV must
be greater than 0,otherwise the “ CV=PV ” interrupt will never execute.If it is negative counting,PV
must be less than 0,otherwise the “ CV=PV ” interrupt will also never execute.
Data
type
Data
type
Data
Data type
type Description
Description
Description
Description
Relative
Relative
Relative
Relative value
In the control byte of each high speed counter, there is one control bit which is used to set PV as relative
value or absolute value.
For HSC0,the control bit is SM141.1.
If SM141.1 is 0,it means PV is absolute value. When counting value is equal to
interrupt. For example,if it sets 3 PV values,such as 1000,2000 and 3000,then when counting value reaches
1000,it will execute the first “ CV=PV ” interrupt. When the counting value reaches 2000,it will execute the
second “ CV=PV interrupt and so forth.
If SM141.1 is 1,it means PV is relative value.If counter takes current counting value as reference,when
the value it continues to count is equal to
values,such as 10,1000 and 1000,and the current counting value is 100 before HSC starts,then when the
value
value
value and
and
absolute
and
absolute
and absolute
absolute value
value
value
value
PV,it
will execute “ CV=PV
PV,it
will execute “ CV=PV interrupt.For example,if it sets 3 PV
20
K
inco
-K
S
K
inco
K
K inco
inco -K
counting value reaches 110,1110 and 2110,it will execute corresponding “ CV=PV interrupt.
CV=PV
CV=PV
“ CV=PV
CV=PV
“ CV=PV ” interrupt cyclic execution is only valid when PV is set as relative value.
If SM141.0 is 0,it means “ CV=PV interrupt only executes once.When all interrupts finish execution,then it
will stop.If it needs to execute again, it must modify the related registers and execute HSC instruction again.
If SM141.0 is 1,it means “ CV=PV interrupt is cyclic execution.When the last PV interrupt finishes
execution,PLC will take the current counting value as reference to calculate new value for PV interrupt,then
it will start to compare the counting value and execute “ CV=PV interrupt and so forth.This process will
execute cyclically.
For example,it sets 3 PV values,such as 10,1000 and 1000.And the current counting value is 100 before HSC
starts,then the value for every interrupt is as following table.
interrupt
interrupt
” interrupt
interrupt cyclic
cyclic
execution
cyclic
execution
cyclic execution
execution
-K
S
-K S
S series
Current
Current
Current
Current counting
value
value
value
value
100 1st time 110 1110 2110
2110 2nd time 2120 3120 4120
4120 3rd time 4130 5130 6130
N time
2.2.4
2.2.4
2.2.4
2.2.4
When it uses single PV mode, the HSC will be fully compatible with K5 (Include “ CP=PV event No.).
When it uses multiple PV mode, the HSC will assign a new event No. for 32
High
High
High
High speed
counter
counter
counter
counter
HSC0
HSC1
HSC2 128 “ CV=PV ” interrupt of 1st PV
counting
counting
counting
CV=PV
CV=PV
CV=PV
CV=PV
speed
speed
speed
Interrupt
Interrupt
Interrupt
Interrupt times
Envent
Envent
Envent
Envent No.
Interrupt
Interrupt
Interrupt
Interrupt No.
64 “ CV=PV ” interrupt of 1st PV
65 “ CV=PV ” interrupt of 2nd PV
95 “ CV=PV ” interrupt of 32nd PV
96 “ CV=PV ” interrupt of 1st PV
97 “ CV=PV ” interrupt of 2nd PV
Plus 1
127 “ CV=PV ” interrupt of 32nd PV
times
times
times First
No.
No.
No.
No.
No.
No. Description
Description
Description
Description
First
value
First
value
First value
value Second
Plus 1
Second
value
Second
value
Second value
value Third
PV,
Third
value
Third
value
Third value
value
as shown in following table.
21
K
inco
-K
S
K
inco
K
K inco
inco -K
129 “ CV=PV ” interrupt of 2nd PV
Plus 1
159 “ CV=PV ” interrupt of 32nd PV
160 “ CV=PV ” interrupt of 1st PV
HSC3
2.2.5
How
2.2.5
How
2.2.5
2.2.5 How
How to
Method
Method
Method
Method 1:Use
1) Configure the control byte of HSC and define the current value (i.e. starting value) and the preset value.
2) Use HDEF instruction to define the counter and its operation mode.
3) (Optional) Use ATCH instruction to define the interrupt routines.
4) Use HSC instruction to start the high-speed counter.
161 “ CV=PV ” interrupt of 2nd PV
Plus 1
191 “ CV=PV ” interrupt of 32nd PV
to
use
high
speed
to
use
high
to use
use high
high speed
1:Use
instructions
1:Use
instructions
1:Use instructions
instructions for
counter
speed
counter
speed counter
counter
for
programming
for
programming
for programming
programming
-K
S
-K S
S series
Method
Method
Method
Method 2:Use
In K2 PLC, it provides configuration wizard for high speed counter. Users can use the wizard to configure all
high speed counters and don ’ t need to program. The wizard is as following figure:
After using wizard to configure HSC, user also can use M
2:Use
wizard
2:Use
wizard
2:Use wizard
wizard of
of
of
of HSC
HSC
HSC
HSC
M
ethod
M
M ethod
1
ethod
1
ethod 1
1 to modify the parameters of HSC.
22
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
How to use HSC wizard:
1
Select the counter in【HSC
2 Check Enable HSC , and then continue following configuration.
3 Select counter mode in Mode .
4 Select the starting mode in Start method .
There are two starting method
“ Using HSC instruction ” : If selecting this method , then it needs to execute HSC instruction to start the
HSC . Before executing HSC instruction, it doesn ’ t need to configure the registers and execute HDEF
.
:
23
K
inco
-K
S
K
inco
K
K inco
inco -K
instruction.
“ Run directly at PLC startup ” : If selecting this method , then the HSC will start automatically after PLC
power on without executing any instructions.
5 If user needs to use multiple PV mode, then check Enable multiple PVs and continue to configure all
PV value s and related ‘ Value’and ‘ I nterrupt subroutine ’ . If check ing Update PV and quantity , then
-K
S
-K S
S series
it can adjust the value in【Quantity】to modify the number of
6 If user needs to use single PV mode, then check Update preset value(PV) in ‘ Single PV settings’and
modify the PV value and related interrupt subroutine.
7 For other options, please refer to the descriptions to HSC .
2.3
How
to
use
high
speed
pulse
2.3
How
to
use
high
2.3
2.3 How
How to
to use
use high
Kinco-K S provides 4 channels for high speed pulse output, they are Q0.0,Q0.1 and Q0.4 ,Q0.5.All support
PT0 and PWM output.
. Q0.0 and Q0.1 ,0.4 support maximum 20 0KHz, and Q0. 5 supports maximum 1 0KHz.
KS have one direction output channel for every high speed output. KS provide 1 direction enable control in
SM area.
D irection output
channel
D irection enable
speed
high speed
speed pulse
output
pulse
output
pulse output
output
Q0.0 Q0.1 Q0. 4 Q0. 5
Q0.2 Q0.3 Q0. 6 Q0. 7
SM201.3 SM231.3 SM2 5 1.3 SM2 2 1.3
PV.
C ontrol
Direction output channel output motor direction control signal, corotation output 0,inversion output 1.
Direction enable control can forbid or allow direction output channel. It is highest primary.
If it is forbidden , it won ’ t output direction control signal. The channel will work as common DO.
2.3.1 High speed pulse output instruction
K S provides 3 types of instructions for high speed pulse output.
1 PLS: it is used to output PTO(Single segment or multiple segments) and PWM.
2
2
2
2 Position control: There are 5 instructions, include PREL(Relative positioning), PABS(Absolute
24
K
inco
-K
K
inco
K
K inco
inco -K
positioning) ,PHOME(Homing), PJOG(Jogging) and PSTOP(Emergency stop). User can use these
Note:
When
using
instructions to achieve positioning control easily . Note:
Note:
Note: When
When
using
When using
using position
position
position
position control
control
control
control instructions,
S
-K
S
-K S
S series
instructions,
instructions,
instructions, the
the
the
the
frequency
frequency
frequency
frequency of
3 Following instruction PFLO_F: There are parameters such as input frequency (F) ,electronic gear
ratio (
The frequency of pulse output is equal toFmultiple by electronic gear ratio. When the pulse number
reaches the value
instruction,
instruction,
instruction,
instruction, the
2.3.2
How
2.3.2
How
2.3.2
2.3.2 How
How to
PLS instruction can implement PTO and PWM output function.
PTO Pulse Train Output .
PWM
Descriptions
LD
LD
LD
LD PLS
of
output
of
of output
NUME DENOM
the
the
the frequency
to
use
to
use
to use
use PLS
Pulse-Width Modulation.
Name
Name
Name
Name Usage
pulse
output
pulse
output pulse
pulse must
COUNT
frequency
frequency
frequency of
PLS
instruction
PLS
instruction
PLS instruction
instruction
) , pulse number(
Usage
Usage
Usage Group
must
be
not
less
than
must
be
not
be not
less
not less
less than
COUNT
pulse
pulse
pulse must
must be
, then it will stop output and set
of
output
of
output
of output
output pulse
125Hz.
than
125Hz.
than 125Hz.
125Hz.
) and so on, these parameters can be used as variable.
must
be
be
be not
not
not
not less
must
must be
Group
Group
Group Suitable
DONE
less
than
less
than
less than
than 30Hz.
Suitable
Suitable
Suitable for
K2
K5
Note:
Note:
bit. Note:
Note: When
30Hz.
30Hz.
30Hz.
for
for
for
When
using
When
using
When using
using following
following
following
following
IL
IL
IL
IL PLS PLS
Operan
Operan
Operan
Operan
ds
ds
ds
ds
Q
The PLS instruction is used to load the corresponding configurations of the PTO/PWM from the specified
SM registers and then start outputting pulse until it finish outputting pulse. The pulse output channel is
specified by parameter Q, 0 means Q0.0,1 means Q0.1,2 means Q0.4.
Note: In user program, it only needs to execute PLS instruction once when it is required. It is suggested to use
Input/Out
Input/Out
Input/Out
Input/Out
put
put
put
put
Input INT Constant 0 1 or 2
Q
Data
Type
Data
Type
Data
Data Type
Type Description
U
Description
Description
Description
25
K
inco
-K
S
K
inco
K
K inco
inco -K
edge instruction to execute PLS instruction. If executing PLS executing all the time, then it can ’ t output
normally.
LD
LD
LD
LD
If EN is 1,then PLS is executed.
IL
IL
IL
IL
If CR is 1,then PLS is executed. It won ’ t influence the value of CR.
-K
S
-K S
S series
2.3.2.1
2.3.2.1
2.3.2.1
2.3.2.1 High-speed
The Kinco-K S provides 4 PTO/PWM pulse generators that can be used to output PTO/PWM. Thereof, one
generator is assigned to Q0.0, called PWM0 or PTO0; the second one is assigned to Q0.1, called PWM1 or
PTO1,and the third one is assigned to Q0.4,called PWM2 or PTO2. The forth one is assigned to Q0. 5 ,called
PWM 3 or PTO 3 .
The PTO/PWM pulse generators and the DO mapping area share the memory address Q0.0 ,Q0.1 and Q0.4
Q0.5 . When the user program executes the high speed pulse output instructions, then the PTO/PWM generator
controls the output and prohibits the normal use of this output channel.
relay-output!
PWM
PWM provides a continuous pulse output with a variable duty cycle, and you can control the cycle time and the
pulse width.
The unit of cycle time and pulse width time is microsecond(us) or millisecond(ms). The maximum value of
High-speed
High-speed
High-speed Pulse
Notice: Make sure not to use the PTO and PWM functions if Q0.0 ,Q0.1 and Q0.4 Q0.5 are
PWM
PWM
PWM
Pulse
Output
Pulse
Output
Pulse Output
Output Function
Function
Function
Function
cycle time is 65535. If the pulse width time is greater than the cycle time value, the duty cycle is set to be
100% automatically and the output is on continuously. If the pulse width time is 0, the duty cycle is set to be
0% and the output is off.
PTO
PTO
PTO
PTO
26
K
inco
-K
S
K
inco
K
K inco
inco -K
PTO provides a square wave (50% duty cycle) output, and you can control the cycle time and the number of
the output pulses . The unit of cycle time is microsecond(us) or millisecond(ms).The maximum value of cycle
time is 65535.The range of pulse number is 2~4,294,967,295.If the specified pulse number is less than 2, then
KInco-K S will set related error bit and prohibit the output.
PTO function provides single segment of pulse and multiple segment of pulse.
Single
segment
Single
Single
In single segment pulse mode, it only executes pulse train output once after executing PLS instruction.
segment
Single segment
segment pulse
pulse
pulse
pulse
-K
S
-K S
S series
Multiple
Multiple
Multiple
Multiple segment
In multi-segment pulse mode, CPU automatically reads the configurations of each PTO segment from a
profile table located in V area and executes the related PTO segment.
The length of each segment is 8 bytes, including a cycle time value (16-bit, WORD ) , a reserved value (It
is not used now,16-bit, INT) , and a pulse number value (32-bit, D WORD) .Thereof, all the pulse output
frequency are the same in same segment. It uses PLS instruction to start multiple segment pulse.
In this mode , t he starting address of the profile table is stored in SMW168 (corresponding to PTO0 ) ,SMW178
(corresponding to PTO1) and SMW268(corresponding to PTO2) .T ime base is configured by SM67.3
(corresponding to PTO0) ,SM77.3 (corresponding to PTO1) and SM87.3 (corresponding to PTO2) . The time
base can be in either microsecond or millisecond. All cycle values in the profile table must use same time base,
and cannot be modified when the profile is executing.
The following table describes the format of the profile table.
Byte
offset
Byte
offset
Byte
Byte offset
offset
0 8-bit The number of segments (1 to 64)
1 16-bit
3 16-bit Reserved
segment
segment
segment pulse
1
1
1
1
Length
Length
Length
Length Segment
pulse
pulse
pulse
Segment
Segment
Segment Description
1
Description
Description
Description
Initial cycle time (2 to 65535 times of the time base)
5 32-bit Pulse number(1 to 4,294,967,295)
9 16-bit
11 16-bit Reserved
13 32-bit Pulse number(1 to 4,294,967,295)
2
Initial cycle time (2 to 65535 times of the time base)
27
K
K
K
K inco
1
1
1
1 All the offsets in this column are relative to the starting position of the profile table.
Notice: the starting position of the profile table must be an odd address in V area , e.g. VB3001.
inco
inco
inco -K
-K
S
-K
S
-K S
S series
2.3.2.2
2.3.2.2
2.3.2.2
2.3.2.2 PTO/PWM
Each PTO/PWM generator is provided with some registers in SM area to store its configurations, as shown in
following table.
Q0.0
Q0.0
Q0.0
Q0.0 Q0.1
SM67.0 SM77.0 SM 9 7.0 SM 10 7.0 PTO/PWM
SM67.1 SM77.1 SM 9 7.1 SM 10 7.1 PWM
SM67.2 SM77.2 SM 9 7.2 SM 107 .2 PTO
SM67.3 SM77.3 SM 9 7.3 SM 107 .3 PTO/PWM Time base: 0=1 μ s 1=1ms
SM67.4 SM77.4 SM 9 7.4 SM 107 .4 PWM
SM67.5 SM77.5 SM 9 7.5 SM 107 .5 PTO
SM67.6 SM77.6 SM 9 7.6 SM 107.6 Function selection: 0= PTO
SM67.7 SM77.7 SM 9 7.7 SM 107.7 PTO/PWM Enable/disable: 0=disable;1= enable
Q0.0
Q0.0
Q0.0
Q0.0 Q0.1
SMW68 SMW78 SMW 9 8 SMW 10 8 PTO/PWM Cycle time , Range: 2~65535
SMW70 SMW80 SMW 10 0 SMW 11 0 PWM Pulse width, Range: 0~65535
SMD72 SMD82 SMD 10 2 SMD 11 2 PTO Pulse number, Range: 1~4,294,967,295
SMW168
PTO/PWM
PTO/PWM
PTO/PWM Register
Q0.1
Q0.1
Q0.1 Q0.4
Q0.1
Q0.1
Q0.1 Q0.4
SMW17
8
Register
Register
Register
Q0.4
Q0.4
Q0.4 Q0.4
Q0.4
Q0.4
Q0.4 Description
SMW2 1 8 SMW2 4 8
Q0.4
Q0.4
Q0.4 Description
Description
Description
Description
Description
Description
Description
The starting location of the profile table (byte offset from
V0)For multi-segment PTO operation only
Whether to update the cycle time:
0 = No; 1 = Yes
Whether to update pulse width time: 0=No
1=Yes
Wheter to update the pulse number: 0=No
1=Yes
Update method:
0 = asynchronous update; 1 = synchronous
update
Operation mode:
0 = single segment; 1 = multiple segment
1=PWM
All the default value for control byte, cycle time and pulse number are 0.The way to modify configuration of
PTO/PWM is that configure related control registers first, if it is PTO multiple segment pulse, it also needs to
28
K
inco
-K
S
K
inco
K
K inco
inco -K
configure profile table, and then execute PLS instruction.
Each PTO/PWM generator also provides a status bytes in SM area, user can get the status information of
PTO/PWM generator from the status bytes, as shown in following table.
-K
S
-K S
S series
Q0.0
Q0.0
Q0.0
Q0.0 Q0.1
SM66.0 SM76.0 SM 9 6.0 SM 10 6.0 Reserved
SM66.1 SM76.1 SM 9 6.1 SM 10 6.1 Reserved
SM66.2 SM76.2 SM 9 6.2 SM 10 6.2 Reserved
SM66.3 SM76.3 SM 9 6.3 SM 10 6.3 PWM idle: 0=No, 1=Yes
SM66.4 SM76.4 SM 9 6.4 SM 10 6.4
SM66.5 SM76.5 SM 9 6.5 SM 10 6.5
SM66.6 SM76.6 SM 9 6.6 SM 10 6.6 Reserved
SM66.7 SM76.7 SM 9 6.7 SM 10 6.7 PTO idle: 0=No, 1=Yes
2.3.3.3
2.3.3.3
2.3.3.3
2.3.3.3 PTO
The fallowing takes PTO0 as an example to introduce how to configure and operate the PTO/PWM generator
in the user program.
Q0.1
Q0.1
Q0.1 Q0.4
The PTO idle bit or PWM idle bit indicate the completion of the PTO or PWM output .
PTO
Operations
PTO
Operations
PTO Operations
Operations
Q0.4
Q0.4
Q0.4 Q0.
Q0.
Q0.
Q0. 5
5
5
5 Description
Description
Description
Description
Whether the cycle time or pulse number of PTO is
wrong: 0=No, 1=Yes
Note:
Cycle
Note:
Cycle
Note:
Note: Cycle
Cycle time
than
1.
than
1.
than
than 1.
1.
PTO profile terminated due to user command:
0=No, 1=Yes
time
time
time and
and
pulse
and
pulse
and pulse
pulse number
number
number
number must
must
must
must be
be
greater
be
greater
be greater
greater
There are two procedures for using PTO: Configure related control registers and initialize PTO. Execute PLS
instruction.
Use SM0.1 (the first scan memory bit) to call a subroutine that contains the initialization instructions. Since
SM0.1 is used, the subroutine shall be executed only once, and this reduces CPU scan time and provides a
better program structure.
Execute
Execute
Execute
Execute the
1) Set control byte SMB67 according to the desired operation.
For example, SMB67 = B#16#85 indicates:
the
PTO
the
the PTO
Enable the PTO/PWM function
(Single-Segment
PTO
(Single-Segment
PTO (Single-Segment
(Single-Segment Operation)
Operation)
Operation)
Operation)
29
K
inco
-K
S
K
inco
K
K inco
inco -K
Select PTO operation
Select 1 μ s as the time base
Allow updating the pulse number and cycling time.
2) Set SMW68 according to desired cycle time.
3) Set SMD72 according to desired pulse number.
4) (Optional) use ATCH to a ttach the PTO0-complete event (event 28) to an interrupt routine to respond
in real time to a PTO0-complete event.
-K
S
-K S
S series
5) Execute the
Changing
Changing
Changing
Changing the
Follow these steps to change the PTO cycle time.
1) Set control byte SMB67 according to the desired operation.
For example, SMB67 = B#16#81 indicates :
Enable the PTO/PWM function
Select 1 μ s as the time base
Allow updating the cycle time value.
2) Set SMW68 according to desired cycle time.
3) Execute the
shall be generated.
Changing
Changing
Changing
Changing the
PLS
in struction to configure PTO0 and start it .
the
PTO
the
the PTO
Select PTO operation
the
the
the PTO
Cycle
PTO
Cycle
PTO Cycle
Cycle Time
PLS
in struction to configure PTO0 and start it, then a new PTO with the updated cycle time
PTO
Pulse
PTO
Pulse
PTO Pulse
Pulse Number(Single-Segment
Time
(Single-Segment
Time
(Single-Segment
Time (Single-Segment
(Single-Segment Operation)
Number(Single-Segment
Number(Single-Segment
Number(Single-Segment Operation)
Operation)
Operation)
Operation)
Operation)
Operation)
Operation)
Follow these steps to change the PTO pulse count:
1) Set control byte SMB67 according to the desired operation.
For example, SMB67 = B#16#84 indicates:
Enable the PTO/PWM function
Select PTO operation
30
Select 1 μ s as the time base
Allow u pdating the pulse number
2) Set SMD72 according to desired pulse number.
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
3) Execute the
number shall be generated.
Execute
Execute
Execute
Execute the
1) Set control byte SMB67 according to the desired operation.
For example, SMB67 = B#16#A0 indicates:
Enable the PTO/PWM function
Select PTO operation
Select 1 μ s as the time base
2) Set an odd number as the starting position of the profile table into SMW168.
3) Use V area to configure the profile table.
4) (Optional) Use ATCH to a ttach the PTO0-complete event (event 28) to an interrupt routine to respond in
real time to a PTO0-complete event.
5) Execute the
PLS
in struction to configure PTO0 and start it, then a new PTO with the updated pulse
the
PTO
the
the PTO
Select multi-segment operation
(Multiple-Segment
PTO
(Multiple-Segment
PTO (Multiple-Segment
(Multiple-Segment Operation)
PLS
instruction to configure PTO0 and start it .
Operation)
Operation)
Operation)
2.3.3.3
2.3.3.3
2.3.3.3
2.3.3.3 PWM
Following takes PWM0 as an example to introduce how to configure and operate the PTO/PWM generator in
the user program.
There are two procedures for using PWM: Configure related control registers and initialize PTO. Execute
PLS instruction.
Use SM0.1 (the first scan memory bit) to call a subroutine that contains the initialization instructions. Since
SM0.1 is used, the subroutine shall be executed only once, and this reduces CPU scan time and provides a
better program structure.
PWM
Operations
PWM
Operations
PWM Operations
Operations
31
K
inco
K
inco
K
K inco
inco -K
-K
S
-K
S
-K S
S series
Execute
Execute
Execute
Execute PWM
1) Set control byte SMB67 according to the desired operation.
For example, SMB67 = B#16#D3 indicates:
2) Set SMW68 according to desired cycle time.
3) Set SMW70 according to desired pulse width.
4) Execute the
Changing
Changing
Changing
Changing the
The following steps describes how to change PWM output pulse width.
1) Set control byte SMB67 according to the desired operation.
For example, SMB67 = B#16#D2 indicates:
PWM
PWM
PWM
Enable the PTO/PWM function
Select PWM operation
Select 1 μ s as the time base
Allow u pdating the pulse width value and cycle time value
PLS
in struction to configure PWM0 and start it .
the
Pulse
Width
for
the
PWM
the
Pulse
the Pulse
Pulse Width
Width
Width for
for
for the
the
the PWM
Output
PWM
Output
PWM Output
Output
Enable the PTO/PWM function
Select PWM operation
Select 1 μ s as the time base
Allow u pdating the pulse width value and cycle time value
2) Set SMW70 according to desired pulse width.
3) Execute the
2.3.3
How
2.3.3
How
2.3.3
2.3.3 How
How to
2.3.3.1
How
2.3.3.1
How
2.3.3.1
2.3.3.1 How
How to
Control
Control
Control
Control Registers
For the Position Control instructions,KS1 specifies a control byte for each high-speed output channel t o store
PLS
to
Use
to
Use
to Use
Use Position
to
Modify
to
Modify
to Modify
Modify the
Registers
Registers
Registers and
in struction to configure PWM0 and start it .
Position
Position
Position Control
Control
Control
Control Instructions
the
Current
the
Current
the Current
Current Value
and
Status
and
Status
and Status
Status Registers
Instructions
Instructions
Instructions
Value
Value
Value of
Registers
Registers
Registers
of
Position
of
Position
of Position
Position Control
Control
Control
Control Instructions
Instructions
Instructions
Instructions
32
K
inco
-K
S
K
inco
K
K inco
inco -K
its configurations . Besides, it assigns a current value register(DINT) to store the pulse number which has
outputted currently (This value will increase when run forward and decrease when run reverse).The following
table describes the control byte and the current value.
Description
Q0.0 Q0.1 Q0.4 Q0. 5 Description
SMD212 SMD242 SMD262 SMD2 26
SMD208 SMD238 SDM258 SDM2 22
Q0.0 Q0.1 Q0.4 Q0.4 Description
SM201.7 SM231.7 SM251.7 SM2 2 1.7
SM201.6 SM231.6 SM251.6 SM2 2 1.6
Description
Description
Read only. Current value (Increase when run forward,
decrease when run reverse).It indicates the pulse number
which has already outputted.
Read/Write. New current value. Use to modify the current
value together with specific control bit.
Read/Write. Emergency-Stop bit.
If this bit is 1, no position control instructions can be
executed.
When executing the PSTOP instruction, this bit is set to 1
automatically, and it must be reset in the program.
Read/Write. Reset the current value or not
1 --- Clear the current value.
0 --- Maintain the current value.
-K
S
-K S
S series
SM201.5 SM231.5 SM251.5 SM2 2 1.5 Reserved
Read/Write. Use to modify current value.
SM201.4 SM231.4 SM251.4 SM2 2 1.4
SM201.3 SM231.3 SM251.3 SM2 2 1.3
SM201.0
~
SM201.2
How
Each high speed output channel has one register for current value, they are SMD212,SMD242 and
SMD262 ,SMD226 .The outputted pulse number are stored in these registers. Current value registers are read
How
How
How to
SM231.0~
SM231.2
to
modify
to
modify
to modify
modify current
SM251.0~
SM251.2
current
current
current value
value
value
value
SM2 2 1.0~
SM2 2 1.2
1 - Modify current value.
0 - Maintain the current value.
Read/Write. Direction control bit.
1 --- Disable the direction output channel, it will be used as
normal output.
0 --- Enable the direction output channel.
Reserved
33
K
inco
-K
S
K
inco
K
K inco
inco -K
only, if user needs to modify the current value, it can use following methods.
Method
Method
Method
Method 1
User reset bit to clear current value.
The reset bits for 4 output channels are SM201.6 SM231.6 SM251.6 and SM221.6 .
When the reset bit is 1, PLC will set the current value as 0.Therefore, t only needs one scan time for the
reset bit to activate. When it needs to use this bit, try to avoid to keep this bit always 1 and also and also
avoid to set this bit while the Position Control instruction (Include PHOME, PREL, PABS, JOG and PFLO_F)
is executing , othe rwise the counting value may be wrong.
Following takes channel 0 as example to describe how to reset current value.
(* Network 0 *)
(*Based on homing signal, when it moves to homing, it requires to clear current value*)
LD %SM0.0
PHOME 0, %M0.0, %M0.1, %M0.2, %VW0, %VW2, %VW4, %VD6, %VW10, %M0.4, %M0.5, %MB1
(* Network 1 *)
(*After PHOME finishing, it uses finishing bit “ DONE to clear current value*)
LD %M0.4
R_TRIG
ST %SM201.6
1
1
1
-K
S
-K S
S series
Method
Method
Method
Method 2
Modify current value by using following registers.
Q0.0 Q0.1 Q0.4 Q0. 5 Description
SMD208 SMD238 SDM258 SDM2 22
SM201.4 SM231.4 SM251.4 SM2 21 .4
Here takes channel 0 as example to describe the method: If SM201.4 is 0,then it will maintain the current
value SMD212. If SM201.4 is 1, then it will move the value of SMD208 to SMD212.When it needs to use
this bit, avoid to keep this bit always 1 and also avoid to set this bit while the Position Control instruction
(Include PHOME, PREL, PA BS, JOG and PFLO_F) is executing, otherwise the counting value may be
2
2
2
Read/Write. New current value. Use to modify the
current value together with specific control bit.
Read/Write. Use to modify current value.
1 - Modify current value.
0 - Maintain the current value.
34
K
inco
-K
S
K
inco
K
K inco
inco -K
wrong.
Following takes channel 0 as example to describe how to modify current value:
(* Network 0 *)
(*Based on homing signal, hen it moves to homing, t requires to set current value as 100.*)
LD %SM0.0
PHOME 0, %M0.0, %M0.1, %M0.2, %VW0, %VW2, %VW4, %VD6, %VW10, %M0.4, %M0.5, %MB1
(* Network 1 *)
(*When PHOME instruction finishing, it uses finishing bit DONE to modify current value.*)
LD %M0.4
R_TRIG
MOVE DI#100, %SMD208
ST %SM201.4
2.3.3.2
Can
it
change
2.3.3.2
2.3.3.2
2.3.3.2 Can
Can
Can it
it
it change
maximum
change
maximum
change maximum
maximum output
output
frequency
output
frequency
output frequency
frequency when
when
position
when
position
when position
position control
control
instruction
control
instruction
control instruction
instruction is
is
executing?
is
executing?
is executing?
executing?
-K
S
-K S
S series
PREL Relative position and PABS Absolute position will not change maximum output frequency when
it is executing . It will read the parameters minimum frequency, maximum frequency and
acceleration/deceleration time parameters when it starts, and calculates suitable acceleration/deceleration
segments according to the value of these parameters, then it will start outputting pulse. During pulse
outputting, PREL and PABS will not read the parameters above again, therefore, changing these parameters
will not affect the pulse output.
PJOG Jogging will read pulse input frequency(MAXF) all the time when it is executing, and adjust the
pulse output frequency according to new setting frequency.
PHOME Homing will read the maximum frequency (MAXF) all the time when it is running at maximum
frequency but hasn ’ t found homing signal, and calculate acceleration or deceleration segment automatically
according the new setting frequency, then it will accelerate or decelerate to new frequency to output pulse.
35
K
inco
-K
S
K
inco
K
K inco
inco -K
2.4
How
to
use
2.4
How
2.4
2.4 How
How to
KS105C1-16DT has 1 CAN port, CAN2
KS105C2-16DT has 2 CAN ports,CAN1 and CAN2.
CAN2 support CANopen master protocol and free protocol.CAN1 support free protocol.
CANopen master function of KS is same as K5 and K2.
For free communication instruction( CAN_INIT CAN_WRITE CAN_READ CAN_RX ,CH parameters,0 is
CAN1,1 is CAN2.
CANopen
to
use
CANopen
to use
use CANopen
CANopen
-K
S
-K S
S series
36
Loading...