Kinco PLC Training Kinco Automation Contents Kinco PLC

  • Slides: 79
Download presentation
Kinco PLC Training Kinco Automation

Kinco PLC Training Kinco Automation

Contents Ⅰ • Kinco PLC Profile Ⅱ • Program-Kinco. Builder Fast Start Ⅲ •

Contents Ⅰ • Kinco PLC Profile Ⅱ • Program-Kinco. Builder Fast Start Ⅲ • Program-Kinco. Builder Basic Function Ⅳ • Co. De. Sys for F 1 Program

Kinco PLC Profile Development of Kinco PLC Product Line PLC Hardware Structure

Kinco PLC Profile Development of Kinco PLC Product Line PLC Hardware Structure

Development of Kinco PLC K 3 (Phased out) K 5 F 1 K 2/K

Development of Kinco PLC K 3 (Phased out) K 5 F 1 K 2/K 7 (Coming soon)

PLC Product Line-K 5 series PLCs are small type PLC. It can be used

PLC Product Line-K 5 series PLCs are small type PLC. It can be used in most of common Application such as logic control, analog control, stepper control and so on. Ø K 504 EX CPU Module Ø K 506 EX Ø K 508 Remote I/O Module Ø Digital I/O modules: K 521, K 522, K 523 Ø Analog I/O modules: K 531, K 532, K 533

PLC Product Line-F 1 series PLCs integrate with 3 S company’s software Co. De.

PLC Product Line-F 1 series PLCs integrate with 3 S company’s software Co. De. Sys, which has strong functions and stable performance. CPU Module Ø F 122 -D 1608 T Ø Digital remote I/O modules: Remote I/O Module RP 2 D-1608 C 1, RP 2 D-0016 C 1 Ø Analog remote I/O module: RP 2 A-0402 C 1

Hardware Structure-K 5 Parts Name: 1. I/O status LEDs 2. CPU status LEDs 3.

Hardware Structure-K 5 Parts Name: 1. I/O status LEDs 2. CPU status LEDs 3. Programming interface (RS 232) 4. Wiring terminal 5. 35 mm DIN rail Clip 6. M 4 mounting hole 7. Cover plate for terminal 8. Expansion port 9. Cover plate for expansion port

Hardware Structure-F 1 Parts Name: 1. Power supply terminal and LEDs 2. CPU status

Hardware Structure-F 1 Parts Name: 1. Power supply terminal and LEDs 2. CPU status LEDs 3. Serial port (RS 232/485) 4. I/O status LEDs 5. I/O terminals 6. DIP switches 7. CAN 1 port 8. CAN 2 port 9. Ethernet port

Program—Kinco. Builder Fast Start Kinco. Builder Interface Project Organization Structure Tasks Execution in CPU

Program—Kinco. Builder Fast Start Kinco. Builder Interface Project Organization Structure Tasks Execution in CPU Steps to create new project

Kinco. Builder Interface

Kinco. Builder Interface

Project Organization Structure Program Initial Data CPU process the initial data upon power on

Project Organization Structure Program Initial Data CPU process the initial data upon power on (Optional) then starts scan cycle. Main Program CPU executes main program once per scan cycle. Only 1 main program in a project. Interrupt For process specific interrupt events. CPU executes routines interrupt routines upon occurrence of interrupt event. (Optional) At most 16 interrupt routines are allowable in a project. Subroutines Invoked by main program or interrupt routines. At (Optional) most 16 interrupt routines are allowable in a project. Configuration Hardware Configure CPU and expansion modules in the projects, address, function parameters, etc. Global variables (Optional) For declaring global variables required in the project.

Tasks Execution in CPU executes a series of tasks continuously and cyclically. We take

Tasks Execution in CPU executes a series of tasks continuously and cyclically. We take the cyclical execution of tasks as scan. Executing CPU Diagnostics: CPU executes self-diagnostics to check properation of CPU, memory areas and status of expansion modules. Read inputs: Read all the physical input channels and writes these values to input image areas Executing main program: CPU execute all the instructions in the main program continuously and updates memory areas. Processing Communication requests Writing outputs: CPU write the values stored in output areas to the physical output channels.

