Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kinco PLC Training Kinco Automation.

Similar presentations


Presentation on theme: "Kinco PLC Training Kinco Automation."— Presentation transcript:

1 Kinco PLC Training Kinco Automation

2 Contents Kinco PLC Profile Program-KincoBuilder Fast Start Ⅰ
Program-KincoBuilder Basic Function CoDeSys for F1 Program

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

4 Development of Kinco PLC
(Phased out) K5 F1 K2/K7 (Coming soon)

5 PLC Product Line-K5 K5 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. K504 K504EX CPU Module K506 K506EX K508 Digital I/O modules:K521,K522,K523 Remote I/O Module Analog I/O modules:K531,K532,K533

6 PLC Product Line-F1 F1 series PLCs integrate with 3S company’s software CoDeSys, which has strong functions and stable performance. CPU Module F122-D1608T Digital remote I/O modules: RP2D-1608C1,RP2D-0016C1 Remote I/O Module Analog remote I/O module: RP2A-0402C1

7 Hardware Structure-K5 Parts Name: I/O status LEDs CPU status LEDs
Programming interface (RS232) Wiring terminal 35mm DIN rail Clip M4 mounting hole Cover plate for terminal Expansion port Cover plate for expansion port

8 Hardware Structure-F1 Parts Name: Power supply terminal and LEDs
CPU status LEDs Serial port (RS232/485) I/O status LEDs I/O terminals DIP switches CAN1 port CAN2 port Ethernet port

9 Program—KincoBuilder Fast Start
KincoBuilder Interface Project Organization Structure Tasks Execution in CPU Steps to create new project

10 KincoBuilder Interface

11 Project Organization Structure
Program Initial Data (Optional) CPU process the initial data upon power on then starts scan cycle. Main Program CPU executes main program once per scan cycle. Only 1 main program in a project. Interrupt routines (Optional) For process specific interrupt events. CPU executes interrupt routines upon occurrence of interrupt event. At most 16 interrupt routines are allowable in a project. Subroutines (Optional) Invoked by main program or interrupt routines. At 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.

12 Tasks Execution in CPU 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 proper operation 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.

13 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

14 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: project name: “Example”; Hardware: a Kinco-K506-24AT CPU module; Control logic” Toggle Q0.0---Q0.7 in turn and cyclically. 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.

15 Steps to create new project
Step 1. Launch KincoBuilder; Step 2. If necessary, user could modify default setting in KincoBuilder [Configuring General Software Options]. Step 3. Create a new project by one of the following ways: Select [Title]>[New project] menu command; 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”.

16 Steps to create new project
Step 4. Modify hardware configuration in [Configuring Hardware]. In this example, we configure Kinco-K506-24AT 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, KincoBuiler will automatically create an empty main program named “MAIN” at the same time.

17 Steps to create new project
Add new Subroutine by one of the following ways: Click the icon on the toolbar; 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.

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

19 Steps to create new project
Step 7. Compile project. When compiling a project, KincoBuilder will save it automatically at first to ensure it is the latest. Execute compilation by the following ways: Select [PLC]>Compile All] menu command; Click the icon on the toolbar; Use shortcut key F7. 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:

20 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: Select [PLC]>[Download] menu command; Click on the icon on the toolbar; Use shortcut key F8.

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

22 Configuring General Software Options
Program—KincoBuilder 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

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

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

25 Data Type-Constant

26 Data Type-Variables Variables
Variable must have a name and an address in the CPU. Kinco K5 series PLCs provide two methods to access the memory units: 1.Direct addressing 2. Indirect addressing, i.e. pointer Direct 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. Indirect addressing Pointer “&” address operator; “*” pointer operator.

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

28 Data Type-Variables

29 Memory Address

30 Memory Address

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

32 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. Opening Hardware window: Double-click the [Hardware] note in Workplace window; Right-click [Hardware] node , and then select [Open] command on the pop-up menu. The Hardware Window is composed of two parts: 1. Configuration Table (Upper part) 2. Parameter Window (Lower part)

33 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.

34 Configuring Hardware 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.

35 Configuring Hardware 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 I/O Configuration Communication Ports Retentive Ranges Others Parameter configuration of Expansion Module DI DO AI AO

36 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.

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

38 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.

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

40 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.

41 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.

42 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. Opening Initial Data Table: Double-click [Initial Data] node in Workplace window; Right-click [Initial Data] node , and then select [Open] command on the pop-up menu.

43 Global Variable Table 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: Select [Project]>[Global Variable] menu command; Double-click [Global Variable] node in Workplace window; Right-click [Global Variable] node , and then select [Open] command on the pop-up menu.

44 Cross Reference Table 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. Opening Cross Reference Table: Select [Project]>[Cross Reference]menu command; Click the icon in the toolbar; Use the Alt+C shortcut key.

45 Instruction Set Kinco-K5 PLCs instruction set accords with IEC 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:

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

47 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.

48 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.

49 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. .

50 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.

51 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.

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

53 Connecting PLC with PC K5 series PLC Port0 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]

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

55 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: Select the proper [Port], and click the [Start] button to detect communication parameters automatically; 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.

56 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. Opening Status Chart: Select [Project]>[Global Variable] menu command; Double-click [Status Chart] node in Workplace window; Right-click [Status Chart] node , and then select [Open] menu command. Click the icon in the toolbar;

57 Program edit When programming in LD, users could use standardized graphic symbols (Contact, Coil, Function, Function block and so on) and arrange them into network of logic. IN LD editor, some common operations are for 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. 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.

58 CoDeSys for F1 Program Install Target File Steps to create new project
Downloading Parameter Setting CANopen Parameter Setting

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

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

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

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

63 Steps to create new project
Step 1. Open CoDeSys V2.3 as following figure:

64 Steps to create new project
CoDeSys interface is shown as following picture:

65 Steps to create new project
Step 2. Select [File]-[New], it will pop up the following window. Choose F122-D1608T PLC and press OK to create a new project.

66 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.

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

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

69 Downloading Parameter Setting
Step 2. Select communication port type.

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

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

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

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

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

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

76 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.)

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

78 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.

79 Thank you !


Download ppt "Kinco PLC Training Kinco Automation."

Similar presentations


Ads by Google