Kinco-KW User Manual
Kinco-KW User Manual
Kinco-KW User Manual
CONTENT
Chapter 1 General introduction...............................................................................................................................6
2
Kinco-KW series
7.1 Interface...................................................................................................................................................... 71
7.2 Extended bus...............................................................................................................................................72
7.2.1 How to use EX_ADDR instruction to extension module......................................................................72
7.3 Kinco Motion control..................................................................................................................................73
3
Kinco-KW series
4
Kinco-KW series
5
Kinco-KW series
KW series is wireless data collection & control products designed by Kinco.It mix up LPWAN
communication technology and PLC technology. On the one hand, it’s advantages such as user-programming,
multiple IO modules, colorful functions, strong performance and high relieability are kept, which can easily
finish tasks of data collection and terminal calculation. On the other hand, it also provides some wireless
communication interfaces such as LoRa or NB-IoT and network protovols. The communication distance is long.
The penetrate ability and anti-interference ability are strong, which solve the problem of construction, period
and cost. So KW series is very suitable in big-range cover and big-scale connection factory IoT applications.
The following table lists the conditions and requirements for Kinco-KW to work properly.
It is the user's responsibility to ensure that the service conditions are not exceeded.
Transport & Storage
temperature -40℃~+70℃ .
Ambient
conditions Relative humidity 10%~95%,no condensation.
Altitude Up to 3000 m
Mechanical With manufacturer's original packaging,
free falls
conditions 5 falls from 1m of height
Normal operation
Air temperature Open equipment : -10 ~ +55°C
Ambient Relative humidity 10%~95%,no condensation.
condition Altitude Up to 2000 m
Pollution degree for use in pollution degree 2.
5<f<8.4Hz, Occasional: 3.5mm amplitude;
Sinusoidal Continuous:1.75mm mplitude.
Mechanical vibrations 8.4<f<150, Occasional: 1.0g acceleration;
conditions Continuous:0.5g acceleration.
occasional excursions to 15g, 11 ms, half-sine, in each of 6 mutually
shock
perpendicular axes.
Electrostatic
±4kV Contact, ±8kV Air. Performance criteria B.
discharge
a.c. main power: 2KV CM, 1KV DM;
High energy d.c. main power: 0.5KV CM, 0.5KV DM;
surge I/Os and Communication port: 1KVCM.
Performance criteria A.
EMC
main power: 2KV, 5KHz. I/Os and Communication port:
Fast transient
1KV, 5KHz.
bursts
Performance criteria A.
Voltage drops a.c. supply: at 50Hz, 0% voltage for 1 period; 40% voltage
and for 10 periods; 75% voltage for 20 periods.
interruptions Performance criteria A.
Ingress
Water & dust
Protection IP20
protection
Rating
LoRa is one of LPWAN ( Low Power Wide Area Network , lower power consumption WAN )
communication technologies, which is a kind of narrowband wireless scheme based on spread spectrum
technology and very long distance.Its advantages are wide cover range, better anti-interference and lower
transmit power. Lora works in unlicensed band and it is flexible to deploy. Users can buld private net.
KW1 and KW2 series products provide different working frequenc band LoRa communication interface.
This chaoter will introduce its functions and usage in detail.
7
Kinco-KW series
dBm(dB milliwatt)
dBm(dB milliwatt)is the value which stands for power absolute value. The standard is 1Mw.Its formula is
10*lg(P) and P is power(unit is mW). For dBm,there are some direct but useful values:
1mW’s power is 0dBm;1W’s power is 30dBm.
Add 3dBm means power multiply 2; Decrease 3dBm means power divide 2.
Add 10dBm means power multiply 10; Decrease 10dBm means power divide 10.
dB(Decibel)
dB is a abosulte value.
When users think about the difference (dB) between power of A and power of B, use this formula:
10*lg(A/B).
For example, power of A is twice larger than power of B, So 10*lg ( power of A/power of B )
=10*lg2=3dB.
Bandwidth(BW)
Bandwidth is the difference between down frequency and upfrequency for allowable signals of channel.
LoRa’s bandwidth is double-side bandwidth. It is supposed that center frequency of LoRa channel is f and
⭠ ⭠
bandwidth is BW. Then actual frequency range of this channel is ➠ ➠ .
Coding rate(CR)
LoRa use loop checking code to operate front checking and back checking.Under heavy interference, it
can improve reliability of link but add redundancy information when coding.
k
Coding rate is the ratio of useful part in communication data. If coding rate is n ,theneachKbit is useful.
Encoder produces n bit data. n-k is redundant.
Receiver Sensitivity
Receiver sensitivity is the smallest power of received right signal. When signal power is smaller than
standard receiver sensitivity, receiver will not receive.
Receiver sensitivity is ability of weak signal received by testing receiver. The smaller the value is, the
bigger receive ability is. For example, receiver sensitivity of A is -85dBm and B is -140dBm, the receive ability
if B is far better than A and the cover range of B is bigger than A.
Link Budget
The allowable and biggest transmit budget in communication link when communication is stable.
The link budget is the main way that access covering ability of wireless communication ability. In a
specific environment, the bigger the link budget is, the bigger the covering range is.
The working frequency band of KW1’s LoRacommuncation port isdifferent from KW2 and occasions are
different. But their operation methods are same, take KW2 for example.
8
Kinco-KW series
LoRa communication interface supports programming protocol, Kinco interconnection protocol, Modbus
RTU protocol (Master & slave) and free protocol. In programming software, it provides different usage wizards,
parameter confirguration, net status monitoring and etc to as to make it easier for users. In addition, it also
provides many communication instructions so as users can call these instructions to finish online operation for
LoRa.
Operate target
Choose modified interface or device.
Different model’s KW modules provide 1 or 2 LoRa ports and distribute different number.If module only
has 1 LoRa port, the number of this port is 1. If this module has 2 LoRa ports, then users can find number of
each port in silk screen.
【Local port 1】:The parameters of connected module’s LoRa 1 port
【Local port 2】:The parameters of connected module’s LoRa 2 port
【Port 1 net all nodes】 :This option only support【Write】operation,the LoRa port parameters of all modules
that can communicate in wireless net for LoRa port 1 of connected module in PC
【Port 2 net all nodes】 :This option only support【Write】operation,the LoRa port parameters of all modules
that can communicate in wireless net for LoRa port 2 of connected module in PC
9
Kinco-KW series
Performance access
According to communication parameters chosed by users, software will automatically access potential
wirelss communication performance and display results for reference.
【Link budget】: If use current communication parameters, LoRa will arrive link budget theoretically. The
bigger the budget is, the wider the cover range is.
【Receiver sensitivity】: If use current communication parameters, the receiver sensitivity of LoRa. The
smaller the sensitivity is, the stronger ablity the receving ability is. So the distance between transmitter and
receiver can be longer.
10
Kinco-KW series
【 Valid baudrate 】: If use current communication parameters, the rate of LoRa theroretically transmit
user’s valid data. Efficient rate is realted with air transmit rate and coding rate. The higher the air transmit
rate is, the higher the efficient rate is; There are more redundant information in communication data if
coding rate is low. So efficient rate is low.
Time access
After choose communication parameters, user can input【baudrate distance】and single click【Time access】,
this software will automatically calculate【air transmit time】 between transmitter and receiver.
Before using LoRa communication, users need to configure LoRa port parameters. In same
communication net, the parameters of all nodes below must be same: Frequency, air transmit rate, coding rate,
if enable build-in CRC in chip.
LoRa is half duplex communication mode. Receive and transmit cannot operate at one time. In a LoRa net,
only 1 node is under transmit status at one time. So it is
suggested that users use LoRa to build a wireless
communication net of master-slave or star topology.In net,
there is only one master node and other nodes are slave;
Master is used to call and manage net. It will check each
slave in turn. Slave will respond only when it receive
request from master. It is shown in figure.
In actual applications, users can divide different
wireless net in modules in one area by setting different
communication channels or air transmit baudrate. For
example, if there are 100 pcs devices in a workshop, the
communication frequency of 50 pcs device can be set to
2410MHz and another 50 pcs can be set to 2430MHz.
Then these devices can build 2 separate wireless
communication net.
LoRa port support programming protocol ( Master-slave mode )、 Kinco PLC interconnection protocol
(Master-slave mode)、Modbus RTU protocol(Master-slave mode)and free communication.
If there is no communication function in user program, the default is that KW will support programming
11
Kinco-KW series
protocol after powering up. At the same time, it can be used as Kinco PLC interconnection slave and Modbus
RTU slave.
Please note when use wireless programming function: LoRa port of target PLC cannot use free
communication;In LoRa net, it is not allowable to send message from other nodes except for test modules.
So users must stop master’s communication in net!
Kinco PLC interconnection protocol is designed between Kinco PLC network communication. This
protocol uses master-slave mode. There must be only one master in next and other nodes must be slave. Master
visit slave according to setted period and slave could only response after receiving request from master. In
addition, master send “Write data”broadcast message and all slaves will deal with it after receiving broadcast.
If users not enable other communication protocol functions, PLC will be Kinco interconnection slave after
power on and users don’t need to program. For master, Kinco interconnection protocol function has the highest
priority. Once PLC work as interconnection master, this communication prot will not deal with message from
other communication protocols.
Usage
12
Kinco-KW series
Users could enable Kinco PLC interlink function according to steps below.
1) Set LoRa communication parameters of each node according to preamble.
2) Each slave need to have a station number for LoRa port【Hardware】->【Comm】,valid station number is
1~63. In one net, each slave’s station number must be unique.
3) In master’s user project, use Kinco PLC interlink guide to set for each slave. After this, downloading
project into a PLC and this PLC will run as a master. Then enable and arrange communication of the
whole net.
13
Kinco-KW series
Communication settings
Slave visit slaves according to period set by users and visit period of each slave can be set alone.
Data transmission message of each slave can be set to【Timing trigger】 and【Bit trigger】.When timing
of one slave arrives, master will devide if it will transmit data with this slave according to trigger modes set
by users:For data triggered by time, master will enable transmission at once; For data triggered by bit, master
will judge trigger bit. If trigger bit is “0”, master will not enable transmission. If trigger bit is “1”, master
will enable transmission and master will automatically reset trigger bit to “0”.
【Slave ID】:Current slave ID
【Communication cycle】 :Timing which master visit this slave,Unit:ms. The longest timing allowed by KW
is about 49 days.
Users set visit period according to requirements.If it is necessary to update slave data rapidly, then
communication cycle need to be short.If visit period is shorter than time of data transmission, then actual visit
period is time of data transmission. If it is unnecessary to update data rapidly, users can make visit period
bigger so as to decrease slave’s communication frequency and reduce net pressure.
【 Communication timeout 】: After master sends out request, it must receive response message from slave
within this time. Otherwise, slave will record communication timeout error.
【Retry】:After master send out requests, if there is communication error(no response for timeout or error in
received message), master will retry request until communication is successful or repeat time of user setting is
enough.
【Trigger reading】:Specify a variable in M area of master, which is used to trigger to master to read data set as
“Bit trigger”from slave.After reading, master will clear this bit automatically. So in master user program, it is
necessary to set this position to “1”and avoid keeping it to “1” all the time.
【Trigger writing】: Specify a variable in M area of master, which is used to trigger to master to write data set
as “Bit trigger”from slave.After reading, master will clear this bit automatically. So in master user program, it
is necessary to set this position to “1”and avoid keeping it to “1” all the time
14
Kinco-KW series
Broadcast message
Station No.64 is used to send broadcast message and modify all slaves’data of net.
Station No.64 slave doesn’t exist in net. Master will send data set in No.64 slave as broadcast message.All
slaves in net will deal with after receiving message and it is uncessary to reponse.
【slave ID】
:Slave ID.
【Status】 :Communication status of this slave, including: Normal, offline, no successful setting.
When net is enabled, master will send message data communication data area to each slave.After it
is successful, this slave will have normal data link. If it fails, this master will show “No successful setting”
and set this slave repeatedly until it is successful.
When data are interacted normally, master will shown “ Offline ” when this slave has wrong
response. If it is normally next time, it will show “Normal” after communication.
【Real cycle】:The actual period which master make polling visit on slave,unit ms.
【Right Response】: Every time when master receives message from slave, it will detect and record strength
of wireless signals. When signal strength is negative value, the signal strength is higher when it is near to 0. In
applications, if users find communication error ratio of one slave is high but signal strength is low, it is
necessary to improve installation of this slave. For example, users can adjust position of antenna or use
higher-gain antenna.
【Communicate correct rate】: The correct message rate received from slave when master and slave powers
on.
Total amount of correct message responsed by slave
Communicate correct rate = 㟀㟀
Total amount of request message from master
Correct rate of wireless communication might not 100%. It is good if correct rate is over 95%.
KW supports to use Modbus RTU to communicate via LoRa communication interface.Steps are shown
below:
15
Kinco-KW series
The free communication means that the communication process and communication data are completely
controlled by the user program. Users can use free communication to write various custom communication
protocols to communicate with other devices.
When the free communication instructions in the user program is executed, the free communication mode
is activated, and the corresponding communication port is completely occupied by the free communication.
16
Kinco-KW series
After the free communication command is completed, the CPU switches the communication port to the default
protocol automatically. If the PLC is in STOP, the free communication program is disabled and the PLC will
restore the default programming protocol and Modbus RTU slave function.
For the instructions of the instruction, please refer to 2.3.4 Free communication.
All the instructions described in this section are located in the 【Instruction Set】->【Communication
Command】 group.
In the program written with IL language, the functions of all LoRa instructions are consistent with those in
the LD program, and both follow the execution principle of the IL program: if the CR value is 1, the instruction
is scanned and executed, and the execution result does not affect the CR value. .
Therefore, in the below text we only describe the LD format instructions , and will not describe the IL
format again.
LD LORA_RPARAS KW203
KW213
17
Kinco-KW series
The LoRa parameter values read by this instruction correspond to the parameter options in the LoRa
parameter configuration tool of Kincobuilder software.
Parameter Description
EXEC If a rising edge transition of EXEC is detected, the instruction is triggered to execute.
LoRa port number which to be read parameter.
CH
0 means the local port 1, 1 means the local port 2.
The latest implementation result. Its composition is as follows:
7th bit: instruction status. This bit is set to 0 if the instruction is executing and is
immediately set when the instruction completes.
RES
0th bit :illegal LoRa port. This bit is set to 1 if the LoRa port number specified by the CH is
an illegal value.
Other bits are reserved
FREQ The frequency channel option value read.
POWER The value of the transmit power option read.
The value of the bandwidth option read. This value corresponds to the BW option in the
parameter configuration tool:
BW 0 means BW203, 1 means BW406,
2 means BW812, 3 means BW1625,and 4 means FLRC.
0-3 means work in LoRa mode,4 means work in FLRC mode
The value of the air transmission rate option read. This value corresponds to the option in
INDEX the "Air Transfer Rate" list under the current BW option in the parameter configuration
tool: 0 for the first item in the current list, 1 for the second item, and so on.
Read encoding rate value.This value corresponds to the option in the "Encoding rate" list
in the parameter configuration tool:
CR
LoRa mode:Valid value range is:1-4.1 for the first item in the current list, and so on.
FLRC mode:Valid value range is:0-2.0 for the first item in the current list, and so on.
BCRC Read the "Enable chip built-in CRC" option value.
FRAMET The value of the packetized time option read.
BAUD The air transmission rate calculated from the read BW and INDEX option values.
When the EN value is 1, if the rising edge of the EXEC input is detected. the instruction is triggered to
execute once. RES is set to 0 when the instruction is executed. When the instruction is completed (either
success or failure), the 7th bit of the RES is immediately set to 1. If the parameter is read successfully, KW will
update the corresponding output parameter of this instruction according to the value of the LoRa parameter
read, otherwise the value of the relevant output parameter will remain unchanged.
The user can judge whether the instruction is completed according to the rising edge of the 7th bit of the
RES in the program, and then judge whether the reading is successful according to the error value indicated by
other bits.
18
Kinco-KW series
LD LORA_WPARAS KW203
KW213
The LoRa parameter input values in this instruction correspond to the parameter options in the LoRa
parameter configuration tool of Kincobuilder software.
Parameter Description
EXEC If a rising edge transition of EXEC is detected, the instruction is triggered to execute.
The LoRa port number to be modified. The meaning of the input values is as follows:
CH 0 :local port 1; 2 :port 1 network all nodes;
1 :local port 2; 3 :port 2 network all nodes
FREQ New frequency channel option value.
POWER New transmit power option value.
New bandwidth option value. This value corresponds to the BW option in the parameter
BW
configuration tool:
19
Kinco-KW series
When the EN value is 1, if the rising edge of the EXEC input is detected. the instruction is triggered to
execute once, and the new parameter values are used to update the communication parameters of the Lora port
CH.
RES is set to 0 when the instruction is executed. When the instruction is completed (either success or
failure), the 7th bit of the RES is immediately set to 1. The user can judge whether the instruction is completed
according to the rising edge of the 7th bit of the RES in the program, and then judge whether the modification
is successful according to the error value indicated by other bits.
Users should pay attention to the following points when using this instruction:
1) At the same time, only one LORA_WPARAS instruction is allowed to be executed!
2) Modifying the parameters may affect the current normal data communication. Please make changes
under the premise of ensuring security!
3) If you modify the parameters of all nodes in the network, it is recommended that the user execute this
instruction through the master station in the network, and ensure that all nodes can communicate normally! In
addition, since LoRa is a half-duplex communication method, KW cannot accurately determine whether the
parameters of each node have been successfully modified!
20
Kinco-KW series
LD LORA_STATUS KW203
Parameter Description
CH LoRa port number which to be used. 0 means the local port 1, 1 means the local port 2.
STATUS The working status of the LoRa port. This parameter is reserved.
The intensity value of the received signal. The value is a negative number, and the closer
RSSI
to 0, the higher the signal strength.
The signal to noise ratio of the received signal. The larger the signal to noise ratio, the
SNR
better the signal quality.
When the EN value is 1, the instruction is executed. This instruction acquires the signal strength RSSI and
signal to noise ratio SNR detected when the data was last received. The user can judge the quality of wireless
communication according to these parameters: the larger the RSSI value, the higher the received signal strength,
the smaller the attenuation of the signal during transmission; the larger the signal-to-noise ratio, the better the
signal quality. The interference received is smaller.
LD LORA_ARST KW203
KW213
21
Kinco-KW series
Parameter Description
CH LoRa port number which to be used. 0 means the local port 1, 1 means the local port 2.
TXOUT Send timeout , ms.
The number of times the continuous timeout is allowed. If the number of consecutive
TXTRY
transmission timeouts exceeds this value, the LoRa port will be automatically reset.
RXOUT Recieve timeout , ms.
The number of allowed consecutive timeouts. If the number of continuous receive
RXTRY
timeouts exceeds this value, the LoRa port will be automatically reset.
After this power-on, the number of times the LoRa port was reset due to a failure in the
TXRN
transmission timeout.
After this power-on, the number of times the LoRa port was reset due to the failure of the
RXRN
receiving timeout.
This instruction is used to specify the conditions of the LoRa communication port to be automatically
reset. The rising edge of EN triggers the execution of this instruction. After the instruction is executed, the PLC
will store the reset condition specified by the input parameter. In the later LoRa communication process, the
PLC will automatically detect the timeout error of transmission and reception. If the reset condition is met, The
PLC will automatically reset the LoRa communication port. Therefore, if you do not need to adjust the reset
condition multiple times, this instruction can be executed once!
The TXOUT, TXTRY parameters are used to specify the condition that causes a continuous transmission
timeout to cause a reset. When a transmission is initiated, the PLC starts to perform timeout detection. If the
"successful transmission" signal is not detected within the TXOUT time, it is considered to be a transmission
timeout. If the transmission timeout occurs continuously and the number of timeouts reaches the TXTRY value,
the PLC will automatically reset the LoRa communication port and increase the TXRN value by 1.
The RXOUT and RXTRY parameters are used to specify conditions for continuous reception timeouts that
cause a reset. When a reception is initiated, the PLC starts timeout detection. If a message is received within
RXOUT time, it is considered to be a reception timeout. If the transmission and reception timeout occurs
continuously and the number of timeouts reaches the RXTRY value, the PLC will automatically reset the LoRa
communication port and increase the RXRN value by 1.
than 0, the PLC will automatically detect the number of message errors (CRC check errors, etc.). If the
received message error occurs continuously and the number of errors reaches the value of SMB26, the PLC
will automatically reset the LoRa port.
SMB28 is used to store the number of LoRa port resets caused by consecutively receiving message errors.
This reset condition is independent of the LORA_ARST instruction and can be used alone.
This group of instructions is only applicable to the “Kinco PLC Interconnection Protocol”.
In the [Communication Settings], select [CPU], find out the [PLC Hardware Configuration], the
user can see the specific number of each communication port of the machine.
2.3.2.1 SPS_SLV_OP(The master station pauses or restarts communication with the slave station)
LD SPS_SLV_OP KW103
KW203
Parameter Description
The number of the communication port used. 0 means PORT0, 1 means PORT1, 2 means
PORT2, and so on.
PORT
If the parameter value specifies a communication port that does not exist, it is an illegal
value, causing the instruction to report an error.
The station number of the target slave.
SLAVE The slave must already be present in the network, ie it must be configured in the [Kinco
PLC Interconnect Wizard].
The operation options have the following meanings:
CODE
1 ~ The master starts communication with the target slave.
23
Kinco-KW series
When the EN value is 1, the instruction is executed. For the Kinco internetwork running on the PORT
communication port, the user can call this instruction in the master station to suspend or restart communication
with the target slave SLAVE.
LD SPS_MSLAVE KW203
Parameter Description
The number of the communication port used. 0 means PORT0, 1 means PORT1, 2 means
PORT2, and so on.
PORT
If the parameter value specifies a communication port that does not exist, it is an illegal
value, causing the instruction to report an error.
The station number of the target slave.
SLAVE The slave must already be present in the network, ie it must be configured in the [Kinco
PLC Interconnect Wizard].
The operating status of the slave has the following meanings:
1 ~ Normal operation.
STATUS 2 ~ The master station failed to configure the slave station.
3 ~ Offline (that is, the last time request did not receive a response message).
4 ~ The master station calls the SPS_SLV_OP instruction to suspend communication with
24
Kinco-KW series
the slave.
CYCLE The true polling period of the master station to the slave station, unit: ms.
RSSI The last time master station received the signal strength of the slave
the correct rate of the responds message by the slave station. The output value is a 16-bit
integer. Meaning: Correct rate × 100.
MAR
Correct rate = total number of packets correctly responded by the slave ÷ total number of
request packets from the master to the slave
The most recent communication error occurred with this slave.
0 ~ No error.
1 ~ This slave has not responded with a timeout.
ERR 2 ~ The length of the "write data" message is incorrect.
3 ~ "Read data" message length is wrong.
4 ~ Incorrect configuration message.
5 ~ Incorrect communication area configuration.
When the EN value is 1, the instruction is executed. For the Kinco internetwork running on the PORT
communication port, the user can call this command in the master station to read the communication of the
slave SLAVE.
In the [Communication Settings], select [CPU], find out the [PLC Hardware Configuration], the
user can see the specific number of each communication port of the machine.
All communication-enabled communication ports (RS485, LoRa, etc.) support the Modbus RTU master
function.
name Usage
K5
K2
KS
LD MBUSR
KW
25
Kinco-KW series
Note: 1) The parameters SLAVE, ADDR, COUNT must be either constant type or memory type at
the same time.
2) The READ and COUNT parameters together form a variable-length memory block, which
must all be in the legal memory area, otherwise the result is unpredictable.
When the PLC is used as the Modbus RTU master, the MBUSR instruction is used to read the data in the
slave. The function codes for this instruction are 1 (read DO), 2 (read DI), 3 (read AO), and 4 (read AI).
The parameter PORT defines the communication port used. SLAVE defines the station number of the
target slave. The allowed station number ranges from 1 to 255. FUN defines the function code. ADDR defines
the starting address of the register to be read. COUNT defines the number of registers read, and the maximum
allowed is 32.
A rising edge transition on the EXEC input is used to initiate communication. When the MBUSR
instruction is executed, if the rising edge of EXEC is detected, MBUSR will perform a communication:
organize the message according to the parameters such as the station number and function code input by the
user and complete the CRC check, and then send the message and Waiting for the response from the slave
station; after receiving the message returned by the slave station, it performs CRC check, address check and
function code check. If the message proves to be correct after verification, the required data will be written to
the data buffer, otherwise the received message will be discarded.
The parameter READ defines the starting address of the data buffer, and the read data (the number is
COUNT) is stored in this area. READ must match the function code. If the function code is 1, 2, then enter the
BOOL type address variable; if the function code is 3,4, enter the INT or WORD type address variable. The
parameter RES is used to store the current state information and the fault information of the latest
communication. Its composition is as follows:
MSB LSB
7 6 5 4 3 2 1 0
26
Kinco-KW series
name Usage
K5
K2
LD MBUSW KS
KW
Note: 1) The parameters SLAVE, ADDR, COUNT must be either constant type or memory
type at the same time.
2) The READ and COUNT parameters together form a variable-length memory block, which must
all be in the legal memory area, otherwise the result is unpredictable.
When the PLC is used as the Modbus RTU master, the MBUSW instruction is used to write data to the
slave. The function codes for this instruction are 5 (write one DO), 6 (write one AO), 15 (write multiple DOs),
27
Kinco-KW series
7 6 5 4 3 2 1 0
28
Kinco-KW series
LD COM_XMT KW203
Parameter Description
EXEC If a rising edge transition of EXEC is detected, the instruction is triggered to execute.
The number of the communication port used. 0 means PORT0, 1 means PORT1, 2 means
PORT2, and so on.
PORT
If the parameter value specifies a communication port that does not exist, it is an illegal
value, causing the instruction to report an error.
DATA The first address of the storage area of the data to be sent.
29
Kinco-KW series
LD COM_RCV KW203
Parameter Description
EXEC If a rising edge transition of EXEC is detected, the instruction is triggered to execute.
The number of the communication port used. 0 means PORT0, 1 means PORT1, 2 means
PORT2, and so on.
PORT
If the parameter value specifies a communication port that does not exist, it is an illegal
value, causing the instruction to report an error.
Indicates the maximum time allowed for this reception. Unit: ms.
TIMEOUT If the TIMEOUT value is exceeded, the receiving status is exited and the corresponding
flag of the RES is set.
30
Kinco-KW series
Indicates the maximum number of bytes allowed for this reception. The maximum value of
MAXLEN is 248. Unit: Byte.
MAXLEN
If the number of bytes received by the PLC exceeds MAXLEN, only the first MAXLEN
bytes are reserved and processed.
DATA The first address of the storage area where the data is received
When the EN value is 1, if the rising edge of the EXEC input is detected, the instruction is triggered to
execute: the PORT enters the receiving state. If a frame message is received, the receiving is stopped and the
received data is stored in the receiving buffer. Medium (the first address of the buffer is DATA and the length is
LEN). The condition for the end of the receiving process is: if the new character is not continuously received
within the "3.5 character length" time (the instruction will automatically calculate according to the baud rate),
the instruction considers that a complete message has been received and the reception is completed; If the
reception time reaches TIMOUT, the instruction will also complete the reception immediately. After the
reception is completed, the instruction will judge the number of characters received. If it exceeds MAXLEN,
the instruction will only retain the first MAXLEN characters, and the rest will be discarded.
RES is set to 0 when the instruction is executed. When the instruction is completed (either success or
failure), the 7th bit of the RES is immediately set to 1. The user can judge whether the instruction is completed
according to the rising edge of the 7th bit of the RES in the program, and then judge whether the reception is
successful according to the value of other bits: if the value of each bit is 0, the 1st bit is 1 or the 2nd bit is 1 ,
can be considered successful.
31
Kinco-KW series
LD COM_RESET KW203
Parameter Description
EXEC If a rising edge transition of EXEC is detected, the instruction is triggered to execute.
The number of the communication port to be reset. 0 means PORT0, 1 means PORT1, 2
means PORT2, and so on.
PORT
If the parameter value specifies a communication port that does not exist, it is an illegal
value, causing the instruction to report an error.
When the EN value is 1, if the rising edge of the EXEC input is detected, the instruction is triggered to
execute once, and the PORT communication port is reset by pressing the CODE option. RES is set to 0 when
the instruction is executed. When the instruction is completed (either success or failure), the 7th bit of the RES
is immediately set to 1. The user can judge whether the instruction is completed according to the 7th bit of the
RES in the program, and then judge whether the success is successful according to the error value indicated by
other bits.
32
Kinco-KW series
KW standard type provides a variety of CPU specifications, the following table describes the main technical
parameters of various types of CPU.
33
Kinco-KW series
3.3 Functions
The CPU has two modes: 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 specified in the [Hardware Configuration] through Kincobuilder, and only process communication requests
which comes from KincoBuilder software and other Modbus RTU master device.
DI channel
KW CPU provides some DI channel.
DI channel can detect common DI signals.And KW also provides [input filtering] function,User can select
filter delay for DI point (max 12.8 ms),In this way, the DI signal at least maintain the configured delay time
before being considered effective by the CPU,therefore, it is helpful to enhance the anti-interference ability of
the system.
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.
34
Kinco-KW series
DIO channel
KW CPU provides some DIO channels.. Each DIO channel can be used as DI(Source type) or DO (Source
type) ,its signal is DC24V. User doesn’t need to configure the DIO channels ,it will self-adapt according to the
wiring.
Each DIO channel occupies two address, one is for DI(in I area) and the other one is for DO(in Q
area).Take kw203 for example,the first DIO channel address is Q0.0 and I1.0,.If you need to use it as DI, then
you can connect input signal to this channel directly, and use I1.60 in the program.If you need to use it as DO,
then user can connect this channel to output device and use Q0.0 in the program,
Note: If a channel is used as DI, you shouldn’t use DO address of this channel. If a channel is used
as DO, you shouldn’t use DI address of this channel.
35
Kinco-KW series
RS232 can’t insert and release with power. So we should turn off power of CPU or PC, otherwise it will
break ports.
KW provides 1 CAN Bus port,support for Extended Bus Protocol,CANopen (Master ) protocol,Kinco
motion control protocol and Free protocol function.Free protocol can be used with any other protocol in the
same time,however, except for free protocol,other protocols can not be used at the same time.
When use Can port,in order to eliminate the signal reflection on the communication cable,120Ωterminal
resistance is usually added to the first, last or one end of the bus.The CAN port of KW has a built-in 120 Ω
terminal resistance,controlled by the 5th switch:put the switch to ON,the terminal resistance is added;put the
switch to OFF,the terminal resistance is canceled.
Refer to Chapter 7 the use of CAN bus communication ports to learn more about the use of various
functions.
directory of the Kincobuilder software installation directory.Windows XP, Win7 and Win8 (Win10) systems
are currently supported.When the user first uses the programmable data line to connect KW to the computer,
the Windows system will automatically detect the new hardware and prompt the installation of the driver. At
this time, the user can choose the driver under the corresponding directory according to his own version of
Windows.
driver installation software can be used for automatic search and installation.
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] configuration in KincoBuilder, user can select the type of data retentive (Such as V,C area)
and the range.The retentive range in V area is from VB0 to VB2047.The life of battery is 5 years and the
retaining duration is 3 years at normal temperature.
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.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..KW 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.
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.
KW 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 infigure,user can order the battery separately.
38
Kinco-KW series
Mixed use of DI and DO,dotted line represents DO usage,sold line represents DI usage.Sold line represents
source input,dotted line represents source input.
39
Kinco-KW series
3.5 Dimension
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 11V@2.0mA
Input filter time delay
· off-to-on 1.2μs
· on-to-off 0.5μS
Isolation between input and internal
circuit Opto-electrical isolation
· Mode 500VAC/1 min
· Voltage
The simple CPU is a simplified version of the standard,CPU provides some IO,RS485 port and LPWAN
port,it allows users to use Bit Logic Instructions,Numeric Instructions,Logical Operations and Timers to
program and realize simple control and calculation.
Parameter KW213
Power supply
Voltage range DC10V~30V. Note:USB port can also be directly powered for CPU operation.
Wireless port
Type LoRa,Working frequency range 2400 ~ 2500MHZ
Max transmit 100mW
power
RF Baudrate 0.59~253.91Kbps
41
Kinco-KW series
distance Clear weather, open and unobstructed environment, aerial gain 3.5dbi, aerial height
1.5m.
Protocol Support programming protocol,Kinco Interlink、Modbus RTU Slave.
I/O and Expansion
8*DIO(transistor).
IO channel If all channel are only used as DI,then they support source or sink for input.
If used as DI and DO,then DI only support source input.
High speed input 1 channel,max 10KHz,support single and AB phase.
Edge interrupt 4 channels,I0.0-I0.3 interrupt up and down.
Expansion No support.
Wire port
Serial port PORT1:RS485,support Modbus RTU Slave.
USB port 1 channel,MicroUSB type,support programming protocol.
Storage
Programming Max 144 bytes instructions.
Data M area:16 bytes,V area:256 bytes.
VB224~VB255,32 bytes,written to permanent memory automatically by PLC.
Data backup Note: the lifetime of permanent memory is 250000 times. Therefore, it is necessary
to avoid frequently modifying the value of the backup area!
Other
Timer 32. 1 ms : 4, 10 ms : 16,100 ms : 12.
Timer interruption 2 , 0.1ms
RTC No
Installation
100*25.4*84.5mm
dimension
4.2 Function
The CPU has two modes: 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 specified in the [Hardware Configuration] through Kincobuilder, and only process communication requests
which comes from KincoBuilder software and other Modbus RTU master device.
Change CPU status
Kinco KW provides two ways for manually changing the CPU status:
1) The 8th switch is used as RUN/STOP switch,put it to OFF,PLC STOP,put it to ON,PLC RUN.
2) Executing [Debug] -> [RUN] or [STOP] menu command in Kincobuilder.
In addition,PLC RUN mistake (strong mistake) will stop the PLC.
42
Kinco-KW series
LED Description
Run If CPU is in RUN status,it will turn on. If CPU is in STOP status,it will turn off
Net When wireless port read or send data,it Will twinkle.
DIO channel
KW CPU provides some DIO channels.. Each DIO channel can be used as DI(Source type) or DO (Source
type) ,its signal is DC24V. User doesn’t need to configure the DIO channels ,it will self-adapt according to the
wiring.
If all channel are only used as DI,then they support source or sink for input.If used as DI and DO,then DI
only support source input.
Each DIO channel occupies two address, one is for DI(in I area) and the other one is for DO(in Q
area).Take kw203 for example,the first DIO channel address is Q0.0 and I1.0,.If you need to use it as DI, then
you can connect input signal to this channel directly, and use I1.60 in the program.If you need to use it as DO,
then user can connect this channel to output device and use Q0.0 in the program.
Note: If a channel is used as DI, you shouldn’t use DO address of this channel. If a channel is used
as DO, you shouldn’t use DI address of this channel.
The DI channel supports [input filtering] function,User can select filter delay for DI point (max 12.8
ms),In this way, the DI signal at least maintain the configured delay time before being considered effective by
the CPU,therefore, it is helpful to enhance the anti-interference ability of the system.
I0.0-I0.3 in CPU support edge interrupt function,it can execute interrupt by rising edge and falling edge of
input signal,and execute the corresponding interrupt program in the user project.Kw213 can capture the edge of
Di signal with a minimum pulse width of about 100us,by using this function, it can capture the rising edge and
falling edge of input signal quickly.
A part of the DI channels of the CPU body can also be used for the channels of the high-speed pulse
counter. But the same channel, high-speed pulse input function and ordinary DI function cannot be used at the
same time!
KW213 provides 1 high speed counter,HSC0.High speed counter supports single phase, ,AB phase (1
multiplication and 4 multiplication),max 10KHz.
Users can configure it with HSC wizard in KincoBuilder,and download project to CPU,then you can use
it.
43
Kinco-KW series
4.2.6 Switch
44
Kinco-KW series
45
Kinco-KW series
46
Kinco-KW series
4.4 Other
47
Kinco-KW series
High Speed Counter includes the following input signals : clock(ie. Input pulses),direction, start and reset.
In different working modes , it is required to have different input signals.The table below describes the
different working modes and the input signals allocation.
HSC 0
Mode Description I0.1 I0.0 I0.5
0 Single phrase mode
Internally change the counting value
1 Clock Reset
direction(increase /decrease)
2 Direction change Bit:SM37.3 Reset Start
3 Single phrase mode Direction
externally change the counting value Clock
4 direction(increase /decrease) Reset Direction
2 phrase mode
Increase the counting value by phrase Clock
6 clock(plus) and Decrease the counting Clock(Plus)
(Minus)
value by phrase clock (minus)
HSC1
Mode Description I0.4 I0.6 I0.3 I0.2
0 Single phrase mode
Internally change the counting value
1 direction(increase /decrease) Reset Clock
Direction change Bit::SM47.3
2 Reset Start
48
Kinco-KW series
2 phrase mode
6 Increase the counting value by phrase Clock Clock
clock(plus) and Decrease the counting (Minus) (Plus)
7 value by phrase clock (minus) Reset
9 Clock Clock
Phrase A and B counting mode
10 Reset Phrase A Phrase B
HSC 2
Mode Description I0.4 I0.5
Single phrase mode
Internally change the counting value
0 Clock
direction(increase /decrease)
Direction change Bit:SM57.3
9 Phrase A and B counting mode Clock Phrase B Clock Phrase A
HSC 3
Mode Description I0.6 I0.7
Single phrase mode
Internally change the counting value
0 direction(increase /decrease) Clock
Direction change Bit:SM127.3
9 Phrase A and B counting mode Clock Phrase B Clock Phrase A
Control Register
In SM zone, each high speed counter has their own control registers for storing data. The current value
register is used to change the current counting value. When the corresponding current value is set , the HSC
will start to count from this value.
49
Kinco-KW series
1=YES
SM37.7 SM47.7 SM57.7 SM127.7 Allow the HSC to work:0=disable;1=allow
HSC0 HSC1 HSC2 HSC3 Description
SMD38 SMD48 SMD58 SMD128 Current value
SMD42 SMD52 SMD62 SMD132 Preset Value
Attention! In those control registers ,not all control bits are suitable for all working modes. For example ,
‘counting direction ‘ and ‘ Whether write the update direction to HSC’ are only able to be used in mode 0 ,1
and 2(Single phrase mode externally change the counting value direction). If the external direction signal mode
of HSC is used, then those 2 internal control bits will be ignored.
The default value of control word ,current counting value and preset value are 0.
Status Register
Each single high speed counter has their status registers in SM zone . Those status registers are used to
indicate the current status of high speed counter.
HSC0 HSC1 HSC2 HSC3 Description
SM36.0 SM46.0 SM56.0 SM126.0 Reserved
SM36.1 SM46.1 SM56.1 SM126.1 Reserved
SM36.2 SM46.2 SM56.2 SM126.2 Reserved
Is there any error in multiple segments PV table
SM36.3 SM46.3 SM56.3 SM126.3
setting :0=No,1=Yes
SM36.4 SM46.4 SM56.4 SM126.4 Reserved
50
Kinco-KW series
KW allows each HSC has maximum 32 preset values, allows to select the PV to be relative value or
absolute value and allow ‘CV=PV’intterupt happens cyclically. Meanwhile , KW series PLC is compatible to
PV setting method of the old product.
The example is give in the following . It describes the function and setting method of HSC0 PV values in
detail.
PV Table as below.
0 BYTE NO. Of PV
1 DINT The first PV value
5 DINT The second PV value
… DINT …
(1) All offsets are the number of offset bytes relative to the starting position of the table.
(2) When the relative value mode is adopted, the mathematical absolute value of PV value must be
greater than 1. Otherwise, PLC considers that the number of segments ends here, and counts the
number of PV values (prior to the number set value);
When the absolute value mode is adopted, the mathematical absolute value of the difference between
51
Kinco-KW series
two adjacent PV values must be greater than 1, otherwise the PLC considers that the number of
segments ends here, and counts the number of PV values based on it (prior to the number set value);
(3) When setting the PV value, users need to pay attention to that "CV = PV" interrupt must be generated
in order. That means the count value reaches the first PV value and generates an interrupt , then the
PLC will compare with the second PV value, and so on.
(4) PV value setting must be reasonable. Take the relative value for example, when increasing the count,
the PV value must be greater than 0, Otherwise the "CV = PV" interrupt may never be occurred.
When decreasing the count, the PV value must be less than 0, otherwise the "CV = PV" interrupt
corresponding to the value may never be generated.
For example, if three PV values are set, 10, 1000 and 1000 respectively, and the count value is 100 when
the high-speed counter is started, the required values for each interrupt are as follows
Current value No. Of Interrupt The 1st Value The 2nd Value The 3rd Value
100 The fist time 110 1110 2110
2110 The second time 2120 3120 4120
4120 The third time 4130 5130 6130
… The n time … … …
When the single PV value mode is selected, the high-speed counter is fully compatible with K5, including
52
Kinco-KW series
53
Kinco-KW series
54
Kinco-KW series
with K5)", then you can modify the PV value and the associated interrupt subroutine.
7) for other configuration items, please refer to the previous description and configure according to the
actual requirements.
The KW standard CPU provides two channels of high-speed output, with channels of Q0.0 and Q0.1
respectively, which support PTO (pulse train) and PWM (pulse width modulation) mode output. The maximum
output frequency can reach 200kHz (the load resistance is required to be no more than 3KΩ)
KW instruction set provides the following three instructions for high-speed output function:
1) positioning control instructions: there are 5 instructions in total, including PREL (relative motion),
PABS (absolute motion), PHOME(return to origin), PJOG(inching), and PSTOP (emergency stop) instructions.
Users can easily achieve simple positioning control functions. Note: when using the positioning control
command, the output pulse frequency cannot be lower than 80Hz!
2)PLS command: PTO (single-stage or multi-stage) and PWM output functions can be achieved.
3) Tracking instruction PFLO_: this instruction can make the frequency of output pulse change with the
frequency of input. When the number of output pulses reaches the number specified by the user, the output will
be stopped and the completion flag bit will be set. Note: when using follow command, the output pulse
frequency cannot be lower than 30Hz!
Note: if the DO channel is of relay type, avoid using high-speed output function!
For the positioning control command, PLC specifies a direction output channel for each high-speed output,
and also provides a direction prohibition control bit in SM area to prohibit or allow the use of the
corresponding direction output channel.As the following table
Q0.0 Q0.1
Direction Output Channel Q0.2 Q0.3
Direction enable bit SM201.3 SM231.3
The direction output channel is used to output the direction control signal of the motor. The output is 0
when rotating forward and 1 when reversing.
The direction inhibit control bit is used to disable or enable the corresponding direction output channel. If
it is set to disable, the positioning control instruction will not output the direction control signal, and the
corresponding direction output channel can be used as a common D0.
The following figure is the model diagram of positioning control. Users can learn the following
information from the figure: when the positioning control command is executed, the status of the corresponding
55
Kinco-KW series
high-speed output channel; in each state, the positioning control command that PLC allows to execute.
Stopped
(停止)
OP PS T
P ST OP
急停标志位(1)
用户复位
Homing Discrete Motion
PSTOP
(回原点) (不连续运动)
完成 错
/出 /出
错 完成
PH BS
OM PA EL
E PR G
Standstill P JO
(静止)
(1) The Estop flags are SM201.7/ SM231.7. When PSTOD is executed ,this bit is set .
For the positioning control command, PLC allocates a control byte for each high-speed output in SM zone.
Users need to pay attention to set the control byte in the program. In addition, a current value (Dint type)
register is allocated. The following table.
Q0.0 Q0.1 Description
Read Only.Current Value represents the current numbers of pulses has been
SMD212 SMD242
outputed .(CW increases,CCW decrease)
SMD208 SMD238 Read Only.New Current Value.It is matching with flag bit to modify current value
Q0.0 Q0.1 Description
Read and Write.Estop Flag
If this bit is 1, it means it is in emergency stop state and no positioning control
SM201.7 SM231.7 command is executed.
This bit will automatically set to 1 when the PSTOP command is executed. The user
needs to use the program to clear this bit.
Read and write .Used to decide whether reset the current value.
SM201.6 SM231.6 1 - Set the current value to be 0
0 - the current value is maintained
Read and write .Used to decide whether change the current value.
SM201.4 SM231.4 1 - Set the current value to be 0
0 - the current value is maintained
Direction Control Enable Bit
SM201.3 SM231.3 1- Inhabit direction output,Direction Channel as Normal D0
0 - Enable Direction Output
Other Bit Other bit Reserved
56
Kinco-KW series
facilitate the user to modify the current value, PLC provides several methods, which can be used flexibly in the
program. Note: please avoid the reset operation during the movement (including the execution of PHOME,
PREP, PABS, PJOG, PFLO_F instructions), so as to avoid the error of current value count.
The following example programs are all in IL format. In KincoBuilder, the user creates or opens a new
program, and then executes the menu command [Engineering] - > IL language], which will enter the format of
IL editor, then copies and pastes the sample program into IL editor, and then executes the menu command [LD
language], which can be converted to LD program.
Method 1
Use reset control bits (sm201.6 and sm231.6) to clear the current value to 0.
As long as the reset control bit is "1", the PLC will clear the corresponding current value register.
Therefore, the reset control bit only needs to be kept for one scanning cycle ,and avoid keeping "1" for a long
time.
Example given as below is to demonstrate how to clear the current value
(* Network 0 *)
(*Based on the origin. When it is moved to origin,it is required to clear and set to be 0.*)
LD %SM0.0
PHOME
0, %M0.0, %M0.1, %M0.2, %VW0, %VW2, %VW4, %VD6, %VW10, %M0.4, %M0.5, %MB1
(* Network 1 *)
(*PHOME completed,use DONE flag to clear the current value and set to be 0.*)
LD %M0.4
R_TRIG
ST %SM201.6
Method 2
Use the following registers. It may change the current value to be any values.
Q0.0 Q0.1 Description
Read and Write.New Current Value.It is matching with flag bit to modify current
SMD208 SMD238
value
Read and write .Used to decide whether change the current value.
SM201.4 SM231.4 1 - Set the current value to be 0
0 - the current value is maintained
Take channel 0 as an example to illustrate the use method: if sm201.4 is 0, the current value smd212 will
remain unchanged. If sm201.4 is 1, the value in smd208 is assigned to the current value SMD212.
(* Network 0 *)
(*Based on the origin. When it is moved to origin,it is required to set to be 100.*)
LD %SM0.0
PHOME
0, %M0.0, %M0.1, %M0.2, %VW0, %VW2, %VW4, %VD6, %VW10, %M0.4, %M0.5, %MB1
(* Network 1 *)
(*PHOME completed,use DONE flag to modify the current value *)
LD %M0.4
R_TRIG
MOVE DI#100, %SMD208
ST %SM201.
57
Kinco-KW series
When the positioning control instruction is executed, it may generate non fatal errors. At this time, the
CPU will generate an error code and output it to the ERRID parameter of the instruction. The following table
lists these error codes and their descriptions.
Error Code Description
0 No Error
1 The acceleration / deceleration time is too short or the initial speed is too low, resulting in
the initial pulse period exceeding each period of time.
2 The initial speed minf exceeds the maximum allowable speed (200kHz)
3 The initial speed minf is lower than the minimum allowable speed (80Hz)
4 The number of pulses required for initial acceleration and deceleration exceeds the total
number of pulses
5 Initial speed minf exceeds max speed MAXF
6.2.4 PHOME(Homing)
PHOME K5
LD
K2
KS
KW
MODE,DIRC,MINF,MAXF,TIME must be all in the same data type (all in constant or all in
internal memory type)at the same time.
Parameters Description
AXIS High speed output channel used. 0 means Q0.0, 1 means Q0.1, and 2 means Q0.4.
EXEC If the rising edge jump of exec is detected, the PHOME instruction is triggered.
HOME Origin input signal
NHOME Near origin input signal
Returning origin control method:
MODE
0 use origin and near origin input to control;1 use origin input to control;
Motor rotational direction:0 CW;1 CCW
DIRC
Regards to motor direction control signals refers to 6.1 Motor Direction Control Signal
The initial speed (i.e. initial frequency) of the output pulse, in Hz. Minf is
MINF
not allowed to be lower than 125Hz or higher than MAXF.
The highest speed (i.e. the highest frequency) of the output pulse, in Hz.The allowable
MAXF
range of MAXF is 125Hz ~ 200kHz. MAXF must be greater than or equal to MINF
Acceleration / deceleration time, unit: ms. This command uses the same acceleration time
TIME and deceleration time. Acceleration time is the time required for MINF to accelerate to
MAXF, and deceleration time is the time required for MAXF to decelerate to MINF.
Completion flag bit. When the normal execution of the instruction is completed, done
DONE
jumps from 0 to 1.
Error flag bit. If an error occurs during the execution of an instruction, the flag bit is set to
ERR
1.
ERRID Error Code
PHOME command uses the near origin and origin input signals to control the return to the origin. The
parameter mode defines the control mode:
1) If the near origin signal and the origin signal are used for control, when the near origin signal is detected, it
starts to slow down, and when the origin signal is detected, it stops the pulse output. The sequence diagram is
as follows:
59
Kinco-KW series
2). If only the origin signal is used for control, the pulse output will be stopped when the origin signal is
detected. The sequence diagram is as follows:
When the PHOME command is executed and the direction enable control bit is set to 0, the direction
control signal will be output in the corresponding direction. if the DIRC is set to positive rotation, the direction
channel will output the positive rotation signal, and the current value will increase. if the dirc is set to reverse,
the direction channel will output the reverse signal, and the current value will decrease.
After PHOME instruction is operated in highest frequency before returning to the origin and generating
the origin signal, it will read the MAXF value in real time, and automatically calculate the number of
acceleration or deceleration segments according to the new frequency value. Then accelerate or decelerate to
the new frequency value and maintain the uniform output.
It should be noted that the current value register (SMD212 / SM242) does not automatically clear after the
return to the origin movement is completed, and the user needs to change the current value according to the
actual requirements.
LD
When en is 1, if the rising edge of EXEC input is detected, the command is triggered.
IL
When the CR value is 1, if the rising edge of exec input is detected, the command is triggered.
The execution of this instruction does not affect the CR value. If only the origin signal is used for control, the
pulse output will be stopped when the origin signal is detected. The sequence diagram is as follows:
60
Kinco-KW series
LD PABS K5
K2
KS
KW
Influence
Parameter Input/Output Data Type
CR value
AXIS Input INT Constant
EXEC Input BOOL I、Q、V、M、L、SM、RS、SR
MINF Input WORD I、Q、M、V、L、SM、Constant
MAXF Input DWORD I、Q、M、V、L、SM、Constant
TIME Input WORD I、Q、M、V、L、SM、Constant
POS Input DINT I、Q、M、V、L、SM、HC、Constant
DONE Output BOOL Q、M、V、L、SM
ERR Output BOOL Q、M、V、L、SM
ERRID Output BYTE Q、M、V、L、SM
MINF,MAXF,TIME,POS must be all in the same data type (all in constant or all in internal
memory type)at the same time.
61
Kinco-KW series
Completion flag bit. When the normal execution of the instruction is completed, done
DONE
jumps from 0 to 1.
Error flag bit. If an error occurs during the execution of an instruction, the flag bit is set to
ERR
1.
ERRID Error Code
PABS instruction uses absolute positioning . The outputs pulses is based on the difference between the
current value and the target value POS. The difference between the current value and the target value is the
number of output pulses. The sequence diagram of PABS instruction execution is as follows:
When PABS instruction is executed and the direction enable control bit is set to 0, the PAbs instruction
will output the direction control signal of the motor in the corresponding direction output channel. When the
target value is greater than the current value, the output forward signal, the current value will increase. When
the target value is less than the current value, the output reverse signal, the current value will decrease.
LD
When en is 1, if the rising edge of exec input is detected, the command is triggered.
IL
When the CR value is 1, if the rising edge of exec input is detected, the command is triggered.
The execution of this instruction does not affect the CR value.
LD PREL K5
K2
KS
KW
62
Kinco-KW series
Influence
Parameter Input/Output Data Type
CR value
AXIS Input INT Constant
EXEC Input BOOL I、Q、V、M、L、SM、RS、SR
MINF Input WORD I、Q、M、V、L、SM、Constant
MAXF Input DWORD I、Q、M、V、L、SM、Constant
TIME Input WORD I、Q、M、V、L、SM、Constant
DIST Input DINT I、Q、M、V、L、SM、HC、Constant
DONE Output BOOL Q、M、V、L、SM
ERR Output BOOL Q、M、V、L、SM
ERRID Output BYTE Q、M、V、L、SM
MINF, MAXF, TIME, DIST must be all in the same data type (all in constant or all in internal
memory type)at the same time.
The following table describes the function of each parameter in detail.
Parameter Description
AXIS High speed output channel used. 0 means Q0.0, 1 means Q0.1, and 2 means Q0.4.
EXEC If the rising edge jump of exec is detected, the PABS instruction is triggered.
The initial speed (i.e. initial frequency) of the output pulse, in Hz. Minf is
MINF not allowed to be lower than 125Hz or higher than MAXF.
The highest speed (i.e. the highest frequency) of the output pulse, in Hz.The allowable
MAXF
range of MAXF is 125Hz ~ 200kHz. MAXF must be greater than or equal to MINF
Acceleration / deceleration time, unit: Ms. This command uses the same acceleration time
TIME and deceleration time. Acceleration time is the time required for MINF to accelerate to
MAXF, and deceleration time is the time required for MAXF to decelerate to MINF.
DIST Displacement. that is number of pulses to be output.
Completion flag bit. When the normal execution of the instruction is completed, done
DONE
jumps from 0 to 1.
Error flag bit. If an error occurs during the execution of an instruction, the flag bit is set to
ERR
1.
ERRID Error Code
PREL instruction uses relative positioning. The number of output pulses is the displacement DIST. The PREL
instruction sequence diagram of the prior instruction execution is as follows
63
Kinco-KW series
When PREL command is executed and the direction enable control bit is set to 0, PREL command will
output the direction control signal of the motor in the corresponding direction output channel. When the target
value is greater than the current value, the output forward signal, the current value will increase. When the
target value is less than the current value, the output reverse signal, the current value will decrease.
LD
When EN is 1, if the rising edge of EXEC input is detected, the command is triggered.
IL
When the CR value is 1, if the rising edge of EXEC input is detected, the command is triggered.
The execution of this instruction does not affect the CR value.
6.2.7 PJOG(Inching)
LD PJOG K5
K2
KS
KW
Input/Outpu
Parameter Data Type Allowable memory type
t
AXIS Input INT Constant(0 or 1)
EXEC Input BOOL I、Q、V、M、L、SM、RS、SR
MAXF Input DWORD I、Q、M、V、L、SM、Constant
DIRC Input INT I、Q、V、M、L、SM、T、C、AI、AQ、Constant
DONE Output BOOL Q、M、V、L、SM
ERR Output BOOL Q、M、V、L、SM
ERRID Output BYTE Q、M、V、L、SM
MAXF, DIRC must be all in the same data type (all in constant or all in internal memory type)at
the same time.
The following table describes the function of each parameter in detail.
Parameter Description
AXIS High speed output channel used. 0 means Q0.0, 1 means Q0.1, and 2 means Q0.4
EXEC If EXEC is 1,it will continuously output pulses;If it is 0, the output stops
MINF The initial speed (i.e. initial frequency) of the output pulse, in Hz.
Minf is not allowed to be lower than 125Hz.
64
Kinco-KW series
DONE Completion flag bit. When the normal execution of the instruction is completed, done
jumps from 0 to 1.
ERR Error flag bit. If an error occurs during the execution of an instruction, the flag bit is set
to 1.
ERRID Error Code
If exec input is 1, PJOG instruction continuously outputs pulse train with frequency of MAXF from
specified channel AXIS. During the execution, the PJOG instruction will read the input frequency parameter
(MAXF) value in real time and adjust the frequency of the output pulse according to the new frequency value.
If EXEC input is 0, the output is stopped immediately.
When the PJOG instruction is executed and the direction enable control bit is set to 0, then the direction
control signal will be output in the corresponding direction. If the DIRC is set to forward, then the direction
channel will output the forward signal, and the current value will increase. If the DIRC is set to reverse, then
the direction channel will output the reverse signal, and the current value will decrease.
LD
When en is 1, if exec input is 1, the instruction will be executed; if exec input is 0, the execution will be
stopped immediately.
IL
When CR value is 1, if exec input is 1, the instruction is executed.
The execution of this instruction does not affect the CR value. IL
6.2.8 PSTOP(Stop)
Description
K5
LD PSTOP K2
KS
KW
Input/Outp
Operands Data type Acceptable Memory Areas
ut
AXIS Input INT Constant
EXEC Input BOOL I、Q、V、M、L、SM、RS、SR
ERR Output BOOL Q、M、V、L、SM
ERRID Output BYTE Q、M、V、L、SM
Operands Description
The high-speed output channel,
AXIS
0 means Q0.0, 1 means Q0.1, and 2 means Q0.4
EXEC If EN is 1,the EXEC would stop current motion on the rising edge.
Indicates that error has occurred during the execution.
ERR
0= no error,1= an error has occurred .
ERRID Error identification.
The PSTOP instruction is used to stop the pulse output of the AXIS channel immediately, causing the
current movement to come to an emergency stop and at the same time set the Emergency- stop flag is set to 1.
Users need to clear the Emergency-stop fage to 0 , otherwise the CPU will not execute any positioning
control instructions.
LD
When EN is 1,If the EXEC detected rising edge, the instruction is triggered .
IL
When CR is 1, if of EXEC detect the rising edge , the instruction is triggered.
The execution of this instruction does not affect the CR value.
Description
K5
LD PLS K2
KS
KW
IL PLS PLS Q U
Intput/O
Operand Data type Acceptable Memory area
utput
Q Input INT Constant(0 ,1 or 2)
The PLS instruction reads the values of the corresponding control registers in the SM region and configure
the characteristics of the high-speed pulse output, then starts the high-speed pulse output until the specified
pulse output function is completed.The pulse output channel is specified by the parameter Q, 0 means output
with Q0.0, and 1 means output with Q0.1.
Note: in user programs, PLS instruction can be executed only once when needed. It is recommended to
use the output of edge instruction to invoke PLS instruction.If the EN end of PLS is kept at 1, the PLS
66
Kinco-KW series
LD
If EN is 1,PLS instruction is executed.
IL
If CR is 1, PLS instruction is executed.
The execution of this instruction does not affect the CR value.
PWM
PWM function means the Pulse-Width Modulation(PWM).The user can control the cycle and pulse width
of the output.
Cycle and pulse width can be measured in microseconds ( μ s) or milliseconds (ms), with a maximum
cycle value of 65535.When the pulse width is equal to the cycle, the duty cycle is automatically set to 100%
and the output is always switched on.When the pulse width is 0, the duty cycle is 0% and the output is
disconnected.
PTO
The PTO function is able to generate a specific number of pulses in a square pulse train (50% duty cycle).
The user can control the period of the output square wave and the number of output pulses.
The pulse cycle is measured in microseconds (mus) or milliseconds (ms), with a maximum period of
65535.The number of pulses ranges from 2 to 4,294,967,295.If you specify a pulse number less than 2, KW
sets the appropriate error flag bit and disables output.
The PTO function provides two modes of single-segment operation and multi-segment operation.
Single-stage operation
Single-stage operation mode means that PLS instruction outputs only one pulse train at a time, i.e. a set of
pulses with the same frequency.
Multi-stage Operation
Multi-stage operation mode means that PLS instruction will output multiple stage pulse train in turn each
time.
The preset values of each segment are stored in the envelop table of the v-region, and each segment
occupies 8 bytes in the envelop table, including a periodic value (16-bit unsigned integer), a reserved value
(temporarily unused, 16-bit signed integer) and an impulse value (32-bit unsigned double integer). In other
words, all the pulses have the same output frequency in the same segment. Multistage operations are
configured and started using PLS instructions.
The initial position of the envelope table is stored in SMW168 (corresponding to PTO0) and SMW178
(corresponding to PTO1), and the time base can be selected in microseconds or milliseconds through setting of
SM67.3 (corresponding to PTO0) and SM77.3 (corresponding to PTO1). All periodic values in the envelope
table must use the same time base and cannot be changed during envelope execution.
Envelope table format are as follow:
67
Kinco-KW series
Note: The starting position of the envelope table must be an odd number of addresses in the V region ,
E.g:VB3001.
Control registers are provided in the SM area for each PTO/PWM generator to store its configuration
data.As following table shown:
The default value for all control bytes, cycles, and pulses is 0.
The method for users to modify the characteristics of PTO/PWM waveform is: first set the corresponding
control register, if it is a PTO multi-stage operation, the envelop table must be set first, and then execute the
PLS instruction.
In the SM area, a status byte is provided for each PTO/PWM generator. The user can access the status byte
to understand the current status information of the PTO/PWM generator.
The following table.
68
Kinco-KW series
69
Kinco-KW series
Execute PTO(Multi-stage)
1) Set the control byte SMB67 based on the desired operation.
For example, SMB67 = B#16#A0 indicates:
Allows PTO/PWM function;
Select to use PTO function
Select to use Multi-stage operation;
The time base is chosen as 1μs;
2) Assign the start position of the envelop table (odd, indicating the byte offset of the start address of the
envelop table from VB0) to SMW168.
3) Set the relevant values in the envelope table.
4) (optional) connect an interrupt service program to the "PTO0 completed" interrupt event (event no. 27)
with the ATCH instruction to achieve a quick response to the interrupt event.
5) Execute PLS instructions to configure and start PTO0.
Take PWM0 as an example to show how to program to use the PWM function.
Generally speaking, using PWM includes two steps: Setting up the relevant control register;
Execute PLS instruction.
Suggested that the user should write a separate initialization subroutine as much as possible in the project,
which can make the whole project have a good structure. In addition, if possible, try to call the initialization
subroutine in the main program with SM0.1 as the condition, so that the subroutine will only be called and
executed once in the first scan after the CPU is powered up, which can reduce the CPU scan time.
Execute PWM
1) Set the control byte SMB67 based on the desired operation.
For example, SMB67 = B#16#D3 indicates:
Allows PTO/PWM function;
Choose to use PWM function;
Select the synchronous update mode;
The time base is chosen as1μs;
Allows update of pulse width and cycle.
70
Kinco-KW series
7.1 Interface
CAN1 are located in the RJ45 interface (female socket), pins are defined as follows:
When using the CAN communication interface, it is suggested that using the topology of the main line,
and in order to eliminate the signal reflection on communication cable, usually need at the first, both ends or at
the end of the end of the bus to join 120 Ω terminal resistance.
KW series PLC CAN interface with built-in 120 Ω resistor, controlled by the fifth dial the code switch:
Puts dial the switch ON, It means termination resistors has joint;By setting the switch OFF, the terminal
resistance is cancelled.
71
Kinco-KW series
CAN communication port supports the extension bus protocol, could connect extension module of KS
series.If the extension module is configured in the[ Hardware configuration] of the user project, the CAN
interface will work as the extension bus interface, and only free communication instructions are allowed to be
used simultaneously in the user program.
The CPU is allowed to connect up to 14 extension modules, each extension module allows distributed
installation, and the total length of communication cable between the CPU and one extension module at the end
is not allowed to exceed 30 meters.When using the extension bus, it is recommended to add terminal
resistances of the first terminal KW and the last terminal extension module to avoid signal reflection and
enhance communication stability.
In addition, in the case of long-distance distributed installation, it is recommended to adopt a shielded
twisted pair and a single end of the shielding layer is well grounded (controlled), and the communication cable
should be away from strong interference sources, various high-power lines (including power cables of
equipment), and frequently switched pulse signal lines.
In the factory default setting, the CPU module will automatically assign a unique ID and configure various
parameters for each extension module when it is powered up, so it is required that the CPU and all extension
modules are powered up at the same time or all extension modules are powered up before the CPU module,
otherwise it may lead to program execution errors.
However, for the convenience of distributed applications, the CPU provides EX_ADDR instruction, which
can be invoked by the user to modify the above default configuration, thus making the use of extension
modules more flexible.
5) If the user needs to restore the factory default power-on order, change the parameter value of EX_ADDR
instruction in the program to 99 (decimal), and then make EX_ADDR instruction execute once.After
successful execution of the instruction, each extension module clears the saved ID and channel
parameters and waits for the CPU to automatically assign the ID and configure the parameters when it is
powered up again.
Kinco motion control functions are used to control Kinco's motion control products (servo and step drivers)
with CAN interface.Based on the CANOpen protocol, it combines the CANOpen communication details of the
driver with the actual application requirements to provide users with a set of motion control instructions and
corresponding network configuration tools.
This function is easy to use. Even if the user is not familiar with the details of CANOpen protocol, It can
easily communicate with the driver and conduct positioning control.
This function can control up to 32 axis.In practical application, users can determine the number of
connections according to the required program space and network load rate.
This function supports the operation of parameter upload (download), motor lock shaft, loose shaft, return
origin, inching (speed mode), absolute positioning and relative positioning of the motion control product, while
torque mode and master-slave following mode are not supported for the moment.In addition, this function can
be used in principle for all third-party motion control products that support the standard CANopen protocol,
Before use third-party, please consult the technical personnel of the Kinco.
The user follows the steps below to use the Kinco motion control feature:
1) In the user project, enter the [Kinco motion control wizard ] window to complete the network
configuration.
2) Build the project with motion control instruction according to application.
Description please review 7.6.1 Kinco MC Instruction.
3) Download the project to the PLC, the PLC will be started as the master station, management of the entire
network communication, and the implementation of positioning control procedures.
Kinco motion control function adopts CANOpen protocol, PLC as the master station, each driver as the
slave station.Before invoking the directive, the user must first configure the actual CANOpen network being
used.According to the custom of field application, we call the slave station "axis" in the software.
In the "project manager" of Kincobuilder software, double-click the "Kinco motion control network
configuration" node to enter the configuration window and complete the network configuration in the window.
73
Kinco-KW series
The window is divided into three parts: tree list of network nodes, parameters of master station and
parameters of axis (slave station).
Network node tree operation
In the network node tree, the root node is the [CANOpen master station], and each node below is the axis
(slave station) in the network.
It provides [add], [delete], [copy] and [delete] 4 buttons, at the same time the software also provides the
corresponding shortcut and right-click menu functions.Users can take advantage of these capabilities to operate
on network nodes.
Add a new axis
Click the [add] button;Or right-click on any node and execute the add menu command.Or use the ALT+N
shortcut.The axes added using the above three methods all start with default parameters.
Copy、Paste
The user can copy an existing axis and then paste it into the network to generate a new axis. The new axis
has the same parameters as the copied axis except the axis number (slave station address).This is handy for
projects where all the axes in the network function the same.
Click on an axis in the tree to select it, then click the copy button, or use Ctrl+C.Or right-click on an axis
and execute the copy menu command.You can duplicate this axis in any of these ways.
After copying, click the paste button, or use the Ctrl+P shortcut, or right-click on any axis and execute the
paste menu command to generate a new axis in the network.
Delete
You can delete the axis by clicking on an axis to select it, then clicking the [DELETE] button, or by using
the DELETE shortcut.You can also delete an axis by right-clicking on it and executing the delete menu
command.
Master parameter
Click on the [CANOpen master ] node, all parameters of the master station will be modifiable, and all
74
Kinco-KW series
Axis(Slave)
When you click on an axis node, all the parameters of the axis will be modifiable, and all the parameters
of the primary station will be grey and unmodifiable.
【 Slave Address 】: Axis of CANOpen slave station address,Consecutive assignment from station
number must begin with 1.
【Axis type】:According to the function of the shaft, the user can choose either a straight or a rotating
shaft.
【Encoder resolution】:The resolution of the encoder of the shaft or stepping driver, that is, the number
of pulses emitted by the encoder in one rotation.
【 Mechanical equivalent 】: For each rotation of the motor shaft, the length (mm) or Angle ( ° ) of
movement of the mechanical load.
【Node Guarding】:设 Set the node protection time of the axis.Users can use the default value or click
"advanced" to modify it.
【PDO】:PDO are automatically established in the PLC for each axis to transmit information such as
position, speed and status. Since the position and speed of the axis change rapidly, PDO is sent very
frequently, so PDO must be set to prohibit time.The user can use the default values or modify them.
Other
【OK】:Save parameter and exit.
【Cancle】:Not saving and Exit
【Apply】 :Saves the parameters configured by the current setting
【All Axes List】:The axes checklist is designed to facilitate the inspection of all configured and enabled
axis configuration parameters for verification
CANOpen has the advantages of good openness, high reliability, good real-time performance, strong
anti-interference ability and low cost. It is a commonly used field bus in industrial control and has been applied
more and more widely at present.
75
Kinco-KW series
The CANOpen application layer and communication specification (CiA DS301) is the core of the
CANOpen protocol and applies to all CANOpen devices.Various CANOpen communication objects are
defined in DS301 and the services and protocols for these objects are described in detail.In order to facilitate
the user's application, we will introduce several key objects and their communication protocols.
Network management (NMT) is a master-slave model for CANOpen devices.The NMT service can
initialize, start, monitor, reset, or stop CANOpen devices.Within a network, there must be one NMT master
station that has control over the entire network, the network management class (NMT) function..
Here are some common NMT services.
NMT master station controls the NMT state (including stop, preoperation, operation and initialization) of
each slave station through the NMT Node Control message.Slave station devices must support NMT node
control services.
The format of NMT node control message is as follows:
Error control service used for detection of network failure, including Node protection (Node Guarding)
and heart rate (Heartbeat) in two ways.In practice, you must choose an error control method for a node.By the
way,The heartbeat service is added in a later version of the DS301 and is recommended by the CiA.
COB-ID
0x700 + Node ID
76
Kinco-KW series
COB-ID Byte 0
0x700 + Node ID Bit7:Trigger bit, must alternate "0" or "1" in each node protection reply.
Bit0-6:The value of the combination represents the slave station
state.Where, 0 means boot-up and 4 means STOPPED;
5 means Operational;127 means the Pre-Operational.
PDO for real-time data transmission, a PDO message contains up to 8 bytes of data.
PDO communication is based on a producer-consumer model.In terms of sending or receiving data, PDO
is divided into sending PDO (TPDO) and receiving PDO (RPDO).Producers support TPDO and consumers
support RPDO.
PDO communication does not have a protocol that states that the contents contained in a PDO message are
pre-defined.During network configuration, the user defines the cob-id of each PDO and the objects mapped in
it, so that both the producer and consumer can know the content of the corresponding PDO and parse the
message accordingly.
Each PDO is described in the object dictionary by communication and mapping parameters.
The communication parameters of PDO are described below.
77
Kinco-KW series
COB-ID
Indicates the COB-ID used by the PDO.
Transmission type
Indicates how the PDO is triggered to send (or receive).It is an 8-bit unsigned integer value.
Transmission types fall into the following categories:
Synchronization: triggers send (or receive) based on the count of the SYNC object.
If the transmission type value is 0 ,means "synchronous, non-cyclic" and if value is 1-240 ,means
"synchronous, cyclic".
RTR-Only: Only applicable to TPDO, which is triggered by the received RTR message.
If its value is 252 for the transmission type, means that the PDO is sent after receiving SYNC and RTR.A
value of 253 means that PDO is sent immediately after RTR is received.
Event-driven: sends PDO immediately after an internal event occurs on CANOpen device.
A transport type value of 254 indicates a custom event by the device manufacturer.A value of 255
indicates an event defined by the device subprotocol and the application layer protocol, typically a
change in the data value in the PDO or the timer timing time.
Inhibit time
The disable time defines the minimum time interval between consecutive sends of the PDO.
The disable time is configured to avoid the problem of high priority PDO being sent too frequently,
always occupying the bus, and other lower priority packets not being able to use the bus.
Event-timer
Used to specify a periodic value that is timed to be sent.It is a 16-bit unsigned integer in ms.The PDO will
trigger the send with this timing value as a period.If the value is 0, the event timer is not able to used.
In KincoBuilder,enter【Hardware】,Select the CPU module in the table at the top of the window, then click
on the page at the bottom of the window [CANOpen master station] to enter the network configuration page of
CANOpen.
78
Kinco-KW series
[Baud Rate]: Select the baud rate used by the master station. Note that the baud rates of all nodes on the
network must be the same.
[SDO Timeout]: Set the timeout waiting time after the primary station sends an SDO request message. If the
response message of the corresponding slave is not received after this time, an error will be reported. The
SDO timeout value setting generally does not need to exceed 100ms.
[Configure each slave at startup]: If this option is selected, the master station will not only control the NMT
state transition of each slave station, but also the master station will send the corresponding configuration
according to the parameter configuration of each slave station at startup. Command to configure each slave
(such as slave error control mode, PDO mapping, etc.). If this option is not selected, the primary station only
controls the NMT state transition of each slave.
Go to the [Network Configuration] page and continue to configure the slave nodes and their parameters on
the network, as shown below:
79
Kinco-KW series
All function buttons on the page have corresponding right-click menu commands. When the user clicks
the right mouse button at the relevant position, the corresponding right-click menu will pop up, and the menu
command can be used at this time. The following describes the common process of configuring a slave.
a).Add a slave device to the network
Double-click the slave type you want to join the network from the tree list on the left, and add a slave
device of that type to the network and display it in the table on the right.
b).Configure the station number (ID), supervision type and other parameters of the slave device:
The [Address] column in the table on the right is the station number (ID) of the slave. The first line is the
location of station 1.When you add a slave device, it displays its default configuration parameters. When added,
Kincobuilder defaults to adding devices to the table from top to bottom. The user can click on the row in the
table to select a slave, and then click the [Up] and [Down] buttons to adjust its station number, or click the
[Delete] button to take the device from the network. delete.
[Supervised Type] is used to configure the NMT Error Control mode of the node, including node
protection and heartbeat. If the slave device supports both modes at the same time, it is recommended to use
the heartbeat mode first.[Supervised time] indicates the period value of the node protection mode or heartbeat
mode selected earlier. It is recommended that in practical applications, this period value should not be set too
small, for example, it can be set above 2000.
[Heartbeat Consumer Time] The primary station will periodically check whether the heartbeat message of
the slave station is received. If the timeout of this "heartbeat consumer" is still not received, the slave station is
considered to be offline and the corresponding fault handling is performed. It is recommended that in practical
applications, this period value should not be set too small, for example, it can be set above 2000.
[Troubleshooting] is used to select the processing method adopted after the primary station detects the
slave failure, including three options: “None”, “Stop Node” and “Stop Network”. The faults that the primary
station can detect include the SDO command timeout not responding, the node protection or the heartbeat
message timeout, and the receipt of some types of emergency messages sent by the secondary station.
Click on a slave in the table and click [Startup Process] to select what configuration the master needs to
configure for the slave during network startup.
[Reset Node]: Whether the master station sends the "Reset Node" command before sending the configuration
command to the slave station.
[Check device type]: Before the master station sends a configuration command to the slave station, whether to
read the device information for checking.
[Configuration node supervision mode]: Whether the master station needs to configure the supervision type of
the slave station and its parameters.
[Configure PDO Mapping Parameters]: Whether the primary station needs to configure the PDO mapping
parameters of the secondary station.
[Configure PDO communication parameters]: Whether the primary station needs to configure the PDO
communication parameters of the secondary station.
[Start this node]: After the configuration is completed, the master station needs to send the "start node"
command to the slave station.
[Initialize the PDO data of the slave]: After starting the slave, whether the master needs to clear the data in all
the RPDOs of the slave and send it immediately.
81
Kinco-KW series
Go to the Object Dictionary Mapping page to configure PDO for all slaves in the network.The left part of
the page [Added Slave List] shows all the slaves that have joined the network, as well as the objects in the
respective slave object dictionary that are allowed to be mapped to the PDO. Among them, the object in [Send
PDO] can only be mapped to the TPDO of the slave station, and the object in the [Receive PDO] list can only
be mapped to the RPDO of the slave station.
Click on a slave in the [added slave list], then all the PDOs of the slave will be displayed on the right side,
and the user can configure each PDO:
Communication parameters
In the table on the right, select a PDO to modify the communication parameters such as timing time and
prohibition time.Among them, the COB-ID of the first 4 TPDOs and RPDOs in the slave station are not
allowed to be modified, and the default values in the predefined connection set in the DS301 are adopted. The
last four TPDOs and RPDOs allow the user to enter the legal COB-ID value themselves.
Mapping parameter
In the object list on the left, double-click an object, it will be added to the current PDO, and
Kincobuilder will automatically assign a PLC V area address to the object, such as VW1006, the user
operates the V area address in the program. It is equivalent to operating the corresponding object.
[Copy slave]: Select a configured slave and click this button to copy all the information of the slave (itsIt
includes all PDO communication parameters, mapping parameters, etc.). If the selected slave does not have any
PDO configured, the copy fails andPrompt for the corresponding information.
[Paste slave]: After copying a slave successfully, click on a blank line in the selected table, and then click this
82
Kinco-KW series
button to paste the previously copied slave information into the line and generate a new slave. Note: The PLC
memory address corresponding to each mapping object in the new slave PDO remains the same as that in the
source slave. There is no reallocation, and the user needs to modify it.
[Paste slave station (reshare memory)]: The operation method is the same as [Paste slave], but the difference
is that the PLC memory address of each mapping object in the new slave PDO is automatically allocated
without user modification.
KW provides a set of CAN communication commands, which can initialize the CAN port, send and
receive data through the CAN port, etc., and users can use these commands to communicate with other devices.
The CAN communication command supports the CAN2.0A and CAN2.0B standards. In addition, these
commands only support data frames and do not support remote frames. The CAN data frame format is as
follows:
ID byte 1-8
11bit (CAN2.0A, standard frame) or 29 bits (CAN2.0B,
Data of 1-8 bytes length
extended frame)
The CAN free communication function can be used simultaneously with other communication functions
(extension bus, Kinc motion control, CANOpen master and slave), but it is important to note that the
communication baud rate must be consistent.
Note: The ID number of the free communication message is not allowed to use the COB-ID number
in the CANOpen protocol!
For details on the CAN communication instructions, refer to 7.6.3 CAN Free communication instruction.
7.6.1.1 Review
The following instructions are located in the [Kinco Motion Control] group of the instruction set.
name Functional description
MC_RPARAS Read the parameters in the axis drive (see the parameter table below for details)
MC_WPARAS Modify the axis parameters in the drive
MC_POWER Control lock shaft, loose shaft
MC_RESET Reset the error message on the axis and set the axis state to the static wait state
MC_HOME Control axis homing
MC_JOG Control axis jog
MC_MABS Control axis for absolute positioning motion
MC_MREL Control axis for relative positioning movement
MC_MIOT Read the device number of the target axis, software version, IIT, temperature, etc.
83
Kinco-KW series
Precautions
Users should pay attention to the following points when using these instructions:
In a user project, the maximum number of axes allowed: 16 for the KS and KW series and 128 for the
KM series.• The total number of dedicated instructions used in a user project is limited to 192 for the KS
and KW series and 1024 for the KM series. Among them, the MC_MIOT instruction only allows one for
each axis.• For the same axis, when a dedicated instruction is being executed and not completed, it is not
allowed to start another dedicated instruction. If the user program starts another dedicated instruction,
then the instruction will end directly and report the error.
For the same axis, the MC_MIOT instruction has the lowest priority: if other instructions are running, the
MC_MIOT instruction will not be executed; if the MC_MIOT instruction is being executed and the
program starts other instructions, the MC_MIOT instruction will terminate directly.• For the same axis,
before the user program executes the motion command (without the read/write parameter command), the
MC_POWER command must first be executed to lock the axis. After the lock axis is successful, the
homing, relative motion, absolute motion or jog can be continued. instruction. If there is no lock axis,
then executing these kinds of instructions will directly end and report the error.• For the same axis, the
user program uses the MC_RESET instruction to reset. After the reset is successful, the axis will be in the
static waiting state of the loose axis. The MC_POWER command must be executed to lock the axis
before continuing to perform the homing, relative motion, absolute motion or point. Move instructions.
For the homing, relative motion, absolute motion, or jog command, the acceleration and deceleration
used is the acceleration and deceleration set internally by the drive, and can also be set by the
MC_WPARAS command.• The output of each motion control instruction called in the user program is
irrelevant. If an instruction executes an error, its output parameter ERRID will give an error code, and the
result of this error will not be refreshed until the next time the instruction is executed again. The result of
execution of other instructions will not affect the execution result of the instruction!
• After the bus is disconnected (the ONLINE output of the MC_STATE instruction is 1), for safety reasons,
this group of instructions will not be automatically reconnected! After the user has to correct the error, the PLC
can be restarted after the power is turned off!
6 The PLC sent an SDO request message to the target axis, but received an error response
message.
7 The instruction is executed normally, but the PLC continuously detects the state returned by the
target axis, and finally does not detect the correct status value.
The purpose of this group of instructions is to facilitate the user to operate the drive parameters in
batches. For example, the user can set the parameters of the drive at the initial stage of debugging. Please refer
to the driver operation manual for how to set the specific parameters. If the settings are not correct, the
operation may be abnormal. Please operate with caution.
Line axis:mm/min
[-2147483648,
2 Home speed 0x60990120 REAL Ratation Axis: 2147483647]
degree/min
3 Home mode 0x60980008 INT8 DEC [-128,127]
85
Kinco-KW series
86
Kinco-KW series
Other value Each bit of ERRID indicates the operation result of the corresponding parameter, and each bit
corresponds one-to-one with the parameter specified in the ID parameter number table: bit0
indicates the result of the first parameter of the current operation, and bit1 indicates the second
parameter. The result of the operation, and so on. A bit value of 1 indicates that the
corresponding parameter operation failed, otherwise the corresponding parameter operation
succeeds.
3) MC_RPARAS(Read parameter)
KS
LD MC_RPARAS KW103
KW203
87
Kinco-KW series
AXIS and NUM must be either constant type or memory type at the same time. In addition, the ID
and PAPAS parameters together form a variable-length memory block. All of the memory blocks must
be in the legal memory area, otherwise the result is unpredictable.
The three parameters ID, PARAS, and NUM together form a parameter table. The ID is the starting address of
the sequence number table. The serial number of each parameter to be operated is stored successively from this
address (that is, the “serial number” in the previous parameter list), each sequence number occupies 1 byte;
PARAS is the parameter value. The starting address of the table, from which it successively stores the values of
the read parameters, each of which takes up 4 bytes; NUM is the number of parameters to be operated. For
example, suppose the ID parameter is VB100, the PARAS parameter is VD1200, and the NUM parameter is 3.
Then VB100, VB101, and VB102 respectively store the serial numbers of the three parameters to be operated,
and the three parameters read after the execution of the instruction is completed. The values are stored in
VD1200, VD1204, and VD1208.
Note that for PARAS, although the parameter value table uses the DWORD address uniformly, the actual
data types of the various process parameters are not the same. Therefore, in the user program, the user should
process the data in the parameter table according to the actual data type.
If the actual process data type is REAL type, then the parameter memory can be operated directly by the
floating point address. For example, if the parameter value is stored in VD1200, then VR1200 can be
operated directly. Because VD1200 and VR1200 actually occupy the same memory address in the PLC.
If the actual process data type is other than REAL, and the corresponding parameter memory does not
force the data type to be defined in the global variable table, then the parameter memory can be read
directly, because the instruction will automatically handle various signed and Unsigned integer. For
example, if the parameter value is stored in VD1200 and the actual type is INT32 or UINT32, then
VD1200 is directly operated.
LD format instruction description
If EN is 1, then the instruction is triggered to execute on the rising edge of the EXEC input. The
instruction sequentially sends the SDO to the driver to read the corresponding object according to the
parameter table to be read specified by ID and NUM, and will read the corresponding object. The data is placed
in the value table specified by PARAS in turn, and the corresponding bit of ERRID is set to 0. If the SDO
response of a parameter is incorrect or the timeout does not respond, the data of the corresponding address in
PARAS remains unchanged, and the corresponding bit of ERRID is set to 1, and then the next parameter is read.
When all parameters are read, DONE is set to 1, and ERR and ERRID are set to different values according to
the execution result.
If EN is 0, the instruction is not executed. When EXEC becomes 0 during the execution of the instruction,
the instruction will stop reading the parameters that have not been completed, and set DONE to 1, ERR and
ERRID maintain the executed results.
If the PLC detects an error when the command is started (for example, the axis is not enabled, the axis is
executing other commands, etc.), exit directly, set DONE, ERR to 1, and set ERRID to the corresponding error
code.
Example
This example uses the IL format. In Kincobuilder, first select the [IL] format in the [Project] menu, then
copy and paste the example into the editor, and then select [LD format], the program can be displayed as LD
format.
(* Network 0 *)
(*Set the parameter table to indicate that parameters 0, 3, and 8 are to be read this time..*)
88
Kinco-KW series
LD %SM0.0
MOVE B#0, %VB100
MOVE B#3, %VB101
MOVE B#8, %VB102
(* Network 1 *)
(*Call the instruction. This time, AXIS and NUM parameters are constants, they also support the format of full
memory address. *)
LD %M0.0
MC_RPARAS %M1.1, 1, %VB100, 3, %M1.2, %M1.3, %MD8, %VD1200
(* Network 2 *)
(*The read parameter values are sequentially stored in the parameter value table known by the PARAS
parameter. The first data in the table is the first parameter value read, that is, parameter 0. Because it is of type
REAL, the floating-point memory address is read.*)
LD %SM0.0
MOVE %VR1200, %VR300
(* Network 3 *)
(* The second data in the table is the second parameter value read, that is, parameter 0. This parameter is a
signed 8-bit number. Since this data type is not provided in the PLC, it is processed as an integer. *)
LD %SM0.0
DI_TO_I %VD1204, %VW304
(* Network 4 *)
(* The third data in the table is the third parameter value read, parameter 8. This parameter is unsigned 16-bit
number, but the maximum range is 32767, so the program can be processed by INT or WORD type, but it is
best to judge whether the value is within the allowable range. *)
LD %SM0.0
DI_TO_I %VD1208, %VW308
NE %VW308, 0
ST %M3.0
4) MC_WPARAS(Change parameters)
KS
LD MC_WPARAS KW103
KW203
AXIS and NUM must be either constant type or memory type at the same time. In addition, the ID
and PAPAS parameters together form a variable-length memory block. All of the memory blocks must
be in the legal memory area, otherwise the result is unpredictable.
The three parameters ID, PARAS, and NUM together form a parameter table. The ID is the starting
address of the sequence number table. The serial number of each parameter to be operated is stored
successively from this address (that is, the “serial number” in the previous parameter list), and each serial
number occupies 1 byte ;PARAS is the starting address of the parameter value table. From this address, the
values of each parameter are stored in succession, each value occupies 4 bytes; NUM is the number of
parameters to be operated..For example, suppose the ID parameter is VB100, the PARAS parameter is VD1200,
and the NUM parameter is 3. Then VB100, VB101, and VB102 respectively store the serial numbers of the
three parameters to be operated, and VD1200, VD1204, and VD1208 respectively store the parameters to be
modified. value.
Note: for PARAS, although the parameter value table uses the DWORD address uniformly, the actual data
type of each process parameter is not the same, so in the user program in the table, the user should assign a
value to the corresponding address in the parameter table according to the actual data type.
If the actual process data type is REAL type, then the parameter memory can be operated directly by the
floating point address. For example, if the parameter value is expected to be stored in the VD1200, then
the VR1200 can be operated directly. VD1200 and VR1200 actually occupy the same memory address in
the PLC, and the instruction will automatically perform type conversion.
If the actual process data type is other than REAL, the parameter memory can be directly manipulated,
and the instruction will automatically perform type conversion according to the data type of the parameter.
For example, if the parameter data type is UINT16, then a legal value can be directly assigned to
VD1200.
90
Kinco-KW series
LD %SM0.0
MOVE B#0, %VB100
MOVE B#3, %VB101
MOVE B#8, %VB102
(* Network 1 *)
(* Set the value of each parameter to be written. Note the data type. *)
LD %SM0.0
MOVE 1200.0, %VR1000
MOVE DI#8, %VD1004
MOVE DI#2000, %VD1008
(* Network 2 *)
(*Call instruction *)
LD %SM0.0
MC_WPARAS %M0.1, 1, %VB100, %VD1000, 8, %M0.2, %M0.3, %MD4
KS
LD MC_POWER KW103
KW203
KS
LD MC_RESET KW103
KW203
When an axis makes an error during operation, this instruction can be called to reset the error information
on the axis, and at the same time, set the axis to the loose shaft standstill waiting state. If you need to continue
to execute other motion instructions after the reset is successful, you should first call the MC_POWER
instruction to lock the axis!
Note: This instruction only resets the alarm error information of the driver, and does not reset the
output results of each instruction!
LD Format Instructions
If EN is 1, the execution of this instruction will be triggered on the rising edge of EXEC. When the
instruction is executed, the PLC first sends a command to reset the drive alarm, and checks the actual state of
the drive within a timeout period of 2 seconds. If the reset is successful, it indicates that the command was
successfully executed, DONE is set to 1, ERR is set to 0, and ERRID is set 0. If an error occurs (it may be an
error in the execution of the instruction itself or an error that the drive did not perform the action correctly
during execution, see the error code for details), the instruction execution fails, the instruction will stop
executing, and DONE is set to 1, ERR is set to 1, The ERRID is assigned the corresponding error code.
If EN is 0, the instruction is not executed.
92
Kinco-KW series
7.6.1.5 MC_HOME(Homing)
KS
LD MC_HOME KW103
KW203
Acceptable
parameter Input/Output Date type Description
Memory Areas
A rising edge triggers this instruction to execute
EXEC Input BOOL M、V、L、SM
once; a falling edge triggers a pause in motion
V、M、L、 The axis number of the target axis (that is, the
AXIS Input INT
constant address of the CANOpen slave)
V、M、L、
POS Input REAL Origin offset position, unit: mm or °.
constant
V、M、L、 Timeout time. If the origin is not found within this
TIME Input DWORD
constant time, it will exit with an error.
Done flag. When the instruction execution is
DONE Output BOOL M、V、L
completed, DONE transitions from 0 to 1.
Error flag. Set to 1 if an error occurs during
ERR Output BOOL M、V、L
instruction execution.
ERRID Output BYTE V、M、L Error code
By executing this command, the target axis can be returned to the origin. The POS parameter sets the
offset value of the origin coordinates.
Note: This instruction uses the internal homing mode of the driver. You must first set the 60980008
homing mode on the driver (also written by the MC_WPARAS instruction). For details, please refer to
the driver manual.
LD Format Instructions
If EN is 1, the execution of this instruction will be triggered on the rising edge of EXEC.
When the instruction is executed, the PLC first sends a command to start the axis to find the origin;
after the transmission is completed, check the return status of the driver. The inspection will continue for
TIME (timeout time set by the user, unit ms). If the axis successfully finds the origin within this time, it
means that the instruction was executed successfully. At this time, DONE is set to 1, ERR is set to 0, and
ERRID is set to 0. If an error occurs (it may be an error in the execution of the instruction itself or an error
during the execution of the driver during execution, see the error code for details), the instruction execution
fails, the instruction will stop executing, and DONE is set to 1, and ERR is set to 1 , ERRID is assigned the
corresponding error code.If EN is 0, the instruction is not executed.
If EN becomes 0 during the execution, the instruction will stop executing and the axis will be in the
state of static lock and waiting.
93
Kinco-KW series
7.6.1.6 MC_MABS(PABS)
KS
LD MC_MABS KW103
KW203
Acceptable
parame Input / Date
Memory Description
ter Output type
Areas
A rising edge triggers this instruction to execute once; a falling
EXEC Input BOOL M、V、L、SM
edge triggers a pause in motion
V、M、L、 The axis number of the target axis (that is, the address of the
AXIS Input INT
constant CANOpen slave)
V、M、L、
POS Input REAL Absolute target position, unit: mm or °
constant
V、M、L、 Maximum speed (> 0) increased during movement, unit: mm /
VEL Input REAL
constant min or ° / min.
Direction of movement. It is reserved and has not
V、M、L、
DIR Input INT implemented the function for the time being. It can be kept at
constant
0.
Movement mode: single execution or permanent execution.0
means single execution, the command will exit after the axis
executes this absolute positioning.1 means permanent
V、M、L、
MODE Input INT execution. After the axis performs an absolute positioning, the
constant
command does not exit. If a new target position is found, a
command will be sent to allow the axis to continue to perform
a new absolute positioning.
Done flag. When the instruction execution is completed,
DONE Output BOOL M、V、L
DONE transitions from 0 to 1.
Error flag. Set to 1 if an error occurs during instruction
ERR Output BOOL M、V、L
execution.
ERRID Output BYTE V、M、L error code
MODE = 0, single execution, ACT indicates whether the
single positioning instruction is activated correctly. 1 means
active, 0 means inactive.MODE = 1, when executed
ACT Output BOOL M、V、L permanently, ACT indicates whether the permanent
positioning instruction is correctly activated. 1 means active (it
will remain at 1 when single positioning is completed), 0
means not active.
This command controls the target axis to move to the target position (absolute position). When moving,
the speed starts from the current value, and it reaches zero when it reaches the target position. This instruction
allows a pause.
LD Format Instructions
94
Kinco-KW series
If EN is 1, the execution of this instruction will be triggered on the rising edge of EXEC.
When the instruction is executed, the PLC controls the axis to start the absolute positioning of the axis
according to the target position (POS) and motion speed (VEL) parameter values entered by the user. During
the movement, the command will continuously scan the target position and the target speed parameter value. If
there are changes, the command will be sent to the axis immediately, that is, new speed parameters and position
parameter values can be accepted at any time (for example, to perform a pause, during the movement Set the
speed to 0 in the middle to pause, and resume the movement by re-setting the speed value). At the same time,
the PLC will continuously check the return status of the inspection axis. If the target position of this positioning
is successfully reached, indicating that the positioning is completed, DONE is set to 1, ERR is set to 0, and
ERRID is set to 0. After the positioning is completed, the command will judge the MODE value. If it is set to
the single operation mode, the command will exit directly; if it is set to the permanent operation mode, the
command will not exit, and the target position value will be scanned at any time. When it changes, it will be
sent to the axis, and the axis will perform a new absolute positioning.
If an error occurs (it may be an error in the execution of the instruction itself or an error that the drive did
not perform the action correctly during execution, see the error code for details), the instruction execution fails,
the instruction will stop executing, and DONE is set to 1, ERR is set to 1, The ERRID is assigned the
corresponding error code.If EN is 0, the instruction is not executed.
If EN becomes 0 during the execution, the instruction will stop executing and the axis will be in the state
of static lock and waiting.
7.6.1.7 MC_MREL(PREL)
KS
LD MC_MREL KW103
KW203
Input / Acceptable
parameter Date type Description
Output Memory Areas
A rising edge triggers this instruction to execute once; a
EXEC Input BOOL M、V、L、SM
falling edge triggers a pause in motion
The axis number of the target axis (that is, the address of
AXIS Input INT V、M、L、constant
the CANOpen slave)
The relative distance to move, in mm or °.A positive
number indicates movement in the positive direction; a
POS Input REAL V、M、L、constant
negative number indicates movement in the negative
direction.
Maximum speed (> 0) increased during movement, unit:
VEL Input REAL V、M、L、constant
mm / min or ° / min.
Done flag. When the instruction execution is completed,
DONE Output BOOL M、V、L
DONE transitions from 0 to 1.
Error flag. Set to 1 if an error occurs during instruction
ERR Output BOOL M、V、L
execution.
ERRID Output BYTE V、M、L Error code
Whether the instruction is activated correctly. 1 means
ACT Output BOOL M、V、L
active, 0 means inactive.
95
Kinco-KW series
This command controls the target axis to move a specified distance POS (using the current position as a
reference, that is, using the current position as the starting position). When moving, the speed starts from the
current value, and it reaches zero when it reaches the target position. This instruction allows a pause.
7.6.1.8 MC_JOG(JOG)
KS
LD MC_JOG KW103
KW203
Input / Acceptable
parameter Date type Description
Output Memory Areas
A rising edge triggers this instruction to execute once; a
EXEC Input BOOL M、V、L、SM
falling edge triggers a pause in motion
V、M、L、 The axis number of the target axis (that is, the address of
AXIS Input INT
constant the CANOpen slave)
Movement speed, unit: mm / min or ° / min.A positive
V、M、L、
VEL Input REAL number indicates a positive direction, and a negative
constant
number indicates a negative direction.
Direction of movement. It is reserved and has not
V、M、L、
DIR Input INT implemented the function for the time being. It can be
constant kept at 0.
Done flag. When the instruction execution is completed,
DONE Output BOOL M、V、L
DONE transitions from 0 to 1.
ERR Output BOOL M、V、L Error flag. Set to 1 if an error occurs during instruction
96
Kinco-KW series
execution.
ERRID Output BYTE V、M、L Error code
Whether the instruction is activated correctly. 1 means
ACT Output BOOL M、V、L
active, 0 means inactive.
This command controls the target axis to run at the target speed specified by Vel.
LD Format Instructions
If EN is 1, the execution of this instruction will be triggered on the rising edge of EXEC.
When the instruction is executed, the PLC controls the axis to start jogging according to the user-entered
velocity (VEL) parameter value. During the axis movement, the command will continuously scan the target
speed parameter value. If there is a change, the command will be sent to the axis immediately, that is, new
speed parameter values can be accepted at any time.
If an error occurs (it may be an error in the execution of the instruction itself or an error that the drive did
not perform the action correctly during execution, see the error code for details), the instruction execution fails,
the instruction will stop executing, and DONE is set to 1, ERR is set to 1, The ERRID is assigned the
corresponding error code.If EN is 0, the instruction is not executed. If EXEC becomes 0 during the execution,
the instruction will stop executing and the axis will be in the state of static lock and waiting for the axis.
KS
LD MC_STATE KW103
KW203
Input/ Acceptable
Operands Data Type Description
Output Memory Areas
V、M、L、
AXIS Input INT Axis number(CANOpen slave ID)
Constant
POS Output BOOL V、M、L "Position reached" signal
HOME Output BOOL V、M、L "Origin found" signal
CW Output BOOL M、V、L "Motor forward" signal
CCW Output BOOL M、V、L "Motor backward" signal
RUN Output BOOL M、V、L "Motor running" signal
FAULT Output BOOL M、V、L "Axis faulting" signal
The status of DI,BIT0 corresponding to DNI1
INPUT Output WORD V、M、L status.BIT1~BIT7 corresponding to DIN2~DIN8.
The number of DIN please find detail on driver manual
LIMIT Output BOOL M、V、L "Limit reached" signal
97
Kinco-KW series
This instruction scans the driver status all the time, obtains the flags of various states and outputs them to
the corresponding output parameters.
Note: The two signals "position to" and "origin found" will change to 0 again during the execution of the
action (positioning or finding the origin), and will not be reset to 1 until the action is performed correctly!
LD Instruction description
If EN is 1, this instruction is executed. If EN is 0, the instruction does not execute and the output
parameters would not be refreshed.
LD MC_HOME KS
98
Kinco-KW series
This instruction is used to read the product, running state and other information of the target axis. Only
one of these instructions is allowed per axis.
For the same axis, MC_MIOT instruction has the lowest priority: if other motion instruction is running,
MC_MIOT will not execute; If other motion instructions are started, the MC_MIOT instruction is interrupted
and terminated.
The information read by this instruction is divided into three categories, as detailed below.
After each trigger, the PLC performs a reading process. If all reads successfully, the data and length
information in the output parameters are updated. If the read fails, the output parameters are not updated.
Whether it succeeds or fails, the corresponding bit in the RES is flushed when the instruction completes
99
Kinco-KW series
LD Instruction description
If EN is 1, then the corresponding device information will be triggered to read according to the parameters
of EXECV, EXECS and TIMES.
If EN is 0, the instruction is not executed. If EN goes to 0 during execution, the instruction stops
executing.
100
Kinco-KW series
7.6.2.1 SDO_WRITE
KS
LD SDO_WRITE KW103
KW203
Note: NODE, INDEX, SUBINDEX, DATALEN must be constant or variable at the same time. The
DATA and DATALEN parameters make up a variable length block of memory, which must all be in
valid memory regions, otherwise the result is not expected.
0 No mistake.
1 The master station is not enabled
2 Target Node is no existed
3 Incorrect input parameter values (such as data length)
4 The last command on the target node has not response
5 The PLC send or receive buffer is full
6 The instruction timeout did not respond
Error received response message (not expected response message, length error,
7
etc.)
8 Received termination message
9 In this project, the number of SDO instructions exceeded the limit
7.6.2.2 SDO_READ
KS
LD SDO_READ KW103
KW203
102
Kinco-KW series
0 No mistake.
1 The master station is not enabled
2 Target Node is no existed
3 Incorrect input parameter values (such as data length)
4 The last command on the target node has not response
5 The PLC send or receive buffer is full
6 The instruction timeout did not respond
Error received response message (not expected response message, length error,
7
etc.)
8 Received termination message
9 In this project, the number of SDO instructions exceeded the limit
Operands Description
EN The Enable Bit
CH CAN interface used. 0 for CAN1, 1 for CAN2, 2 for K541 module
CAN Baudrate
8 --- 1000K
7 --- 800K
6 --- 500K
BAUD 5 --- 250K
4 --- 125K
3 --- 50K
2 --- 20K
1--- 10K
ERR Instruction execution status. 0 means success, 1 means error (such as parameter error)
This instruction is triggered by rising edge of the EN input that initializes the specified CAN interface
(CH) and sets the CAN baud rate same as BAUD value.
104
Kinco-KW series
LD CAN_TX KS
KW203
Operands Description
EN The Enable Bit.
CH CAN interface used. 0 for CAN1, 1 for CAN2, 2 for K541 module
The period of time for the message to be sent,unit in ms. 0 means that timing sending is not
TIMER
enabled.
ID ID of message to be sent
FMT Format of message to be sent. 0 is the standard frame, and 1 is the extended frame.
DATA The first address of the data store of the message to be sent.
LEN Data length of message to be sent in bytes.
Transmission complete flag. After each successful transmission, DONE is automatically set
DONE
to 1 and maintained for at least one scan period.
ERR Send error flag. 1 indicates that the transmission failed.
Note: ID, FMT, TIMER and LEN parameters must be both constant and variable. The DATA and
LEN parameters form a memory block of variable length, which must all be in the legal memory area,
otherwise the result is unpredictable.
The PLC maintains an automatic message sending list internally. When the message in the table
meets the sending condition, the PLC will automatically send out the message.The condition for
automatic transmission of a message is: if the data in the message changes, it is immediately sent once; If
the set timing of the send cycle time, immediately sent once.After the message is sent, the output
parameter "DONE" is automatically set to 1 and after a scan,set to 0 automatically. If the message
sending fails (because the sending buffer is full or the message fails to send), the output parameter
"ERR" is automatically set to 1.The maximum length of the sent message list is 48.
105
Kinco-KW series
CAN_TX instruction is used to add a message to the message list, which is specified by message ID
number, format (FMT, indicating the extended frame or standard frame), DATA (DATA, indicating the starting
address where the message DATA is stored), and length LEN. The TIMER parameter value indicates the time
period (ms) for timed delivery. If the TIMER value is 0, it means that it will not be timed delivery.
The rising edge of the EN input triggers the execution of the instruction. After the execution of this instruction,
PLC will immediately add the message specified by the instruction to the automatic transmission
list.Therefore, a CAN_TX instruction needs to be executed only once in a project. In addition, up to 48
CAN_TX instructions can be invoked in a project! The total number of CAN_TX and CAN_WRITE
instructions is allowed to be up to 64!
KS
LD CAN_WRITE KW103
KW203
Operands Description
EN The Enable Bit.
CH CAN interface used. 0 for CAN1, 1 for CAN2, 2 for K541 module
ID The ID number of the message which to be sent.
FMT Message format. 0 represents standard frames and 1 represents extended frames.
DATA The address of the beginning byte where the data is to be sent.
LEN Length of data to be sent. Unit: bytes.
Whether the message has been sent. DONE is set to 0 when executing, and DONE is set to 1
DONE
after sent.
Whether the message was sent incorrectly. If the send fails (usually because the send buffer
ERR
is full), ERR is set to 1.
Note: ID, FMT, and LEN must be both constant and variable. The DATA and LEN parameters
make up a variable length memory block that must all be in a valid memory region, otherwise the result
106
Kinco-KW series
is not expected.
CAN message to be sent is specified by ID number, format (FMT, indicating extension frame or standard
frame), DATA (indicating starting address of message DATA storage) and length LEN.
The ascending edge jump of EN input will trigger the execution of this instruction once, and the sent
message will be written into the sending buffer inside PLC, and then sent out through the specified CAN
interface CH by PLC scheduling.
If the instruction successfully writes the message into the send buffer, the execution is completed, and the
DONE will be set to 1. If the buffer is full(sending fails), and the instruction will sets both DONE and ERR to
1.
The total number of CAN_TX and CAN_WRITE instructions allowed in a project is up to 64!
KS
LD CAN_RX KW103
KW203
Operands Description
EN The Enable Bit.
CH CAN interface used. 0 for CAN1, 1 for CAN2, 2 for K541 module
ID The ID number of the message which to be sent.
FMT Message format. 0 represents standard frames and 1 represents extended frames.
Receive mode. 0 represents the always receive mode, and 1 represents the single receive
MODE
mode
TIME Timeout ,Unit in ms.
DONE In single receive mode, DONE is the receive success flag bit.
ERR Receive the timeout flag bit.
107
Kinco-KW series
DATA The first address of the data stored in the last received message.
LEN The data length of the last received message,Unit in bytes.
Note: ID, FMT, MODE and TIME parameters must be both constant and variable. The DATA and
LEN parameters form a memory block of variable length, which must all be in the legal memory area,
otherwise the result is unpredictable.
The PLC maintains a receiving message filter list automatically. The CPU will filter the received
CAN message, and only the message ID and format (standard frame or extended frame) matching the
list value will be received by this instruction.
The CAN_RX instruction is used to add a message to the filter list, which is determined by the specified
ID number (ID, CAN message ID) and format (FMT, indicating extended frame or standard frame).
The MODE parameter indicates the receiving MODE. If the MODE is 1, it is a single receiving MODE.
The instruction only receives the specified message once, and exits after receiving it. If MODE is 0, it is a
permanent receive MODE, and the instruction will always receive the specified message.
The rising edge signal at the EN input triggers the execution of the instruction. After the execution of this
instruction, the specified ID number (ID) and format (FMT) values will be added to the receiving filter list
immediately, and the PLC will enter the receiving state immediately, and the DONE and ERR will be cleared to
0 at the same time.If it is a single receive mode, then if the specified message is received within TIME, the
DONE will be set to 1 and the instruction will exit the receiving state. If the specified message is not received
within TIME, the DONE and ERR will be set to 1 and the instruction will exit the receiving state;If it is a
permanent receiving mode, this instruction will always monitor the CAN interface CH and receive all the
designated messages after starting. If the designated message is not received again in TIME after a successful
receiving, ERR will be set to 1. If the designated message is successfully received again, ERR will be cleared
to 0.Therefore , In permanent receive mode, each CAN_RX instruction needs to be executed only once
instead of repeatedly!
A maximum of 64 CAN_RX instructions can be invoked in a project!
KS
LD CAN_READ KW103
KW203
Operands Description
EN The Enable Bit.
CH CAN interface used. 0 for CAN1, 1 for CAN2, 2 for K541 module
Timeout. After beginning to recive message, if no message is received within the specified
TIME
time, the receiving state will exit over time and ERR will be set to 1
ID The ID number of the message which to be sent.
FMT Message format. 0 represents standard frames and 1 represents extended frames.
DATA The address of the beginning byte where the data is to be sent.
LEN Length of data to be sent. Unit: bytes.
Whether the message has been sent. DONE is set to 0 when executing, and DONE is set to 1
DONE
after sent.
Whether the message was sent incorrectly. If the send fails (usually because the send buffer
ERR
is full), ERR is set to 1.
Note: the DATA and LEN parameters make up a variable length memory block, which must all be
in valid memory regions, otherwise the result is not expected.
The EN input ascent jump will trigger the execution of this instruction: start the receiving state to receive
any message from the specified CAN interface CH.
Begin to receive message, if receive a CAN message within the specified timeout TIME , the PLC would
according to message,set the Output parameters such as ID (ID number), FMT (format, indicate the received
is extended frame or standard frame), DATA (the received the starting address of the packet DATA storage),
LEN (length).Meanwhile,Set DONE set to 1 after finish receiveing.
If no message is received within the specified timeout period, the received status will be quitted with
DONE and ERR set to 1 both.
When started the CAN_READ Instruction ,It would receives any message of the CAN interface, so be
careful do NOT mixing with other protocols, such as CANOpen.
Be careful when mixing.
Note:1) CAN_READ instruction has a lower priority than CAN_RX instruction.
2) After CAN_READ instruction is started, any message on the bus will be received by it.
Therefore, if multiple CAN_READ instructions are called in the program, the last one
instruction will take effect.
109
Kinco-KW series
KS
LD EX_ADDR KW103
KW203
Operands Description
EXEC The Enable bit.If EN is 1, the instruction is enabled, allowing execution.
Operation code.
OP 181 --- Command all extension modules to save their ID and parameters.
99 ---Command all extension modules to clear their ID and parameters.
This instruction sends the appropriate command to the extension module based on the OP value:
If the OP value is 181, the extension module will automatically save its ID and various parameters (such
as signal form, filtering mode, etc.) after receiving the command.When it is powered on again later, the
expansion module will automatically read the saved data and enter into the running state, which does not
require CPU configuration, so it can power on or off independently of the CPU at any time.
If the OP value is 99, the extension module will clear the saved ID and parameters after receiving the
command, and will wait for the CPU module to assign the ID and configure the parameters after re-power
on.
LD instruction description
If EN is 1, the instruction is scanned and execution is started once if the rising edge of EXEC is detected.
If EN is 0, the instruction is not scanned and will not be executed.
110