Tasks Execution in CPU If interrupt routines are attached in the program, CPU will

Tasks Execution in CPU If interrupt routines are attached in the program, CPU will interrupt scan cycle temporarily when interrupt events occur and immediately execute corresponding interrupt routines. Once interrupt routines is complete, it will back to breakpoint. Execution of Interrupt Routines

Steps to create new project The following simple example just illustrates common steps for

Steps to create new project The following simple example just illustrates common steps for creating and debugging a new project. Assume that we shall create the following project: l project name: “Example”; l Hardware: a Kinco-K 506 -24 AT CPU module; l Control logic” Toggle Q 0. 0 ---Q 0. 7 in turn and cyclically. l And for better structure, we use two POUs: a subroutine named “Demo” to realize logic; the Main Program named “Main” in which “Demo” is involved.

Steps to create new project: Ø Step 1. Launch Kinco. Builder; Ø Step 2.

Steps to create new project: Ø Step 1. Launch Kinco. Builder; Ø Step 2. If necessary, user could modify default setting in Kinco. Builder [Configuring General Software Options]. Ø Step 3. Create a new project by one of the following ways: l Select [Title]>[New project] menu command; l. Click the icon in the toolbar; After the above operation, the “New Project” dialog box will pop up. Users need to enter project name and assign its directory, and then click [Sae], the new project shall be created. In this example, let’s select “D: temp” as the project directory, and project name is “Example”.

Steps to create new project Ø Step 4. Modify hardware configuration in [Configuring Hardware].

Steps to create new project Ø Step 4. Modify hardware configuration in [Configuring Hardware]. In this example, we configure Kinco-K 506 -24 AT as CPU model. Ø Step 5. If necessary, users could configure [Initial Variable Table] and [Global Variable Table] Ø Step 6. Entering instructions in main program and subroutine editor window to realize logical control. Users could select [Project]>[IL] or [Project]>[LD] menu command to change current POU’s language. In this program we take LD as program language. Main Program: When creating a new project, Kinco. Builer will automatically create an empty main program named “MAIN” at the same time.

Steps to create new project Add new Subroutine by one of the following ways:

Steps to create new project Add new Subroutine by one of the following ways: l Click the icon on the toolbar; l Right-click [PROGRAM] node in workplace window, and select [New Subroutine] command on pop-up menu. Then new subroutine will be created with the default name “SBR_0”. Users could rename and subroutines by the following way: Close the subroutine window; right-click on the subroutine node in workplace window, then select [Rename] command to modify the name to “Demo”, or select [Properties] command to make modification in the “Property” dialog box. Also users could rename main program in the same way.

Steps to create new project Subroutine: Demo Main program: Example

Steps to create new project Subroutine: Demo Main program: Example

Steps to create new project Step 7. Compile project. When compiling a project, Kinco.

Steps to create new project Step 7. Compile project. When compiling a project, Kinco. Builder will save it automatically at first to ensure it is the latest. Execute compilation by the following ways: l Select [PLC]>Compile All] menu command; l Click the icon on the toolbar; l. Use shortcut key F 7. The “Compile” tab in the output window keeps a list of the latest compiling messages. Users could double-click on an error message in the “Compile” Window to find the source code. Step 8. Download program. Users need to make sure communication parameters for [connecting PLC with PC] are correct. Download project by the following ways:

Steps to create new project Step 8. Download program. Users need to make sure

Steps to create new project Step 8. Download program. Users need to make sure communication parameters for [connecting PLC with PC] are correct. Download project by the following ways: l Select [PLC]>[Download] menu command; l Click on the icon on the toolbar; l Use shortcut key F 8.

Steps to create new project Step 8. Online Monitor. User could select [Debug]>[Monitor] menu

Steps to create new project Step 8. Online Monitor. User could select [Debug]>[Monitor] menu command or click the icon on the toolbar. Then Kinco. Builder will show values of all the variables used in the program. Users could use the force or unforce function for debugging.

Program—Kinco. Builder Basic Function Data type Memory address Configuring General Software Options Configuring Hardware

