CX programmer is a new programming software of Omron Company, which is suitable for C, CV and CS 1 series PLC. It can complete the establishment, editing, checking, debugging and monitoring of user programs, and also has a perfect maintenance function, which makes the development of programs and the maintenance of the system simpler and faster.
First, install CX-P programming software.
1, system requirements
The computer system requirements for running CX-P programming software are shown in Table B- 1.
Table B- 1 system requirements
A CPUPentium or above microprocessor with a main frequency of 90 MHz or above.
Memory 16MB or more
Hard disk above 40MB
Operating systems above Windows 95 or Windows NT 4.0 Service Pack 3.
Computer IBMPC and compatible computers
2. Software installation
Put the CX-P installation CD into the CD, double-click the installation program Setup in the CX-P subdirectory to start the installation process, and follow the on-screen prompts in turn. When installing, you must first choose the installation language; Then enter the license number, and you can use all the functions of CX-P without entering the license number, but you get a "partial function" version of CX-P, which can also work normally, but only supports CPM 1, CPM2* and SRM1PLC; ; Finally, when choosing whether to install CX server, you should choose "Yes".
Second, the main functions of CX-P programming software
CX-P programming software can realize ladder diagram or statement table programming, program compilation and verification, program and data uploading and downloading, PLC setting area setting, PLC running status or memory data monitoring and testing, program list printing, document management and other functions.
Figure B- 1 CX-P programming software interface
The appearance of CX-P programming software interface is shown in Figure B- 1. The programming interface includes a title bar, a menu bar, a toolbar, a status bar and five windows (the display window can be selected through the "Window" item in the "View" menu), and the functions of each part will be briefly introduced below.
1, menu bar
1) File menu can be used to create, open, close, save files, set file pages, print preview and print settings.
2) The Edit menu provides various tools for editing programs, such as the operations of selecting, cutting, copying and pasting program blocks or data blocks, and the functions of finding, replacing, inserting, deleting and distinguishing.
3) View menu can set the development environment of programming software, such as selecting ladder diagram or mnemonic programming window, and opening or closing other windows (such as engineering window, viewing window and output window). ), display global symbol table or local symbol table, etc.
4) Insert menu can be used to insert lines, columns, instructions or contacts, coils and other functions in ladder diagram or mnemonic program.
5)PLC menu is used to realize some operations when connecting with PLC, such as setting online or offline working modes of PLC and four working modes of programming, debugging, monitoring and running; All programs are compiled online; Upload or download programs; Check information of PLC, etc.
6) Programming ladder diagram and mnemonic program by program menu.
7) Tools menu is used to set the models of PLC and network configuration tools, create shortcut keys and change the display content of ladder diagram.
8) The window menu is used to set the emission mode of the window.
9) Help menu items can easily retrieve all kinds of help information, and you can press the F 1 key to display online help at any time during software operation.
2. Toolbar
The toolbar displays the most commonly used operations in CX-P programming software in the form of buttons, providing faster mouse operation. You can use the toolbar options in the View menu to show or hide various buttons.
3, engineering window
In the project window, the detailed information of PLC and program related to the project is displayed in a hierarchical tree structure. A project can generate multiple PLCs, each PLC contains a global symbol table, settings, memory, programs, etc., and each program contains a local symbol table and program segments. The engineering window can quickly edit symbols, set PLC and switch the display of each program segment.
4, chart work window
The chart work window is used to edit ladder chart program or statement table program, and can display global variables or local variables.
5. Output window
The output window can display the results of program compilation (such as whether there is an error, the content and location of the error) and the results of program transmission.
6. View the window
In the viewing window, the contents of relays with address numbers in multiple PLCs and their online working status can be displayed simultaneously.
7. Address Reference Tool Window
The address reference tool window is used to display the location and purpose of relays with the same address number in PLC programs.
8. Status bar
When programming, the status bar will provide some useful information, such as instant help, PLC online or offline status, PLC working mode, connected PLC and CPU type, cycle time and error information when PLC is connected.
Third, the use of CX-P programming software
Programming user programs with CX-P programming software can be carried out according to the following steps: starting CX-P software, creating new engineering files, drawing ladder diagrams, compiling programs, downloading programs, and monitoring program operation.
1. Start CX-P programming software.
Find the Omron /CX- Programmer /CX- Programmer option in the start menu and start the CX-P programming software. The startup screen of CX programmer is shown in B-2.
Figure B-2 CX-P programming software startup interface
2, the establishment of new engineering documents
After starting CX-P, click the "New" command on the file menu, or click the "New" button on the toolbar to create a new project. At this point, the dialog box as shown in Figure B-3 appears on the screen to set the PLC.
Figure B-3 "Change PLC" window
1) Type the name of the new project in the Equipment Name field.
2) Select the serial number of PLC in the "Equipment Model" column, and then click the "Set" button on the right to set the PLC model and program capacity.
3) Select the network type of PLC in the "Network Type" column, and generally use the system default value.
4) Enter comments related to this PLC in the "Comments" column.
After completing the above settings, click the "OK" button at the bottom of the "Change PLC" dialog box, and the CX-P programming software operation interface as shown in Figure B-4 will be displayed, which is in the offline programming state of the new project.
Figure B-4 CX-P Operation Interface after Creating a New File
In the project window shown in Figure B-5, if you want to operate a project, you can right-click the project icon and select the required command from the menu that appears; Or click the option in the menu bar after selecting this item and select the corresponding command; You can also use the shortcut buttons in the toolbar. The following will introduce each item in the project window and its operation.
Figure B-5 Engineering Window
(1) Project In the Project project, you can rename the project, create a new PLC and paste the PLC into the project. CX-P software also provides the joint control function of multiple PLCs.
(2) In the "PLC" project, PLC can realize the functions of modifying PLC, changing PLC operation mode, setting PLC to work online, automatically assigning symbols, compiling all PLC programs, uploading or downloading PLC programs, etc.
(3) In the global symbol table and local symbol table PLC, symbols are identifiers of addresses and data, symbols that can be used in each program are called global symbols, and symbols that can only be used in one program are called local symbols.
The symbol table can be used to edit the names, data types, addresses and comments of symbols. After using the symbol table, once the address of the symbol changes, the program will automatically enable the new address, which simplifies the programming operation. There is a global symbol table under each PLC and a local symbol table under each program. Each symbol name must be unique in its own table, but the same symbol name is allowed in the global symbol table and the local symbol table, and the local symbol is superior to the global symbol.
Double-click the "Symbol Table" icon under PLC in the project to display the global symbol table as shown in Figure B-6. Some predefined symbols related to PLC models will be automatically filled in, and the symbols prefixed with "P-" cannot be modified by users.
Figure B-6 Global Symbol Table
Double-click the symbol table icon under any program in the project to display the local symbol table as shown in Figure B-7.
Figure B-7 Local Symbol Table
(4) Double-click the "Settings" icon under PLC in the project to open the PLC Settings dialog box as shown in Figure B-8, where you can set the system parameters of PLC. For general applications, just use the default values. After setting, you can use the command in the "Options" menu of this window to transfer the settings to PLC, and of course, you can also read the original settings from PLC.
Figure B-8 "PLC Settings" window
(5) Memory Double-click the "Memory" icon under PLC in the project, and the PLC memory dialog box as shown in Figure B-9 will appear. The left window lists the relay area of PLC. If you double-click the "IR" icon, the right window will display the working status of each word in the IR relay area of PLC. This window can edit, monitor, upload and download the memory data of PLC.
Figure B-9 "PLC Memory" window
Click the "Address" tab at the lower left of the PLC memory window, and a window will appear, which contains two commands of "Monitoring" and "Mandatory Status", which can monitor and enforce the address online, and scan and process the information in the mandatory status of the address.
(6) The program can be opened, inserted, compiled and renamed. In the program project. If you double-click the "Program" icon, you can also display the names, start steps, end steps, comments and other information of each paragraph in the program. If there are multiple "new programs" in a project, PLC will scan and execute these programs in the set order. Of course, the execution order of each "new program" can also be changed by commands in "Program Properties".
(7) Program Segments A new program can be divided into multiple program segments, which can be edited, defined and identified separately.
When PLC is online, the project window will also display icons such as "Error Log" of PLC.
Step 3 draw a ladder diagram
Taking the program of "Motor Timing Control" as an example, the process of compiling ladder diagram with CX-P software is briefly explained. The timing control of the motor requires the motor to start running for 2 minutes and then stop automatically.
1) Use the mouse to select the normally open contact button in the toolbar, and then click the starting position of the first command line in the ladder diagram editing window as shown in figure B-4, and the new contact dialog box as shown in figure B- 10 will pop up. Enter everything in the chart, and then press the OK button.
Figure B- 10 "Input normally open contacts" window
2) Figure B- 1 1 shows that the first contact has been input to the starting position of the first line. Above the contact is the name and address of the frequently opened contact, and below is the comment. The red mark to the left of the contact indicates that the command bar where the contact is located has logical errors or is incomplete.
Figure B- 1 1 shows the normally open contacts.
If you want to change the display mode of contacts, you can use the Options command on the Tools menu.
Figure B- 12 option window (ladder diagram information)
3) If you want to connect a normally closed contact in series to the right of the first contact, you can first select the "normally closed contact" button in the toolbar with the mouse, then click the right position of the first contact and enter the corresponding content in the pop-up dialog box to complete the input of the second contact.
4) To input a coil at the end of the first line, use the mouse to select the "New Coil" button in the toolbar, and then complete the coil input according to the above method. When the cursor leaves the coil, the software will automatically adjust the coil to the position close to the right bus, as shown in Figure B- 13. After the coil input is completed, the red mark on the left side of the first contact will disappear automatically.
Figure B- 13 Adding output coil
If you want to change the display position of the right bus in the ladder diagram, you can do so by clicking the option in the Tools menu. The option window is as shown in Figure B- 14, just change the value of "initial position (cell)" in the figure.
Figure B- 14 option window (ladder diagram)
5) To connect a normally open contact in parallel below the first contact, use the mouse to select the "New Vertical Line" button in the toolbar, and then click on the right side of the first contact to add a vertical line. At this time, the software will automatically insert a blank line under the first contact, as shown in figure B- 15. Then according to the first step, add a normally open contact under the first contact.
Figure B- 15 Add vertical lines
6) If you want to enter the normally open contact 0 1000 at the beginning of the second line of the ladder diagram, you can use the copy and paste command to complete it. When inputting the timer coil, you can click the "Command Box" button in the toolbar with the mouse, and click the blank space on the right of the second line, and a dialog box as shown in Figure B- 16 will appear. After entering the timer command and operand in this window, press the "OK" button, and the display content is as shown in Figure B- 17.
Figure B- 16 "input timer instruction" window
Figure B- 17 shows the timer instruction.
Double-click the left of the timer setting in the above figure with the mouse, and a dialog box as shown in figure B- 18 will appear. Enter the timer constant # 1200 in the second line of the operation sequence, and then press OK to complete the timer input.
Figure B- 18 "input timer settings" window
7) If you want to insert a normally closed contact of a timer in front of the output coil 0 1000, you can follow the method in the third step.
8) input program end instruction "end". Select the "Command Box" button in the toolbar with the mouse, click the beginning of the third line in the ladder diagram, enter "End" in the "Command" column of the pop-up window, and press "OK" to display the contents as shown in Figure B- 19. At this point, all the programs have been input.
Figure B- 19 Add End Instruction
After editing the ladder diagram program, you can double-click the "Symbol" item under "New Program" in the engineering window to display the local symbol table and see the usage of each symbol in this program segment. Use the mnemonic command in the view menu to switch the display window of ladder diagram and mnemonic, and display the mnemonic program, as shown in Figure B-20.
Figure B-20 mnemonic program
4. Check and compile the program
You can check the grammar, data, etc. in the program editing process through the "Program Checking Options" command in the "PLC" menu. When an error occurs, a red mark will appear in front of the left bus of the corresponding command bar, and an error message will be displayed in the output window.
After the program is edited, click the compile program button in the toolbar or select the compile command in the program menu to compile the program and check the correctness of the program. The compilation results will be displayed in the output window. When the Error level is high, the program may not run, but when the Warning level is low, the program can still run.
Step 5 download the program
After the program is compiled, you can transfer the program to PLC according to the following three steps.
1) Connect the PLC to the computer with a special cable, and set the PLC interface to offline.
2) Select the "Work Online" command in the "PLC" menu, or click the "Work Online" button on the toolbar. In the confirmation dialog box that appears, select Yes to establish communication between PLC and computer. At this time, the communication light on the CPU panel flashes continuously, and the background of the ladder diagram editing window changes from white to gray, indicating that the system has entered the online state normally.
3) Start downloading the program. Select the "Transfer" command in the "PLC" menu, and click "To PLC" in the pop-up drop-down menu to open the download options dialog box. Select "Program" in the options and confirm to download the program. You can also click the "Send to PLC" button in the toolbar to download the program.
6, program debugging and monitoring
(1) program monitoring: firstly, select the "run" or "monitor" command under "run mode" in the "PLC" menu, and the PLC will start running the program; Then select the "Monitor" command in the "PLC" menu to make the program enter the monitoring state. The above operations can also be achieved by using shortcut buttons in the toolbar. After entering the monitoring state of the program, the luminous element in the ladder diagram window indicates that it is on, otherwise it is off.
Through the View window, you can also monitor the running of the program. Add the address to be observed to the viewing window, and use the component value information to understand the working condition of the component, as shown in figure B-2 1.
Figure B-2 1 View window
(2) Suspending program monitoring Suspending monitoring can freeze the monitoring of the program at a certain moment, which is of great help to the debugging of the program. The function of triggering pause monitoring can be realized by manual triggering or trigger triggering, and the steps are as follows.
1) In monitoring mode, select the steps that need to be paused.
2) Click the "Trigger Pause" button in the toolbar, and select the trigger type in the pop-up dialog box: manual or trigger.
If Trigger is selected, enter the trigger signal address in the Address and Name columns and select the condition type. When the trigger condition is met, "Pause Monitoring" will appear in the area just selected. To resume full monitoring, click the Trigger Pause button again.
If manual is selected, after the monitoring starts, when the required content appears on the screen, click the "Pause" button in the toolbar to suspend the monitoring function. To resume full monitoring, click the Pause button again.
(3) Forced operation Forced operation refers to the forced assignment of components in the ladder diagram to simulate the real control process and verify the correctness of the program. First select the component to be operated, and then click the Force command in the PLC menu. At this point, a mandatory flag will appear, indicating that the component will be forced to operate. Mandatory operations of components can be released in the same way.
(4) After downloading the online editing program, the program is grayed out and cannot be modified directly, but the online editing function can be used to modify the program to improve the programming efficiency.
Select the object to edit first, then click "Edit Online" in the program menu and select "Start" in the pop-up submenu. At this point, the background of the step where the edited object is located will change from gray to white, indicating that it can be edited. After editing, the modified content is transmitted to PLC by using the "Send Modification" command in "Online Editing" in the program menu. After the transfer, the background of the step will turn gray and read-only.