Program—Kinco. Builder Basic Function Data type Memory address Configuring General Software Options Configuring Hardware Initial Data Table Global Variable Table Cross Reference Tab Instruction Set Connecting PLC with PC Status Chart Program Edit

Data Type The elementary data types that K 5 supports is shown as following

Data Type The elementary data types that K 5 supports is shown as following table. And data could be defined as constants or variables.

Data Type-Constant ØConstants are characterized by having a fixed value and data type. Definition

Data Type-Constant ØConstants are characterized by having a fixed value and data type. Definition of constants is as follows:

Data Type-Constant

Data Type-Constant

Data Type-Variables ØVariables Variable must have a name and an address in the CPU.

Data Type-Variables ØVariables Variable must have a name and an address in the CPU. Kinco K 5 series PLCs provide two methods to access the memory units: 1. Direct addressing 2. Indirect addressing, i. e. pointer Direct addressing Indirect addressing Directly represented variable Direct address, a special symbolic composed by “%”+memory area identifier + data size + unsigned number Symbolic variable Declare symbolic variables within Global Variable Table or Variable Table of the respective POU. Pointer “&” address operator; “*” pointer operator.

Data Type-Variables Mapping between Direct Address and PLC Memory location:

Data Type-Variables Mapping between Direct Address and PLC Memory location:

Data Type-Variables

Data Type-Variables

Memory Address

Memory Address

Memory Address

Memory Address

Configuring general software options When opening Kinco. Builder, users could configure some general options,

Configuring general software options When opening Kinco. Builder, users could configure some general options, e. g. default programming language, default CPU type for new project. l Select [Tools]>[Options] menu command to open the dialog box:

Configuring Hardware In a project, users are recommended to configure hardware at first. Users

Configuring Hardware In a project, users are recommended to configure hardware at first. Users could configure CPU model and I/O expansion modules used in the project, and set proper parameters for all the models. l Opening Hardware window: 1. Double-click the [Hardware] note in Workplace window; 2. Right-click [Hardware] node , and then select [Open] command on the pop-up menu. l The Hardware Window is composed of two parts: 1. Configuration Table (Upper part) 2. Parameter Window (Lower part)

Configuring Hardware Configuration Table represents real configuration of a real control system. All the

Configuring Hardware Configuration Table represents real configuration of a real control system. All the models used in the project are listed here. Parameter Window shows parameters of all the selected models.

Configuring Hardware l Add/remove modules in Configuration Table Step 1. in the Configuration Table,

Configuring Hardware l Add/remove modules in Configuration Table Step 1. in the Configuration Table, click on a row and place focus on it; Step 2. in the [HW Catalog] window, double-click on a module to add. Right-click on the selected module, and select “[Remove Modules]” to delete.

Configuring Hardware l Set parameters in Parameter Window Once users add modules in the

Configuring Hardware l Set parameters in Parameter Window Once users add modules in the Configuration Table, then users could assign their parameters freely. Click on one module and place focus on it, all its parameters will be displayed in Parameter Window. Parameter configuration of CPU Parameter configuration of Expansion Module I/O Configuration DI Communication Ports DO Retentive Ranges AI Others AO

Configuring Hardware ØI/O Configuration Input/Output addresses of CPU are fixed and start from 0;

Configuring Hardware ØI/O Configuration Input/Output addresses of CPU are fixed and start from 0; Input filter: defines a delay time for DI channel to filter input noise, which helps to enhance anti-interference capacity. Output States while Stop: Set DO in a fixed state while CPU in STOP state.

Configuring Hardware Ø Communication ports Configuration In this window, user could set communication parameters:

Configuring Hardware Ø Communication ports Configuration In this window, user could set communication parameters: Address, Baudrate, Parity, Data. Bits, Stop. Bits and so on. Modbus Master: if check this option, Port 1/2 will work as Modbus RTU master; Timeout : Communication timeout value of Modbus master. Retry: retry times when master receives wrong frame from slave.

Configuring Hardware Ø Retentive Data Configuration Here, users could select ranges of RAM for

Configuring Hardware Ø Retentive Data Configuration Here, users could select ranges of RAM for retaining on power loss. After CPU loses power, values of retentive area will be maintained by the super capacitor and restore upon power on. User could set register type, start address and length of the retentive areas.

Configuring Hardware Ø Others Configuration Permanent backup VB 3648~4095: Check this option to backup

Configuring Hardware Ø Others Configuration Permanent backup VB 3648~4095: Check this option to backup VB 3648~4095 permanently; Backup the project files: Check this option to save the whole project to PLC permanent registers.

Configuring Hardware Ø DI/DO Setting-- Expansion Module DI expansion module DO expansion module The

Configuring Hardware Ø DI/DO Setting-- Expansion Module DI expansion module DO expansion module The start address for DI/DO modules are settable; For DO modules, users also could set Output States while STOP.

Configuring Hardware Ø AI/AO Setting-- Expansion Module AI expansion module AO expansion module The

Configuring Hardware Ø AI/AO Setting-- Expansion Module AI expansion module AO expansion module The start address and signal type for AI/AO modules are settable; For AI modules, user could set filter to reduce noise input; For AO modules, freeze value output while CPU STOP could be set.

Initial Data Table In the Initial Data Table, users could assign initial numerical values

Initial Data Table In the Initial Data Table, users could assign initial numerical values for BYTE, WORD, DWORD, INT, DINT, REAL variables in V area. CPU module processes all variables in Initial Data Table once upon power on. Then start scan cycle. l Opening Initial Data Table: 1. Double-click [Initial Data] node in Workplace window; 2. Right-click [Initial Data] node , and then select [Open] command on the pop-up menu.

Global Variable Table is for declaring global variables which could be used in any

Global Variable Table is for declaring global variables which could be used in any POUs in the project. And a direct address is equivalent to its symbolic name in user program. Opening Global Variable Table: 1. Select [Project]>[Global Variable] menu command; 2. Double-click [Global Variable] node in Workplace window; 3. Right-click [Global Variable] node , and then select [Open] command on the pop-up menu.

Cross Reference Table shows all the variables used in the project. It is much

Cross Reference Table shows all the variables used in the project. It is much helpful for users checking whether a symbolic or an address is already used and where it is used. Information in Cross Reference Table is only generated after first compilation. l Opening Cross Reference Table: 1. Select [Project]>[Cross Reference]menu command; 2. Click the icon in the toolbar; 3. Use the Alt+C shortcut key.

Instruction Set Kinco-K 5 PLCs instruction set accords with IEC 61131 -3 standard for

Instruction Set Kinco-K 5 PLCs instruction set accords with IEC 61131 -3 standard for programming. Basic instructions, standard functions/function blocks are provided. Also some non-standard instructions are available to satisfy different applications. Users could check instruction set supported by the selected CPU in the [Instruction] window. Here we will introduce the most commonly used instructions:

Instruction Set Bit Logic Instructions: Name Normally open contact Symbolic Note Read from image

Instruction Set Bit Logic Instructions: Name Normally open contact Symbolic Note Read from image area. Normally closed contact Normally open immediate contact Normally closed immediate contact Coil Immediate contacts don’t rely on scan cycle and respond to physical input signal more quickly. Write image registers Negated Coil Null Coil indicates the end of a network. Set Coil Set or reset coil when power flow is 1. Reset Coil Immediate Set Coil Immediate Reset Coil Immediate coils don’t rely on scan cycle and write both image register and physical DO on CPU body immediately.

Instruction Set Move Instructions: Name Symbolic Note MOVE Move the value of IN to

Instruction Set Move Instructions: Name Symbolic Note MOVE Move the value of IN to the address OUT. BLKMOVE Move N number of variables from the successive range beginning with the address IN to the successive range beginning with address OUT. FILL Set N number of successive variables, beginning with the address OUT, to the specified constant IN. SWAP Exchange the high byte/word with the lower byte or word of the register.

Instruction Set Compare Instructions: Convert Instructions: Logical Operation Instructions: Note: Compare Instructions: Compare the

Instruction Set Compare Instructions: Convert Instructions: Logical Operation Instructions: Note: Compare Instructions: Compare the INPUT operands and output the result. Logical Operation Instructions: Execute logical operations to the INPUT operands and output the result. Convert Instructions: Convert INPUT data type to other data type.

Instruction Set Shift/Rotate Instructions: Numeric Instructions are mainly for simple math operations: Addition, subtraction,

Instruction Set Shift/Rotate Instructions: Numeric Instructions are mainly for simple math operations: Addition, subtraction, multiplication, division and so on. Name Symbolic Note SHL (Shift left) Rotate value of IN to the left by N bits, and original bits are filled with zero. ROL (Rotate left) Rotate value of IN to the left by N bits, and MSB is rotated to LSB. SHL_BLK (Bit Strings Shift Left) SHL_BLK is similar with SHL, which is to shift a strings of bit to the left. .

Instruction Set Numeric Instructions: Numeric Instructions are mainly for simple math operations: Addition, subtraction,

Instruction Set Numeric Instructions: Numeric Instructions are mainly for simple math operations: Addition, subtraction, multiplication, division and so on. Name Symbolic Note INC OUT=IN + 1. DEC OUT=IN – 1.

Instruction Set Program Control Instructions: Clock Instructions: Additional Instructions: Note: Program Control Instructions: To

Instruction Set Program Control Instructions: Clock Instructions: Additional Instructions: Note: Program Control Instructions: To realize program JUMP/CALL/RETURN/END/LOOP and so on functions. Clock Instructions: For adjusting real-time clock in CPU. Additional Instructions: Assist users to satisfy special application.

Instruction Set Interrupt Instructions: Counter Instructions: Communication Instructions: Timer Position Control Instructions: PID The

Instruction Set Interrupt Instructions: Counter Instructions: Communication Instructions: Timer Position Control Instructions: PID The above instruction sets will be introduced in advanced chapter.

Connecting PLC with PC K 5 series PLC Port 0 is for connecting with

Connecting PLC with PC K 5 series PLC Port 0 is for connecting with PC to download and online debugging. For downloading program form PC into PLC, users need to use correct cable and set proper communication parameters. The steps are as follows: 1. Communication cable Note: After user connecting PLC with PC via the cable, then users could check the used port number in [My pc]-[Manage]-[Device Manager][Universal Serial Bus Controller]

Connecting PLC with PC 2. Configure communication parameters l Open Communication window: 1. Select

Connecting PLC with PC 2. Configure communication parameters l Open Communication window: 1. Select [Tools]>[Communications] menu command; 2. Double-click [Communication] node in Workplace window; 3. Right-click [Communication] node and select [Open] command menu.

Connecting PLC with PC In the Communication window, select a [Port] same port number

Connecting PLC with PC In the Communication window, select a [Port] same port number shown in [Device Manger]. And set proper parameters for Station number, Baudrate, Parity, Data Bits, Stop Bits. Communication can’t be established unless communication parameters of PC serial port are identical with CPU ports. * If users do not know the parameters in PLC: 1. Select the proper [Port], and click the [Start] button to detect communication parameters automatically; 2. Turn off power supply for CPU; Place its operation switch at STOP state; when turn the power supply on, PLC will restore to its default serial communication parameters: Station number: 1, Baudrate: 9600, Parity: None, Data Bits: 8, Stop Bits: 1.

Status Chart After download project into PLC, then users could use the Status Char

Status Chart After download project into PLC, then users could use the Status Char to monitor and force any variables used in the projects. Also users could monitor and force values for variables on the program. l Opening Status Chart: 1. Select [Project]>[Global Variable] menu command; 2. Double-click [Status Chart] node in Workplace window; 3. Right-click [Status Chart] node , and then select [Open] menu command. 4. Click the icon in the toolbar;

Program edit When programming in LD, users could use standardized graphic symbols (Contact, Coil,

Program edit When programming in LD, users could use standardized graphic symbols (Contact, Coil, Function block and so on) and arrange them into network of logic. IN LD editor, some common operations are for l Common mouse operations: Click an element, it shall be selected and focus moves on it. Double-click an element, its property dialog box shall pop up, then users could modify its property; Right-click an element, its context menu shall pop up, then users could select menu command to execute corresponding function. l Common keyboard operations: Use UP, DOWN, LEFT and RIGHT arrow keys to move the focus; Press ENTER key to select the element’s parameter area for entering; Press Del key to delete the element where the focus is located; What’s more there is a shortcut key corresponding to each menu command.

Co. De. Sys for F 1 Program Install Target File Steps to create new

Co. De. Sys for F 1 Program Install Target File Steps to create new project Downloading Parameter Setting CANopen Parameter Setting

Install Target File Step 1. Press "Install. Target" in 3 S Software package as

Install Target File Step 1. Press "Install. Target" in 3 S Software package as following figure.

Install Target File Step 2. Open the "Install. Target" window, and click Open button.

Install Target File Step 2. Open the "Install. Target" window, and click Open button. Then find the directory of the target file of F 1. Choose the file *. tnf in the directory and press [Open] as the figure on the right side.

Install Target File Step 3. After opening the *. tnf file, the window will

Install Target File Step 3. After opening the *. tnf file, the window will show as following figure.

Install Target File Step 4. Choose the file which is opened just now, then

Install Target File Step 4. Choose the file which is opened just now, then press “install” to install the target of F 1 to the right window.

Steps to create new project Step 1. Open Co. De. Sys V 2. 3

Steps to create new project Step 1. Open Co. De. Sys V 2. 3 as following figure:

Steps to create new project Co. De. Sys interface is shown as following picture:

Steps to create new project Co. De. Sys interface is shown as following picture:

Steps to create new project Step 2. Select [File]-[New], it will pop up the

Steps to create new project Step 2. Select [File]-[New], it will pop up the following window. Choose F 122 -D 1608 T PLC and press OK to create a new project.

Steps to create new project Step 3. In the following window. We can set

Steps to create new project Step 3. In the following window. We can set all the parameters by default, and press OK to finish the configuration.

Steps to create new project Step 4. Choose a language of the POU. Here

Steps to create new project Step 4. Choose a language of the POU. Here we choose “LD”, then press OK.

Downloading Parameter Setting Before download program to F 1 PLC, communication parameters should be

Downloading Parameter Setting Before download program to F 1 PLC, communication parameters should be set in advance. Step 1. In Co. Desys interface, select [Online]-[Communication Parameters] to pop up the following dialog box:

Downloading Parameter Setting Step 2. Select communication port type.

Downloading Parameter Setting Step 2. Select communication port type.

Downloading Parameter Setting Step 3. Input IP address and press [OK] to finish the

Downloading Parameter Setting Step 3. Input IP address and press [OK] to finish the setting.

Downloading Parameter Setting Step 4. Click Online->Login to download program into F 1 PLC,

Downloading Parameter Setting Step 4. Click Online->Login to download program into F 1 PLC, then click Online ->Create boot project to save program in PLC after power off.

CANopen Parameter Setting Step 1. Firstly CANopen library should be added as following figure:

CANopen Parameter Setting Step 1. Firstly CANopen library should be added as following figure:

CANopen Parameter Setting Step 2. After adding CANopen library, open the PLC Configuration in

CANopen Parameter Setting Step 2. After adding CANopen library, open the PLC Configuration in Resources.

CANopen Parameter Setting Step 3. Choose one CAN port. Set the same baudrate as

CANopen Parameter Setting Step 3. Choose one CAN port. Set the same baudrate as in CAN slave device.

CANopen Parameter Setting Step 4. Right click this CAN port, and select the CAN

CANopen Parameter Setting Step 4. Right click this CAN port, and select the CAN device(slave). Here we select JD Servo.

CANopen Parameter Setting Step 5. Select JD driver, set node id (This id like

CANopen Parameter Setting Step 5. Select JD driver, set node id (This id like a sequence number, it should be set to different value from CAN port id. )

CANopen Parameter Setting Step 6. Set [CAN parameters] as following figure:

CANopen Parameter Setting Step 6. Set [CAN parameters] as following figure:

CANopen Parameter Setting Step 7. Open PDO mapping to add the address in Receive

CANopen Parameter Setting Step 7. Open PDO mapping to add the address in Receive PDO and Send PDO, which can be used for data transmission in program.

Thank you !

Thank you !