ControlStar Programming Software User Manual
ControlStar Programming Software User Manual
Version V1.2
Revision date September 5, 2006
BOM 31011326
Emerson Network Power provides customers with technical support. Users may contact the nearest
Emerson local sales office or service center.
Foreword
This manual describes the operation method and interfaces of V2.3 ControlStar programming software in details. It
also introduces the method of using each function with application examples.
Content
Chapter 1 Overview.......................................................................................................................................................... 7
Chapter 1 Overview
Programming in LD
The LD is a chart programming language that appears similar to the electrical schematic diagram, and it is also very
similar to the latter in logic. In LD, each kind of soft element is presented as contacts or coils. The electrical
connection relationship between each contact and coil represents the control logic relationship between them. Figure
1-1 gives an example of the LD.
8 Appendix 2 List Of Instructions
In the above LD, firstly, the value of X0 input point will be loaded as the current value, then the value of X1 input point
will be loaded, and logical OR operation will be performed to the X1 value and the current value, and the result will be
used as the current value. Then, X2 value will be loaded and AND operation will be performed to the X2 value and
the current value, the operation result will determine whether the energy flow of the output point Y0 is ON or not.
Programming in SFC
SFC is a language that divides the control process into several steps, and performs transfer between steps according
to the procedures or work flow of the mechanical equipment. A standard SFC consists of the initial step, common step,
transfer conditions, jumping and resetting. Every step is a procedure of the mechanical equipment. Every step may
have an internal Ladder Diagram that is the procedure to be finished in this step. The transfer condition is the
condition for completing one procedure and starting the next. It needs the internal LD to express the transfer
condition. Figure 1-2 is an example of SFC programming.
As shown in the above SFC, the initial status is S0. if the transfer conditions of S0 to S20 is not satisfied, S0 will be
executed all along. Once the transfer conditions are satisfied, S0 will stop and S20 will start. The transfer will go on
like that until, at last, the jumping condition from S21 to S0 is satisfied, and the cycle will restart. Through the jumping,
the whole cycle will go on and on.
This chapter firstly describes how to install and uninstall the ControlStar software, then an example is used to show
you how to start the software, compile a program, download it onto the PLC and run it..
Installing ControlStar
The ControlStar installation package is an independent executable program. Double click it and the installation startup
screen as shown in Figure 2-1 will pop out.
After the installation, the ControlStar program group will appear in the Start menu, and the ControlStar shortcut icon
will appear on the desktop.
Uninstalling ControlStar
By selecting the Uninstall ControlStar in the ControlStar program group, or using the Add/Delete Program function
in the Control Panel, you can uninstall this software.
To re-install and upgrade the ControlStar, you must uninstall the old software first. In order to avoid the confusion
caused by software upgrade, the software will automatically delete the relevant data in the register table during the
installing and uninstalling process. You need to reconfigure the previously configured menu, toolbar and system
options after re-installing or upgrading.
10 Appendix 2 List Of Instructions
After installing ControlStar, click ControlStar icon in the Start menu to start the software. The main interface of the
programming software is shown in Figure 2-2.
After starting the programming software, create a project for the program to be compiled at first. Click File -> New
Project to pop up the following dialog box:
In this example, select EC20 as the PLC type. The default editor is the Ladder Diagram (LD). Click the OK button in
the dialog box, and a new project is created. After creating the project, the system will open the main program window
of the project and enter the program editing status automatically, as shown in Figure 2-4.
Appendix 2 List Of Instructions 11
2. After compiling the program, click File-> Save Project in the menu bar to save the project.
3. After saving the project, you need to confirm that the program is fault-free, and compile the program into a target
file that can be downloaded onto the PLC. In the menu bar, click PLC -> Compile All, and the software will compile
all the current programs and display the results in the output window, as shown as Figure 2-6.
Before downloading the program onto the PLC, you need to establish the serial port communication connection.
Refer to the 6.1.8 Communication Port for details.
Click PLC -> Download in the menu bar. When downloading the program, the PLC should be in stop status;
otherwise, the software will prompt the following:
Click the OK button to stop the PLC, and the software will prompt the following:
If you have compiled the program according to the step 3 in section 2.2.3, and if the program has not been modified
ever since, click No. If you have modified the program after the compiling, click Yes, and the modified program will be
re-compiled. After the compiling, the following download window will appear:
According to the actual situation, select the contents to be downloaded in the Download option. In this example, you
only need to download the Program Block. Select Program Block and click the Download button to start the
download. The download progress bar will be displayed, and the software will give download success prompt after
the download is completed.
After downloading the program, you need to start up the PLC. In the menu bar, click PLC -> Start in the menu bar, or
set the DIP switch that controls the PLC ON/OFF to the RUN position to start the PLC. After the PLC runs normally,
turn on the switch connected to input terminal X0, then you can see the three lamps that respectively connect to the
terminals Y0, Y1 and Y2 turn on alternatively.
Appendix 2 List Of Instructions 13
Menu
The menu contains a group of submenus covering all the instructions. When the cursor stays at a menu item, a short
description of the menu function will appear in the status bar. The PLC submenu provides relevant functions for
operating PLC hardware. The Tool submenu provides Wizard function that can help you set the ControlStar
properties and complex instructions.
ControlStar will display different menus with the different windows opened. The submenu structure also differs
according to the function being used.
Toolbar
The software provides several Toolbars, including some instruction buttons for some frequently used operations,
which can also be performed through menu items or predefined shortcut keys.
The toolbar is located below the menu bar. By default, all the toolbars are visible. To hide or display any toolbar, right
click the toolbar and click Select- > Cancel in the popped up shortcut menu.
Place the cursor on any icon (do not click) for a while, a short description, or tool prompt, will appear. These tool
prompts include the current icon names. If the tool prompt does not appear, you can enable it in the Option dialog
box.
Standard The basic and most frequently used functions in
toolbar PLC programming
The two most frequently used compiling
Compile
functions: Compile the program in current
toolbar
window/Compile all the programs
The most frequently used functions in LD
LD toolbar
program editing
14 Appendix 2 List Of Instructions
Shortcut Key
The definition of shortcut key is given in Table 3-1.
Table 3-1 Shortcut key Definition
Type Shortcut Key Function Type Shortcut Key Function
CTRL + N New project CTRL + 6 Comparison contact
CTRL + O Open project CTRL + 7 Coil
CTRL + A Select all CTRL + 8 Application instruction
CTRL + C Copy CTRL + 9 Call sub-program
LD editing
CTRL + X Cut CTRL + B Insert block comments
shortcut
CTRL + V Paste CTRL + ↓ Vertical line
keys
CTRL + F Find CTRL+SHIFT+↓ Delete vertical line
CTRL + H Replace CTRL + → Horizontal line
CTRL + G Go To CTRL + I Insert a row
CTRL + Z Undo CTRL + L Delete a row
General
CTRL + Y Recover CTRL + 1 Ladder Diagram block
shortcut
keys
CTRL + S Save CTRL + 2 Initial step sign
CTRL + P Print CTRL + 3 Common step sign
Delete Delete the selected contents CTRL + 4 Shift sign
F1 Open Help Window CTRL + 5 Jump sign
F5 PLC Run CTRL + 6 Reset sign
F6 PLC Stop SFC editing CTRL + 7 Select branch
F7 Compile all documents shortcut CTRL + 8 Select merging
keys
CTRL + F7 Compile current document CTRL + 9 Parallel column branch
F8 Download CTRL + 0 Merge columns
F9 Monitor O Open internal Ladder Diagram
Ladder CTRL + 1 Normally open contacts CTRL + ↓ Vertical line
Diagram CTRL + 2 Normally closed contacts CTRL + → Horizontal line
editing CTRL + 3 Contacts of rising edge CTRL + I Insert a row
shortcut CTRL + 4 Contacts of falling edge CTRL + L Delete a row
keys CTRL + 5 Step point
In order to differentiate the main program, subprogram and interrupt subprogram, each type of program node
corresponds to an icon of certain color in the project tree. The main program is green, the subprogram blue, and the
interrupt subprogram yellow.
The following functions can be realized through project tree:
1. Right click the project name node, you can select Save, Save as, Close or Modify Project Property in the
popped up menu.
2. Right click the program block node, you can select Insert Subprogram or Interrupt Subprogram in the popped up
menu.
3. Right click a program node in a program block, you can select Open Program, Delete Program (main program
cannot be deleted) or Modify Program Property in the popped up menu.
4. Right click other nodes, you can only perform “Open” operations in the popped up menu.
The contents of instruction tree change with the change of the editor in the current operation window. If the current
operation window is the Ladder Diagram editor, the instruction tree will display all the instructions supported by
Ladder Diagram language. In the same way, if the current operation window is the Instruction List editor or SFC editor,
the instruction tree also displays all the instructions supported by Instruction List language or SFC language. So,
during the programming process, you can find an instruction that matches a function through the instruction tree. The
instruction tree can not only be used in finding an instruction, but also used for inputting the instructions.
To input an instruction through the instruction tree, just select the target instruction, double- click it or drag it to the
program editing window. During the dragging process, the cursor shape may change. When the cursor shape
changes into an arrow, that means you can enter the instruction in this location. If the current editor is the Ladder
Diagram editor, the wizard for entering the instruction will start automatically, see Wizard Enter Mode in section 4.2.3
Inputting Ladder Diagram Elements for details. If the current editor is the Instruction List or SFC, the editor will directly
insert the instruction or the corresponding element of the instruction.
Status bar
The status bar provides the frequently used property information, as shown in Figure 3-5.
Operation Area
The operation area includes the program editing window, global variable editing window, element status monitoring
window, datablock window and cross reference table window.
Program name: Project ID, and also the file name for storing the project;
Location: The full path for storing project file. The specified path plus the project name sub-directory (created
automatically) is the final directory for storing the project file;
PLC Type: The PLC type for the project. Different PLC type or version has different influence on the CPU instruction
group and the program capacity supported by the system configuration. The program capacity will influence the
compiling and download process. The Capacity will be checked during program compiling. If the number of program
steps exceeds the set value, the software will generate warning, and prompt error during the download.
Default editor: Three editors available: Ladder Diagram, Instruction List and SFC.
Project description: Simple project description. The project description can be null, and the maximum length is 128
characters.
When downloading a program to the PLC, the software will compare the set PLC type with the actual situation. The
program cannot be downloaded if the types do not match.
To change the PLC type of a project, select File -> Change PLC Type, or select the root node in the project tree and
right click to select Property. In the popped up project property dialog box, all the properties except the Program
name and Location can be changed. Changing the PLC type may fail the program in the compiling due to
incompatibility of instructions or the system block configurations. In that case, change the setting manually according
to the information in the Output Window.
Appendix 2 List Of Instructions 17
You can set the Default PLC and Default editor of the project to be created by selecting Tool -> Options…. See
Figure 3-7.
Each project generally has four files, namely CompMonTbl.CMT, CrossRefTbl.CRS, SysCfgInfo.SSC and
DatBlock.DB. These four files store the status monitoring table, cross reference table, system configuration table and
datablock information respectively, and they are all stored under the directory of DATA.
The program unit, including the main program, subprogram and interrupt subprogram, is stored under the directory of
Pous. Different editors generate different program units, to be specific, Instruction List, Ladder Diagram and SFC
generates *.IL, *.LD and *.SFC files respectively.
The information of global variable table is also stored under this directory. The file name of the global variable table is
GlobalVarTbl.GVT.
ControlStar uses the project manager shown in Figure 3-8 to manage a project.
Do not directly delete or modify the preceding files from Windows, otherwise the project cannot be opened or the
program data will be damaged.
The software provides three program units including the main program, subprogram and interrupt subprogram.
Main program: By default, the software provides only one main program. The main program is the program started
and executed by PLC applications. The main program can be edited with all the three languages: Ladder Diagram,
SFC and Instruction List.
Subprogram: One project can have several subprograms, maximally 64. The subprogram is called by the main
program or other subprograms, used to fulfill those frequently or repeatedly used functions. The subprogram can only
be edited with Ladder Diagram or Instruction List.
18 Appendix 2 List Of Instructions
Interrupt subprogram: A project can have multiple interrupt subprograms. They are associated with certain interrupt
events and are called when the interrupt event happens. The number of interrupt subprograms cannot exceed 40.
The interrupt subprogram can only be written with Ladder Diagram or Instruction List.
The purpose of using subprogram is to divide the program into sections or blocks. Some frequently used functions
can be called repeatedly after they are written into subprograms. The small subprogram blocks are called only when
necessary, so that the PLC can run more efficiently because it does not scan all the program blocks in every cycle..
When the main program calls and executes a subprogram, the subprogram will be executed thoroughly before the
system returns the control authority to the main program.
Right click the program block in the Project Manager window, select Insert Subprogram or Insert Interrupt
Subprogram, as shown in Figure 3-9. The default name of subprogram is SBR_*, and the default name of interrupt
subprogram is INT_* (where the “*” is a number calculated by the software automatically). Afterwards, you can
change the default program name through the subprogram property dialog box.
Inserting a new program node into the project tree will open the program. You can edit the program immediately.
The software provides the subprogram import/export function, which enables you to edit a general-purpose function
in a subprogram and use it in different projects instead of editing it repeatedly. ControlStar uses a program database
file to manage subprograms. First, the general-purpose subprogram is exported to a certain directory to form a
program database file that can be used repeatedly. Then you can import the file as a standard subprogram to any
project that needs it.
Select File -> Program File Export to open the program export dialog box as shown in Figure 3-10.
The software can automatically list all the exportable programs in the dialog box. The program will be exported by
default to the \Lib folder in the installation path. You can click the … button to change the path, and the changed path
will be the next default import/export path.
You can edit the Export program name and the Program description in the preceding dialogue box. To export a
program, select the program to be exported by checking the program, and then click the Export Program button. The
“√” will disappear automatically after the program is exported correctly, otherwise it will stay.
Appendix 2 List Of Instructions 19
Select File -> Import Program File to open the program import dialog box as shown in Figure 3-11.
The importable program information in the default Import/Export path is automatically listed in the dialog box. You can
click the … button to change the path. Before the import, you can edit the name of the program to be imported to the
project. If the imported program name is illegal, the software will prompt with a red underline in the list. If the specified
program name has been used in the project, the software will ask you to decide whether or not to overwrite the
existing program. After selecting the program, click the Import Program button to import the program to the project.
Double click the node of certain subprogram in the project tree to open the program. The program editing area has
two parts, the upper part is the variable table, and the lower part is the program editing window. You can use the
subprogram local variable table to define parameters for the subprogram when necessary. The maximum number of
input/output parameters each subprogram can use is 16.
Define the parameters (if any) in the subprogram local variable table. The parameter must have a name, a variable
type and a data type.
The parameter type is defined in the Variable Type field in the variable table, including Input parameter (IN), input
and output parameters (IN_OUT) and output parameters (OUT) and TEMP.
IN: When a subprogram is called, if the input parameter is an element, the value in the element will be uploaded to
the corresponding variable in the subprogram local variable table. If the parameter is a data constant (such as
16#1234), the constant will be input to the subprogram.
IN_OUT: When a subprogram is called, the specified parameter value will be input into the corresponding
subprogram local variable. The result value from the subprogram will be returned through the same local variable to
the element that is used as the input parameter.
OUT: The result value from the subprogram will be returned to the specified parameter location.
TEMP: Local memory not used for storing parameters. In every cycle, when a subprogram is called, the TEMP type
variable will be re-initialized, and the result calculated last time would not be saved.
When it is necessary to increase the number of parameters, right click and select Insert Row to insert a new row,
with variable type the same as the current row.
Select the subprogram node to be modified in the project tree. Right click and select Property to open the file
property dialog box. You can modify the subprogram name, author and program descriptions in the dialog box, as
shown in Figure 3-12.
20 Appendix 2 List Of Instructions
For an interrupt subprogram, you can specify an interrupt number for it (the default new interrupt number is 1). The
interrupt subprogram property dialog box is shown in Figure 3-13.
Click the … button to pop up interrupt allocation dialog box, which shows all the available idle interrupts and the
interrupts that has been used by other interrupts. You can select an idle interrupt, and specify its number to the
current interrupt subprogram, as shown in Figure 3-14.
Some interrupt events in the system conflict with each other. For example, the system cannot respond to both X0
rising edge and X0 trailing edge at the same time. Therefore, if the X0 rising edge interrupt has been allocated, the
X0 trailing edge interrupt cannot be used. In this situation, the X0 trailing edge interrupt will be masked. The interrupt
events that conflict with each other are as follows:
X0 input rising edge interrupt (interrupt number: 0)<——> X0 input trailing edge interrupt (interrupt number: 10)
X1 input rising edge interrupt (interrupt number: 1)<——> X1 input trailing edge interrupt (interrupt number: 11)
X2 input rising edge interrupt (interrupt number: 2)<——> X2 input trailing edge interrupt (interrupt number: 12)
X3 input rising edge interrupt (interrupt number: 3)<——> X3 input trailing edge interrupt (interrupt number: 13)
X4 input rising edge interrupt (interrupt number: 4)<——> X4 input trailing edge interrupt (interrupt number: 14)
X5 input rising edge interrupt (interrupt number: 5)<——> X5 input trailing edge interrupt (interrupt number: 15)
X6 input rising edge interrupt (interrupt number: 6)<——> X6 input trailing edge interrupt (interrupt number: 16)
Appendix 2 List Of Instructions 21
X7 input rising edge interrupt (interrupt number: 7)<——> X7 input trailing edge interrupt (interrupt number: 17)
Rules for using subprogram are as follows:
1. Embedding one subprogram in another is allowed. (One subprogram can be called by another). The maximum
embedding depth is 6. However, you cannot call a subprogram from an interrupt subprogram.
2. The obvious cyclic calling is prohibited between subprograms. For example, it is unallowable for subprograms A
and B to call each other.
3. Subprogram recursive calling is prohibited, for example, program A calls program B, program B calls program C
and program C calls program A, and this kind of calling forms a loop. In addition, a subprogram cannot call itself.
Decryption
Before viewing and editing an encrypted program, you need to decrypt it.
Method for decrypting a subprogram: Select the subprogram node in the project tree, right click and select
Encrypt/Decrypt to pop up the decryption dialog box as shown Figure 3-16, and then enter the correct password to
decrypt.
The encryption and decryption functions need the support of PLC hardware. If the PLC type does not support the
function, the software will prompt that during the encryption and decryption.
ControlStar system provides three program editors, namely Ladder Diagram, Instruction List, and SFC. In order to
define and use the global variables and local variables, ControlStar also provides the global variable table and local
variable table editor. In addition, the system provides a cross-reference table for recording the element usage in each
program.
To facilitate programming, ControlStar also provides some general editing functions.
Find
Select Edit -> Find or press the CTRL+F keys to pop up the Find/Replace/Goto dialog box as shown in Figure 4-1.
Then you can perform the “Find” operation in the present editor. The specified character string, including the element
address and variable sign can be found by using the “Find” function. The precondition is that the specified character
string must be displayed in this editor. For the Ladder Diagram editor, the “Find” function is not applicable to the
words in the block comments.
The “Find” function supports the functions of Match whole word, Case sensitive and Direction. No matter whether you
select Upward or Downward, the software will search from another end after it finishes searching at one end.
For the Instruction List editor and SFC editor and each table, the background of the found target will be displayed in a
deep color. For the Ladder Diagram editor, the found target will be marked with a frame of broken lines.
Replace
Select Edit -> Replace or press the CTRL+H keys to pop up the Find/Replace/Goto dialog box and then perform the
Replace operation in the current editor.
When executing the replace function, it is required that neither the contents to be found nor the contents to be
replaced are null, and these two kinds of contents cannot be the same. The replaced element also needs to be
checked for correctness. The replacement will not be executed if the checking fails. In the replacing process, you can
select Replace or Replace All. If you select Replace, the detailed failure cause will be given if the replacement is not
successful, but if you select Replace All, the failure cause will not be given. Replacement dialog box is shown in
Figure 4-2.
Go To
Select Edit -> Go To or press the CTRL+G keys to pop up the Find/Replace/GoTo dialog box. You can quickly go to
a certain row in the current editor by using the Go To function. The “Go To” tab in the dialog box is as shown in Figure
4-3.
Appendix 2 List Of Instructions 23
Figure 4-3 Go to
Searching among multiple programs means searching in all the programs in a project and displaying the results in the
output window. You can select to search in all the programs, the opened program or the current program. This
function is not applicable to the non-program documents such as the variable table and monitoring table, and the
encrypted program will be skipped in the search process.
Select Edit -> Find in project… or press the button in the toolbar to pop up the dialog box as shown in Figure
4-4:
In the dialog box as shown in Figure 4-4, you can specify the character string to be found, including the element
address and variable sign, and select the range and the program type to be searched. After the setting, click the Find
button to start the searching. The result will be placed in the Find tab of the Output Window, as shown in the figure
below:
In the above figure, double click the found result to go to the relevant program.
24 Appendix 2 List Of Instructions
Copy
Select a cell or drag the mouse to select some area, select Edit -> Copy or press the CTRL+C keys to copy the
selected elements to the system clipboard. For the Ladder Diagram editor, only when the most left cell used by the
element is in the selected area can the element be copied. For the Ladder Diagram editor, if there are vertical lines in
the area to be copied, only when all the cells crossed by the vertical lines are in the selected area can the vertical
lines be copied to the clipboard.
Cut
Select some cell or drag the mouse to select some area, select Edit -> Cut or press the CTRL+X keys to copy the
selected elements to the system clipboard, and clear the selected elements in the meantime.
Paste
Select Edit -> Paste or press the CTRL+V keys to paste the contents in the clipboard to the current location in the
current editor. No matter what kind of editor is used, the overwrite mode will be used in the pasting process, that is, all
the elements in the area to be pasted will be cleared first, and then the elements in the clipboard will be pasted one
by one. The elements in one kind of editor cannot be pasted to another kind of editor.
Other Information
In Ladder Diagram and SFC editors, you can either select an area by dragging the mouse or select one cell, and then
press and hold the Shift key and click on another cell, so as to select the area between these two cells.
Insert Row
By using the Insert Row function, you can insert a row in the editor. When using this function, select any cell on the
row to be inserted, right click and select Insert Row, and then the system will move down the current row and all the
rows below by one row, thus a new row is inserted above the current row.
Note that, for the Ladder Diagram, if the element in the current row is connected to the element in the above row
through vertical line, the vertical line will be stretched automatically so as to maintain the original connection
relationship. If there are already 4000 rows in the current Ladder Diagram, you cannot insert any more rows.
Delete Row
By using the Delete Row function, you can delete a row in the current editor. When using this function, select any cell
on the row to be deleted, right click and select Delete Row, and then the system will clear the current row and move
up all the rows below by one row. You can also select several rows and delete them at one time.
Append Row
Append Row means adding a new row to the end of the table. The global variable table, local variable table and
element monitoring table support this function. Right click and select Append Row, or just press the ↓ key to add a
new row for the current table.
In the process of editing the program, you can click the Undo button in the toolbar or select Edit -> Undo to undo the
wrong operation. You can perform up to 1000 times of undo operations. You can also click the Redo button or select
Edit -> Redo to recover the latest undo operation. You can perform up to 1000 times of redo operations.
Printing Preview
Before printing, you can have print preview on the screen. Click File -> Printing Preview or the button on the
toolbar to open a print preview window.
Appendix 2 List Of Instructions 25
Print
If you need to print, click the button on the toolbar or the button in the print preview window, and set the
printer in the popped up print dialog box. Click the OK button after the setting, and then the current program will be
output to the printer.
When printing the Ladder Diagram or SFC, if some row is too long to be printed in one page, the system will continue
to print the rest part of the row on the next page until the entire row is printed.
When printing Ladder Diagram, if there is a vertical line in the last row in a page, the vertical line will be printed again
in the top row of the next page in order to show the connection relationship.
After editing the program, click the compile button in the toolbar to check if there is any error in the current
program. The output window will display the error information and error location. Double click the error information to
go to the error. The output window is shown as the following figure. If the number of errors displayed in the output
window is 0, it means there is no error in the program, and the program has passed the compilation.
Ladder diagram is a chart language similar to the electrical relay drawing. It is composed of several logic networks,
which is composed of interconnecting graphic elements, the most basic elements of Ladder diagram program. The
elements include:
1. Contact ——The switch in the electrical drawing. The current passes through the Normally Open (NO) contacts
when the contacts are closed and passes the Normally Closed (NC) contacts when the contacts are open.
2. Coil ——The power flow charged relay or the output.
3. Function block ——Or application instruction, referring to the function executed when the power flow arrives (for
example, data transmission, data calculation, timer and counter).
4. Connection wire and ——Cables in the electrical drawing, used to connect elements.
The network is composed of the above elements and represents one complete circuit. The current flows through the
NC contacts from the power source post in the left (represented by the vertical line in the left of the Ladder Diagram
editor) to charge the coil or the functional instruction.
Similar to the electrical drawing, in the Ladder diagram, there are two kinds of connection relationships between
elements or element-composed blocks : serial and parallel, as shown in Figure 4-7.
In the Ladder Diagram editor, the whole input area is divided into many hidden cells, which can be selected by
clicking or by pressing the arrow keys. A selected cell will be surrounded with a black frame. After selecting a cell, you
can start inputting an element. The element can take one or more cells according to its size.
The Ladder Diagram has the following two basic element input methods:
Direct input
Enter letters directly into a selected cell, and the instruction input dialog box will pop up automatically, as shown in
Figure 4-8. After entering a complete instruction and parameter, press the Enter key, the software will check the
correctness of the instruction. If the instruction is correct, the corresponding graphic element will be generated, as
shown in Figure 4-9.
Figure 4-8 Instruction input dialog box Figure 4-9 The generated graphic element
Guided input
After selecting a cell, you can also input elements through the menu or the toolbar. After the element type or
instruction is selected, the software will automatically detect the required parameter number and format and then
adjust the input interface, as shown in Figure 4-10 and Figure 4-11.
Figure 4-10 Guided mode input dialog box for normally open contacts
In Figure 4-11, after selecting the instruction, you can click the button or press the F1 key to check the detailed
help information of that instruction.
Appendix 2 List Of Instructions 27
As for the CALL instruction, because its parameter number is variable, and other parameters can only be determined
after the name of the sub-program (the first parameter of the CALL instruction) to be called is selected, a special
dialog box is designed for the CALL instruction as shown in Figure 4-12.
In this dialog box, after selecting the subprogram name, the following table will display all types of subprogram
parameters, and names, addresses and data type of the subprogram. You can input the parameter in the import
value field. After confirmation, a CALL instruction element will be generated if the input is correct.
The corresponding element type of each icon on the Toolbar is given as follows:
Limitations:
1. Some instructions can only be input in the Instruction List editor but not in Ladder diagram, such as MPS and MPP.
No element will be generated if you input these instructions in Ladder diagram.
2. The coil and application instruction represent the end of a row in Ladder diagram. No other element can be input
after these elements.
3. The vertical line takes the space of two rows. When inputting a vertical line, make sure there is enough space in
the neighboring two rows, or the vertical line cannot be input.
4. The maximum number of input columns of Ladder diagram is 32, and the maximum number of the input rows is
4000.
Shortcut keys
In the Ladder diagram, press the Ctrl+→ keys to directly input the horizontal line, press the Ctrl+↓ keysto directly
input the vertical line, and press the Ctrl+Shift+↓ keys to delete the vertical line.
Input mode
The element has two input modes: overwrite and insert. In overwrite mode, the newly input element will overwrite the
other element in the cells to be taken by the input element. While in insertion mode, the original element in the
location and the other connected element will be moved right by several cells so as to reserve enough space for the
newly input element. You can use the Insert key to switch between these two modes.
28 Appendix 2 List Of Instructions
Modify
If you need to modify an existing element in the Ladder diagram, double click the element to be modified or press
Enter key at the element, an instruction input dialog box will pop up, in the meantime, the corresponding instruction of
the selected element is displayed in the input frame. At this time you can modify the instruction and parameter.
You can use the Invert instruction in the menu or press the Ctrl+R keys to switch between NO contacts and NC
contacts , and the rising edge and trailing edge .
Limitations
1. None of the contact elements can be changed to coil or application instruction, and vice versa.
2. The contact element (NO, NC, rising edge, trailing edge, invert and step) that takes one cell cannot be changed to
comparison contact and vice versa.
3. Double click the CALL instruction and inverter connection instruction, the Wizard dialog box will pop up, so we
cannot change it to other instructions.
4. The changed instruction can be accepted by the software only when it passes the instruction check.
Operation method
To make the Ladder diagram more readable, you can input some comments. These comments are called block
comments. Each block comment takes the space of a whole row.
If you need to input the block comment, first select a blank row, right click the mouse and select the Insert Block
Comment submenu, and then input the comment in the block comment dialog box, and finally click OK. The software
will automatically add “/*” and “*/” at both sides of the input words, and display them in green. See Figure 4-13 for the
above operations.
Limitations
Since the block comment will take the space of a whole row, if there is already some other element in a row, the block
comment cannot be input into that row. Similarly, other element cannot be input into the row taken by a block
comment.
Appendix 2 List Of Instructions 29
The variables are defined in global variable table (see section 4.5.1) and local variable table (see section 4.6.1). The
correctly defined variable can be used in Ladder diagram. The variable names can be used to represent addresses
so as to increase the readability of the program. Figure 4-14 gives an example of a variable defined in the global
variable table.
Symbol Addressing
After the defined variable is used, you can switch between the variable name and element address through the
Symbol Addressing menu. Figure 4-15 shows one Ladder diagram program in two display modes.
30 Appendix 2 List Of Instructions
Figure 4-15 The same ladder diagram program in two display modes
Element Comment
You can select Element Comment menu to control whether to display the element comment or not. Figure 4-16
shows the Ladder diagram program when the element comment is displayed.
Figure 4-16 Ladder diagram program when the element comment is displayed
In order to optimize the Ladder diagram program, the software provides the Ladder diagram program optimization
display function. This function is to process the opened Ladder diagram program, that is, to align all the input
elements to the left, and align the output elements and application instruction to a specified column. In default
condition, this specified column is the column that is in the most right side in the current window. If you need to align
other columns, click Tool/System Option to pop up the system option dialog box, and make selection in the dialog
box as shown in Figure 4-17. If you need to use the optimization display function, open some Ladder diagram
program and then click the Check/Optimize Display menu.
The network number can make the logic of Ladder diagram clearer and it is also helpful for program locating,
especially the printed program. The Ladder diagram will display the network number in the following situations (the
network number is displayed as “N +network ID”):
1. After successfully compiling a single Ladder diagram program, the current Ladder diagram will display the network
number.
2. After successfully compiling all the programs, all the opened Ladder diagram programs will display the network
number.
3. The network number will be displayed after the Instruction List or the SFC is converted into Ladder diagram.
4. If some Ladder diagram program displays the network number in the last saving operation, the network number will
also be displayed next time when it is opened (the Symbol Addressing mode must be the same as the one when it is
saved).
After compiling the Ladder diagram that has displayed the network number, the network number will be hidden
temporarily until next time the Ladder diagram is edited successfully. The Ladder diagram that displays the network
number is as shown in Figure 4-18.
SFC is a language that divides the control process into several steps, and performs jumping between steps according
to the procedures or work flow of the mechanical equipment. A standard SFC consists of the initial step, common step,
transfer conditions, jumping and resetting. Every step is a procedure of the mechanical equipment. Every step may
have an internal LD that is the procedure to be finished in this step. The transer condition is the condition for
completing one procedure and starting the next. It needs the internal LD to express the transfer condition. Figure 1-2
is an example of SFC programming.
As shown in the above SFC, the initial status is S0. If the transfer conditions of S0 to S20 are not satisfied, S0 will be
executed all along. Once the transfer conditions are satisfied, S0 will stop and S20 will start. The transfer from one
step to the next will go on like that until, at last, the jumping condition from S21 to S0 is satisfied, and the cycle will
restart. Through the jumping, the whole cycle will go on and on.
32 Appendix 2 List Of Instructions
Step Sign
The step sign is classified into the initial step sign and the common step sign. They use the internal soft element (S)
status to perform procedure step control over the sequence control program.
1. Initial Step Sign
The SFC network must be executed from the initial step sign. The corresponding graphic sign of the initial step sign is
. You can click the button to add the initial step sign in the selected location. The corresponding S soft
element address range of the initial step sign is S0 to S19.
2. Common Step Sign
The corresponding graphic sign of the Common Step Sign is . You can click the button to add the common
step sign in the selected position. The corresponding S soft element address range of the common step sign is the
address of all the S soft elements with the address bigger than 19.
Transfer Sign
The corresponding graphic sign of the Transfer Sign is . You can click button to add the transfer sign in the
selected position. The Transfer Sign has an internal Ladder diagram. You can compile codes in it to decide whether to
set the connected S soft element status or not.
Reset Sign
The corresponding graphic sign of the Reset Sign is . You can click the button to add the reset sign in the
selected position. The function of the reset sign is to reset the specified S soft element.
Jump Sign
The corresponding graphic sign of the Jump Sign is . You can click the button to add the jump sign in the
selected position. The function of jump sign is to set the specified S soft element so that the Ladder diagram code in
the soft element can be executed.
Connection Line
The connection line is used to connect the SFC elements described above. The connection relationship that the
connection line can express also includes the Select Branch, Select Merge, Parallel Branch and Parallel Merge.
1. Select Branch
The corresponding graphic sign of “Select Branch” is . You can click the button to add the connection lines
for Select Branch and two transition sign elements in the selected position. The Select Branch must start from a SFC
step sign and end with a transfer Sign. It means that if the SFC step sign is successfully executed, the program will
select one branch and go on according to the conditions specified in the transfer sign.
2. Select Merge
The corresponding graphic sign of the Select Merge is . You can click the button to add the connection
lines for Select Merge and two transfer signs in the selected position. The Select Merge must start from
multi-transition sign, to a common step sign, jump sign and end at reset sign. It means that as long as the condition
for one transfer sign is met, the connected element will be executed.
3. Parallel Branch
The corresponding graphic sign of the Parallel Branch is . You can click the button to add the connection
lines for “Parallel Branch” and one transition sign in the selected position. The Parallel Branch must start from a
transition sign, to a common step sign, jump sign and end at reset sign. Its meaning is: If the condition for transition
sign is met, the elements connected to the Parallel Branch will be executed together.
4. Parallel Merge
The corresponding graphic sign of the Parallel Merge is . You can click the button to add the Parallel
Merge connection lines and a transfer sign in the selected position. The Parallel Merge must start from a common
Appendix 2 List Of Instructions 33
step sign, and end at a transfer sign. It means that as long as one common step sign is successfully executed, the
codes in the transfer sign will be executed.
Copy/Paste
After selecting a cell or an area, select Edit->Copy or press the CTRL+C keys to copy the selected element to the
system clipboard, then select Edit->Paste or press the CTRL+V keys to paste these elements to another location or
another SFC.
34 Appendix 2 List Of Instructions
Insert/Delete Row
1. Insert Row
The function of Insert Row is to insert a new row in the SFC.
Operation method: Select any cell in a row, right click and select Insert Row in the menu, and the system will move
down that row and all the rows below by one row, thus forming a new row.
2. Delete Row
The function of Delete Row is to delete a specified row in SFC.
Operation method: Select any cell on the row to be deleted, right click and select Delete Row, the software will clear
the current row and move all the rows below up by one row.
In SFC program, you can use only the variables corresponding to the S soft elements defined in the global variable
table.
The SFC provides two addressing modes: Symbol and element address. Select View -> Symbol Addressing to
switch between these two kinds of addressing modes. If the Symbol Addressing entry is selected, all the element
addresses with defined variables will be expressed by variable names. If the Symbol Addressing entry is not
selected, the element addresses will be displayed regardless of whether the variable is defined or not, and the input
variable name will be converted into element address automatically.
Input Instruction
The Instruction List editor is a text editor used to input the instruction, operator and comments. After inputting the
required instruction in the editor, the software will automatically align the instruction, operator and comments. The
instruction key words are displayed blue; local variable, global variable and inverter name, purple; constant, gray;
element, black; comment, green; error information, red. See Figure 4-22.
If you enter “//” in any position in the editor, the contents after the current row will be regarded as comments.
Copy/Cut/Paste
Click and drag in the text editor to select the text to be copied. Press the Ctrl+C keys or click Edit -> Copy to copy
the selected contents to the Windows clipboard. The copied contents can be pasted in any standard text editor,
including the Windows Tablet, Notepad or Word.
The operation of “Cut” is very similar to that of “Copy”, the difference is that the cut contents will be deleted from the
editor. Press the Ctrl+X keys or click Edit -> Cut to cut the contents to the Windows clipboard.
After copying or cutting, use mouse or keyboard to move the cursor to the place where the contents are to be pasted,
and press the Ctrl+V keys or click Edit -> Paste to paste the copied/cut contents.
Correctness check
After a row of instruction is input and the cursor is moved to other rows, the software will perform correctness check
on the row just input. If the row has syntax errors, it will be highlighted in red. Move your mouse onto that row, and the
software will prompt the error information. The rows checked to be correct will be displayed in proper format. If you
paste several rows into the editor at the same time, the editor will check the syntax of every row.
If there is any syntax error, move the mouse onto the corresponding row to see the error information, as shown in
Figure 4-23.
Appendix 2 List Of Instructions 35
In Figure 4-23, the Ladder diagram instruction operator S8292 exceeds the biggest range of S element, so it is
considered illegal.
In the software, you can define global variables (see section 4.5.1) and local variables (see section 4.6.1). The
defined variables can be used in the Instruction List. When inputting the element address, if a variable has been
defined for the element address, you can use the variable name to replace the element address as the operator input.
If a local variable is used, the software will automatically add “#” before the variable name to differentiate it from the
global variable.
The Instruction List provides two addressing modes: Symbol and element address. Click View -> Symbol
Addressing to switch between these two kinds of addressing modes. If the Symbol Addressing entry is selected, all
the element addresses with defined variable will be expressed by the variable name. Otherwise, the element
addresses will be displayed regardless of whether the variable is defined or not, and input variable names will be
converted into element addresses automatically.
Line No.
The row number is mainly used to quickly locate the program and improve the readability of the program. Click View
-> Line No. to hide or display the line number.
Bookmark
Bookmarks can be inserted into any row in Instruction List program. Click the button on toolbar or click the Edit ->
Toggle Bookmark, you can add the bookmark to the row where the cursor is located, or delete the bookmark. Click
the or button, you can quickly locate the next bookmark of the bookmark position or the row where the last
bookmark is located. Click the button, you can clear all the existing bookmarks.
4.5.1 Definition
Global variable is a meaningful sign name defined for a certain PLC address. This sign name, which is accessible in
the whole project, stands for the corresponding element of the variable. The global variable is defined in the global
variable table.
The global variable statement includes three properties: the variable name, variable address and variable comment.
Rules for defining the global variable: The variable is composed of letters from A to Z (uppercase and lowercase),
numbers from 0 to 9, underline and Chinese characters. The variable name must not start with a number, nor be
numbers only. The length shall not exceed 16 English letters. It is not allowed to use element type letter plus numbers
as the program name or variable name. The name shall not contain space, and shall not be the same as key words.
The reserved key words include: basic data type names, instruction names, and operators in the Instruction List
language.
The number of global variables cannot exceed 500.
Double-click the Global variable table entry in the Project Manager window to open the table as shown in the figure
below:
36 Appendix 2 List Of Instructions
You can view and edit the variable name, element address and element comment in the global variable table. During
the editing process, the software will check the validity of the global variable table:
z If the element address is wrong, the software will use different colors to display the element address.
z The variable name input into the sign table must be unique. For the repetitive variable name, the software uses
different colors to indicate the variable name.
The global variable table can exchange data with an EXCEL table. You can import the data edited by EXCEL to the
global variable table, and export the global variable table to the EXCEL file. The format of EXCEL file that exchanges
data with global variable table is as shown in Figure 4-25, where the columns A, B and C correspond to variable
name, variable address and comment respectively.
Figure 4-25 Format of EXCEL file that exchanges data with global variable table
The defined global variable can be used in various kinds of programs. If the local variable or global variable with the
same name is defined, adding “#” before the variable name means that this variable is using a local variable,
otherwise it uses a global variable.
4.6.1 Definition
For every program, you can define the input parameters, output parameters and local variable used by this
subprogram according to the different types. The descriptions for the parameter and variable are defined in the local
variable table of the program.
Appendix 2 List Of Instructions 37
The local variable is a meaningful sign name defined for a certain address of the PLC. This variable has a local range
and is effective only in a certain program unit. The local variable is defined in the local variable table.
The local variable statement includes five properties: variable address, variable name, variable type, data type and
variable comment. There are three variable types (IN, IN_OUT, OUT and TEMP), and the value cannot be changed.
The naming rules of local variable are the same as those of global variable.
For the main program and interrupt subprogram, you can define the local variable in the local variable table of each
program. The local variable is only valid in the program where it is defined, and will be released from the memory
after the program is executed. The type key word of the local variable in the local variable table is TEMP. The
maximum number of local variables defined in a program is 64.
For a subprogram, you can define not only the local variable in the local variable table, but also the calling
parameters and return parameters of the subprogram.
The type key word of input parameters in local variable table is IN.
The type key word of output parameters in local variable table is OUT.
The type key word of input and output parameters in local variable table is IN_OUT.
The number of the three kinds of parameters defined at the same time cannot exceed 16.
In the local variable table, you can check the variable name, data type and variable comment, and modify the variable
name and variable comment. The supported data types include BOOL, WORD, DWORD, INT, DINT and REAL.
The maximum length of the variable comment is 20-byte.
Each program has its own local variable table, which is a part of the program. After the program (including the main
program, subprogram and interrupt subprogram) is created, the corresponding local variable table is also created.
The upper part of the edit window displays the local variable table and the lower part displays the program, as shown
in Figure 4-26.
You can view and edit the variable name, variable type, data type and comment in the local variable table. The
variable address is allocated automatically and cannot be edited.
During the process of editing the local variable table, the software can check the validity of the table:
z If the variable name is illegal, the software will use different color to display the name.
z The variable name and parameter input into the local variable table must be unique. For the repetitive variable
name and parameter name, the software uses different colors to indicate the variable name.
Automatic allocation of variable address: When defining the input/output parameters and local variables, once the
variable storage type is decided, the specific address shall be allocated to this variable or parameter in LM or V
register.
LM register is used to allocate addresses for bit variables, and V register is used for word or double-word variables.
The register address of the double-word variable is displayed as the address of the first word. When the number of
bytes changes due to the data type change or deletion of some variables, the variable address of the subsequent
variable will be re-allocated also.
38 Appendix 2 List Of Instructions
The defined local variable can be used in various kinds of programs. Adding “#” before the variable name means that
this variable is using a local variable, otherwise it uses a global variable. For the local variable without the same
global variable, “#” will be added automatically before this variable after this instruction is formatted.
In the element address programming-mode, the variable name will not be displayed and the address in the code will
not be adjusted when the address is re-allocated.
The Cross reference table is used to record the usage of elements in each program. You can locate the
cross-reference information in the program by double clicking the record in the cross-reference table.
You cannot edit the Cross reference table. You can only search or locate in this table, by selecting the Find or Go
To entry in the Edit menu or by clicking the button.
The program generates the Cross reference table after it is compiled or converted, and remains unchanged before
the next compiling is successful. After exiting the project, the contents of the cross reference table are saved in the
file. The Cross reference table includes the following information:
Element name: display the variable name if the element is defined as a variable in the global variable table, and the
current display mode is set to the variable displaying mode. Otherwise, display the element address.
program block: the program where the element is located
position: the line number and column number in the program where the element is located
context : usage of the element
If the Cross reference table has one or several variables defined in the global or local variable table, the data in that
line can be displayed as symbol or address. You can select the View -> Symbol Addressing to switch between the
variable name and element address. In the address addressing mode, all elements are displayed as element
addresses. In the symbol addressing mode, the addresses defined in global variable table or local variable table are
displayed as symbol names. Undefined addresses are displayed as element addresses.
The Cross reference table displays only the information of the used element. The Element browse table displays
through a table the usage of all the soft elements supported by the system. Double clicking element in the Element
browse table, if the element is being used, will display the element in the program that uses the element. If this
element is referenced for many times, the display will go to the position in the program where the element is used for
the first time. The element browse table is shown in Figure 4-27.
“×” means the element has been used, and being blank means the element has not been used, and None means the
element does not exist. In the above Figure, the elements that have been used in the element browse table are LM0
(0+0), T0 (0+0), X1 (0+1), Y0 (0+0), and Y1 (0+1), where X8 (0+8), X9 (0+9), Y8 (0+8) and Y9 (0+9) elements do not
exist (because X and Y elements are addressed in octal).
By double clicking “×”, you can go to the program that uses the element.
Appendix 2 List Of Instructions 39
The element browse table provides not only the fast positioning function, but also the element filtering function. The
element filtering means the user can specify which kind of element to be displayed and which kind of element to be
hidden. The elements are classified into X, Y, M and D element types. You can not only specify the type of elements
to be displayed, but also specify the elements of a fixed range. For example, you can display D type elements only in
the range of 1000 to 1500.
Operation method: right click and select Element Filter, or click Cross Reference Table -> Element Filter to pop up
the Filter dialog box as shown in the following figure:
In the above dialog box, setting the parameter Range to “*” means all the element addresses can be displayed. To
specify a certain display range, use the format of “m-n”, indicating the addresses from m to n will be displayed. Note
that the Cross reference table and the Element browse table update the corresponding program information only
after the program is saved.
40 Appendix 2 List Of Instructions
First, determine the PLC serial port protocol, which should be set the same at the PC serial port. After that, press the
Program port setting or the Modbus setting button to continue. Pressing the Program port setting button will pop
up a dialog box as shown in in Figure 5-2:
Select the serial port that is actually connected to the computer in the serial port drop down list, select the
communication baud rate and click the OK button to save the settings. For the programming port protocol, you can
set the baud rate of the PLC serial port and computer serial port at the same time, and you can also set the computer
serial port baud rate separately. When configuring the Modbus protocol, the dialog box as shown in Figure 5-3 pops
up:
Appendix 2 List Of Instructions 41
Select the serial port that is actually connected to the computer, and then input Baud rate and PLC station number
in the drop down lists, and click the OK button to save the settings.
For the Modbus protocol setting, you can only set the computer serial port and cannot set the PLC serial port. If you
need to set the PLC serial port to Modbus protocol, you should set it in the system block, and it will be effective after
you download and run it. In addition, if time out error occurs frequently in Modbus protocol communication, the cause
may be that the main mode time out setting value is too small. You can solve this problem by increasing the baud rate
or the time out value.
After setting the serial port cable connection and communication, you can test the computer — PLC communication.
Click PLC -> PLC Info… If the communication is normal, a window will pop up to display various kinds of information
of the connected PLC. If overtime error message is prompted every time this function is used, the serial port
connection or setting may be wrong. Check the hardware connection and communication setting then.
Enter the telephone number that connects of the PLC, click the OK button, and the following information box will pop
up to show the dialing process:
42 Appendix 2 List Of Instructions
After dialing successfully, the toolbar will display the icon that indicates the modem is connected. At this time, you can
control the remote PLC. After the communication with PLC is over, you can select Tool -> Modem -> Disconnect to
disconnect.
Note that the PLC serial port baud rate must be consistent with that of the modem so that the modem at the PLC side
can be dialed through. Perform the following procedures to keep the consistency between the two baud rates. First,
use ControlStar to read the PLC serial port baud rate (select PLC -> PLC Port Baud Rate), and then set the
computer serial port baud rate to be the same value, and finally use the ControlStar to initialize the modem (select
Tool -> MODEM -> Initialization).
When using the modem to connect the PLC, if the serial port baud rate is 19200, the error code rate would be high,
and the communication command execution failure or time out failure may occur frequently, therefore the baud rate of
9600 is recommended.
You can use system block to set the element, time, communication and input points that are saved upon power failure.
After the setting, download the system block to the PLC and the settings will become effective.
Select System block and double click it in the Project Manager window to pop up the System block dialog box as
shown in Figure 6-1. For different PLC models, some configuration tabs may be hidden because the hardware does
not support it.
After configuring the system block, select PLC -> Compile All to compile the system block files. Select PLC ->
Download to pop up an information box that asks you if you want to re-compile. If you select Yes, the system block
information will be compiled and downloaded.
In the dialog box as shown in Figure 6-1, the first tab is the Saving Range that is used to configure the address
range for storing elements. Note that the address range and the quantity of the element that can be saved vary in
different PLC models. You can define two saving ranges at most (some PLC model only supports one). The final
saving range is the union of the two saving ranges as shown in Figure 6-2.
Upon power failures, the PLC will store the element into the power off backup file according to the range defined in
Figure 6-2.
Upon power on, the PLC will check if the power off backup file. If it is correct, the corresponding elements will be
restored to the values saved at the last power off. If the backup file is lost or wrong, all the element value will be
cleared.
44 Appendix 2 List Of Instructions
Click the Output Table tab to set the I/O point output status when PLC is stopped. See Figure 6-3.
Function description:
The function is to set the configuration of the output points when PLC stops. There are three options for output points
when CPU stops:
1. Keep the output point status before stop
Appendix 2 List Of Instructions 45
Disable
Select Disable, and PLC will disable all the output points when it stops.
Watchdog Timer
The watchdog timer is used to set the watchdog time of the user program. The watchdog time means the maximum
user program running time. When the actual running time of user program exceeds the watchdog time, PLC will stop
the user program and turn on the program alarm indicator (red) and output the signal according to the system
configuration. The setting range of the watchdog timer is 100ms to 1000ms (default: 200ms).
Click the Input Filter tab to set a delay time for PLC input points to filter out the external disturbance. Setting the
input delay time can filter the input digital signals. You can use the programming software to set the digital filter
constants for input points X0 to X17. The digital filtering constant range and default value vary in different PLC models.
See Figure 6-6.
Appendix 2 List Of Instructions 47
The advanced setting of system block is used to configure parameters such as the Datablock enabled, Element
value retained, and No battery mode, see Figure 6-8.
Datablock enabled: If this option is selected, PLC will initialize the D elements with the datablock when it is switching
from STOP status to RUN status.
Element value retained: If this option is selected, the element value will be saved as image and will not be initialized
when PLC switches from STOP to RUN status. If Datablock enabled and Element value retained are selected at
the same time, the Datablock enabled has the priority.
No battery mode: If this option is selected and the system battery fails, the battery backup data lost error and forced
table lost error will not be reported. This option is invalid if the PLC has no battery.
Formatting is prohibited: If this option is selected, the PLC cannot be formatted. Be careful in selecting this option.
If this function and the download password are set at the same time, and if you forget the password, you cannot use
the PLC. This option cannot be selected if the PLC does not support this function.
You can set the software communication port through this tab, including what communication protocol is to be used,
how to support Modbus protocol, ECbus protocol, Freeport protocol and so on. See Figure 6-9.
Appendix 2 List Of Instructions 49
The communication port 0 in the system dialog box is the programming port protocol by default. The communication
port 1 has no protocol by default. You can set port 0 and port 1 separately.
Freeport protocol
The Freeport protocol is the communication mode of self-defined data file format. This mode supports two data
formats: ASCII and binary. The Freeport communication can only be used when the PLC is in RUN mode, when the
PLC cannot communicate with the programming device. In STOP status, serial port 0 can only be used in
programming port communication.
Click the Freeport setting button in Figure 6-9 to pop up Freeport Protocol setting interface as shown in Figure
6-10. You can set the start bit in the information character, inter-character time out value, and maximum value of
received character. The receiving command allows the system to receive one or more character buffer, and the
maximum number is 255 characters. The serial port starts receiving the Freeport according to the receiving conditions.
The Valid byte setting is invisible for some PLC models.
Modbus Protocol
Through the MODBUS protocol, MODBUS master station can communicate with the slave station (including inverter),
sending control frame to the slave with the MODBUS function code.
1. PLC communication Port (0) setting
Port 0 can be set as MODBUS slave station. It communicates with the master through the MODBUS function code
and respond to master’s requests. Process the packets judged as local packets and count the received packets so
that the MODBUS master station can query it. Click the MODBUS setting button in Figure 6-9 to set Modbus
protocol parameters. See Figure 6-11.
Ecbus Protocol
Ecbus network is an equivalent network among multiple PLCs. Each PLC in the network can exchange data with
other PLCs through a shared data area. This option will be disabled for the PLCs that do not support Ecbus protocol.
See Figure 6-12 for the parameters of Ecbus Protocol. The mode can be set to single layer or double-layer. The
refreshing mode setting range varies with different modes.
In the System block interface, click the Special Module Configuration tab. See Figure 6-13. In this tab, you can
configure the special module types of the PLC main module and the data area in each special module. This tab is
invisible for the PLC main module that does not support the function.
Up to eight special modules can be configured. The configurable module types vary in different main module types.
Set the module address number consistent with the actual module serial number, otherwise error will be reported
upon main module power-on.
After selecting the module type, you can set the corresponding module property by double clicking the line or
selecting the Set-> area and clicking the … button.
The following introduces the setting interface for each extension module. If you need to use the defaults, set the
parameter to ‘Null’ or ‘Auto’. The items marked with a D correspond to the D register address of the main module.
Figure 6-14 Configuration for analog input, output and mixed module
1. Top: general items, such as initialization and module ID. Valid for all channels.
2. Bottom: channel configuration, such as channel mode and sampling times. Press the up and down arrow keys at
the right to switch between different channels.
The standard temperature and measured temperature are used for module calibration. Only Celsius degree can be
used. Unit: 0.1°C.
In the System block interface, click the Priority Level of Interruption tab to set the interrupts’ priority level in the
PLC. This tab is invisible for the PLC that does not support the setting.
The interrupt priority is classified into two levels: High and low. The system has a fixed priority level for each interrupt
by default. If the default setting cannot meet the actual requirements, you can set manually. Interrupts of high priority
level can stop interrupts of low priority level.
It is inconvenient to generate instructions that have lots of parameters. ControlStar provides the Instruction Wizard to
make it easier.
PID Instruction Wizard lists the meanings and input boxes of PID-calculated parameters. After the setting, PID
Instruction Wizard will generate two subprograms: PID set and PID execution. PID set subprogram sets the PID
instruction parameter, and it executes the PID instruction every time in every cycle when the energy flow is enabled.
The execution procedure is as follows:
1. Click Tool -> Instruction Wizard to pop up the dialog box as shown in Figure 6-17.
54 Appendix 2 List Of Instructions
2. Select the Instruction Wizard type and click the Next button to pop up the dialog box as shown in Figure 6-18.
Enter relevant parameters then.
3. Click the Next button to pop up the dialog box as shown in Figure 6-19. Enter the target value and sampling time in
the dialog box.
4. Click the Next button to pop up the dialog box and configure all the parameters as shown in Figure 6-20.
Appendix 2 List Of Instructions 55
5. Click the Next button to pop up the dialog box as shown in Figure 6-21. Configure the input variation alarm and
output variation alarm values in the dialog box.
Figure 6-21 Input variation alarm and output variation alarm setting
6. Click the Next button to pop up the dialog box as shown in Figure 6-22. Configure input/output filter constant,
proportional gain, integral time, differential gain and differential time in the dialog box.
Figure 6-22 Filter constant, proportional/differential gain and integral/differential time setting
7. Click the Next button to pop up the dialog box as shown in Figure 6-23. Enter the names for the setting
subprogram and executed subprogram in the dialog box.
56 Appendix 2 List Of Instructions
8. Click the Next button to pop up the dialog box as shown in Figure 6-24. The names of two subprograms to be
generated are displayed.
9. Click the Finish button to end the Instruction Wizard. You can find two newly generated subprogram nodes in the
project manager.
The meanings of PID instruction parameters in the PID parameter setting subprogram (Instruction List type) that is
generated by the Instruction Wizard are listed in Table 6-2.
Instruction Wizard will also generate a subprogram that includes the PID instruction calling. This subprogram will
send proper element addresses to parameters of the PID instruction according to the parameters set in Table 6-2.
When you need to call a PID instruction, you can directly use this PID execution subprogram, thus saving the trouble
of writing the parameters one by one.
The datablock is used to set the defaults of D register. After the setting and compiling, the values can be downloaded
to the PLC. They will be used when the PLC program uses the D register.
In the datablock editor, you can set initial values to the D register (data memory), or set the word or double word of
the D memory, but cannot set value of the byte. You can also write comments in datablock editor. Adding the “//”
before a character string can set the string as a comment.
You can set values for one or more than one addresses through the mode of “D address value 1[, value 2][, value
N...]”. Each value takes the next memory area in sequence. The system will allocate the memory space and the start
address of next value according to the byte number of the value. If the start address has been specified above the
line, you can also set the memory space by directly entering the numbers “value1[, value 2][, value N...]”.
For the value that only takes one word but needs to be used as double words, you can use DD register. For example,
“DD100 10” means storing “10” in a double word expressed by D100 and D101 registers as a double word.
58 Appendix 2 List Of Instructions
If the first line in the datablock has no definite address, the system will set value starting from D0 by default. The later
rows include definite or hidden address value setting. The memory area that has been displayed or has hidden value
setting cannot be set value again. When entering several data values or entering the row that only includes the data
value after setting a value to a single address, the editor will specify the hidden address value setting. The editor will
specify the D memory number according to the previous address allocation and data value size (word or double
word).
The datablock editor is a free-format text editor. It supports the common text editing operations such as copy, cut,
paste and move. After inputting a line and pressing the Enter key, or after pasting or moving, the datablock editor will
format the line (align address columns, data, comments, and capture D memory address) and re-display the row.
Datablock editor accepts both uppercase and lowercase letters, and also accepts the comma, tab or space
characters as the separation character for address and data values.
After the compiling, the datablock can be downloaded to PLC.
Entering “//” in a line in the editor means the contents behind in this line are comments.
Correctness Verification
After inputting an instruction line, if the cursor switches to another line, the software will check the correctness of the
line just input. If there is any syntax error, the line will be displayed in red, and marked with an “!” at the line head.
When the mouse stays at the error line, the software will prompt the error information. Only correct sentences can be
displayed in correct format. If the text pasted into the editor has more than one line, the editor will check the syntax of
every line.
If there is any grammar error, place the mouse at the error line, the prompt will be as shown below::
In the above figure, for the value cannot be set to characters, the software cannot recognize “ABC”.
Appendix 2 List Of Instructions 59
After editing the data, click the button in the toolbar to check if there is any error in the current datablock. If there
is no error, the output window is displayed as follows:
Like the Instruction List editor, the datablock editor provides the functions of including copy, cut, paste, find, replace,
go to, preview and print, see section 4.1 for details.
60 Appendix 2 List Of Instructions
ControlStar can control PLC through the serial port, including controlling PLC operating status, modifying the data
stored in PLC and reading various kinds of information from the PLC.
Some control operations require that the PLC be stopped. If you try to control a running PLC, the system will
prompt whether to stop the PLC automatically as shown in the following figure:
Click the OK button to stop the PLC, or exit the current operation by clicking the Cancel button.
Some control operations may result in the PLC data loss or make the PLC abnormal, such as the PLC element value
clearing, PLC program clearing, PLC datablock clearing, PLC formatting and restoring to default configuration. Before
the control takes effect, the software will prompt you to confirm by entering the same data as the display in the dialog
box, thus avoiding mis-operation.
Note
Before the control operation, make sure that the operation will not affect the PLC normal operation or cause any accident.
Click the Yes button to recompile the program. If the program has any error, the software will exit the download
process. Correct the program error first. If you do not want to compile the program, click the No button to continue the
download operation, the last compiled result will be used, and the program downloaded to PLC may be different from
the program displayed on the software interface.
After compiling correctly, the system will prompt you to select the download content. See Figure 7-5.
After the selection, the Download button will be enabled. Click it to start the download. You can use the Close button
to stop the download.
You can decide whether the downloaded program can be uploaded to ControlStar in the Whether the upload is
enabled area. Enable means yes, Disable means no, and Auto means the current settings of PLC will not be
changed. By default, the setting is Auto. For the PLC models that cannot disable the upload function, this area
cannot be set.
You cannot click Enable before you select all the Program Block, System block and User datablock.
After clicking the Download button, you will be required to enter the password if a download password has been set,
and has not been entered so far. See the following figure.
62 Appendix 2 List Of Instructions
If the password passes the verification, the download will start. Otherwise, the software will ask you to enter the
password again. You can exit the download process by clicking the Cancel button. A progress indicator will appear
during the download, and disappear after the download.
As shown in Figure 7-8, specify the contents to be uploaded, and click the Upload button to start the upload, or click
the Cancel button to exit the upload.
After clicking the Upload button, you will be required to enter the password if an upload password has been set, and
has not been entered so far. See Figure 7-9. Otherwise the upload will start directly.
Appendix 2 List Of Instructions 63
If the password is correct, the software will start uploading. Otherwise, the system will prompt error and return to the
upload dialog box. A progress indicator will appear during the upload, and disappear after the upload.
If the upload is successful, the software will automatically open the uploaded main program.
Note: If you convert the uploaded program into a different programming language in the ControlStar, the program
execution logic will not change, but the result user program could be a little different from the one in PLC. Using the
comparison function then will prompt that the two programs are different.
The dialog box title describes the password type: upload, download or monitoring password. If the password has
been set, you need to enter the Old Password correctly before you can set the new one.
Note
This function may result in PLC mis-operation or operation data loss. Be careful in using it!
Before the execution, the following confirmation dialog box will pop up. Click the OK button to continue or click the
Cancel button to exit.
Note
After the PLC user program is cleared, the PLC will not execute any user program, except for the input/output, communication
and internal processing functions. Be careful in using this function!
Before the execution, a confirmation dialog box will pop up as shown in Figure 7-13. Click the OK button to continue
or click the Cancel button to exit.
Note
After the PLC datablock is cleared, the PLC will not use the datablock preset value to initialize the D register after it starts. Be
careful in using this function!
Before the execution, a confirmation dialog box will pop up as shown in Figure 7-13. Click the OK button to continue
or click the Cancel button to exit.
Note
This operation will cause the loss of all the downloaded and preset data in the PLC. Be careful in using this function!
Before the execution, a confirmation dialog box will pop up as shown in Figure 7-13. Click the OK button to continue
or click the Cancel button to exit.
Appendix 2 List Of Instructions 65
Note
This operation will restore all the PLC defaults, and the downloaded system blocks will be ineffective. The defaults may not
match the actual conditions, resulting in PLC abnormality. Be careful in using this function!
Before the execution, a confirmation dialog box will pop up as shown in Figure 7-13. Click the OK button to continue
or click the Cancel button to exit.
The window displays the current date and time read from the PLC. You can enter a new date and time, and click the
Set time button to confirm. Click the Close button to exit.
Enter the range of the datablock to be read and click the Read from RAM button. The data is read into the list after
the instruction is correctly executed as shown in Figure 7-17.
Appendix 2 List Of Instructions 67
You can select hex, decimal or octal or binary system in the field of Display type in Figure 7-17 to display the data.
After reading the data successfully, the buttons of Merge to datablock and Overwrite datablock are enabled.
Clicking Merge to datablock will add the results after the current datablock. Clicking Overwrite datablock will
replace the contents in the datablock with the generated results. After exiting the register value reading window, the
software prompts that the datablock has changed and the datablock window will be opened automatically, as shown
in Figure 7-18.
After downloading the program to the PLC, debug the program to verify the program logic, ensure that the
communication between the programming equipment and PLC is normal, and the PLC program is consistent with the
program currently opened.
Note
After uploading/downloading the program, if you use a different programming language to display the program, the program
execution logic will not change, but the generated program may not be consistent with the program stored in the PLC.
8.2 Cautions
1. When using the debugging function, the software does not require that the PLC hardware be in the running status.
But, if you need to debug the program logic, you are recommended to set the PLC to the running status, or the
debugging result may be incorrect.
2. In debugging status, the software will read the soft element value timely from the PLC hardware and display the
value in the program window, that is, the debugging result is not in real time. In the meantime, the CPU scanning
cycle of the PLC hardware is much shorter than the software timed reading cycle. Therefore, in the debugging
process, the observed element value has some delay compared to the actual value. At 9600 serial port
communication baud rate, if there is no disturbance, the updating of the element value in the interface has a 0.2
second delay compared to the PLC. If the communication is not smooth, the delay may be several seconds. Knowing
this is very important to understanding the program logic and judging the execution results.
3. To ensure efficiency, upon entering the debugging status, the software will check only the program consistency
between the PC and the PLC. It is suggested not to change the connected PLC during the debugging, for the
software cannot detect the change. It will result in inconsistency between the debugging result and the actually
running program.
In Ladder diagram program, the following elements can be debugged (during the debugging, the displays will change
with the value):
1. NO contact——displayed as connection status when the soft element value is 1
2. NC contact——displayed as connection status when the soft element value is 0
3. Step contact——displayed as connection status when the status bit is 1
4. Coil——displayed as connection status when the soft element value is 1
Appendix 2 List Of Instructions 69
5. Comparison contact and application Instruction List——This type of elements uses several addresses. Each
address cannot be expressed with logic value 1 and 0, but with the specific value .
A complete Ladder diagram program under debugging is shown in Figure 8-1.
During the debugging, some soft element values may need to be changed manually. You can use the “write” or
“force” function. Difference between write and force is that written element values are one-off and may change with
the program operation, but forced element values will be permanently recorded in the PLC hardware until being
unforced.
To use the “write” or “force” function, you need to select the element to be written or forced, right click and select
Write or Force, and then the corresponding dialog box will pop up. All the soft element addresses used by the
selected element will be listed in the dialog box. Modify the address value to be written or forced, click the OK button,
and the value will be downloaded to the PLC hardware. As shown in Figure 8-2, click the value cell of address X0,
select ON or OFF in the drop down list, click the OK button, and the value will be downloaded to the PLC hardware.
When these values are effective in the hardware, you will see the changed results in later debugging process. The
dialog box for Write element value is as shown in Figure 8-2.
The process of “force” is the same with that of “write”, and the dialog box is as shown in Figure 8-3.
70 Appendix 2 List Of Instructions
The forced component are marked with a lock in the Ladder diagram, as shown in Figure 8-4:
8.3.3 Unforce
For the element that does not need to be forced any more, you can unforce it. To unforce an element, select the
element to be unforced, right click and select Unforce to pop up a dialog box as shown in Figure 8-5. All the forced
soft elements of the selected element are listed in the dialog box. You can select to unforce any elements, and click
the OK button to confirm. The forced value will be deleted from the PLC, so is the lock mark.
Refer to Table 8-1 for the display of the force results and their descriptions.
Table 8-1 Display and description of force results
Force results Description Interface display
No force This address has no forced information N/A
Partially forced (left) Only the left half word of a double-word address is forced.
Partially forced (right) Only the right half word of a double-word address is forced.
One double-word address is forced, and the two single-word addresses
Indirectly forced
are forced indirectly.
For the bit address or single-word address, it is forced directly.
Fully forced
For double-word address, both its two single-word addresses are forced.
Appendix 2 List Of Instructions 71
As all the forced soft elements are stored in PLC hardware, you can read them during the debugging. Right click and
select Read all forced… to pop up a dialog box that displays all the forced soft elements and forced values as shown
in Figure 8-6.
Only the initial step and common step elements can be debugged. When the status of their S soft element is ON, the
elements are displayed as connection through as shown in Figure 8-8:
During the debugging, some soft element values may need to be changed manually. You can use the “write” or
“force” function. Difference between write and force is that written element values are one-off and may change with
the program operation, but forced element values will be permanently recorded in the PLC hardware until being
unforced.
To use the “write” or “force” function, you need to select the element to be written or forced, right click and select
Write or Force, and then the corresponding dialog box will pop up. All the soft element addresses used by the
selected element will be listed in the dialog box. Modify the address value to be written or forced, click the OK button,
and the value will be downloaded to the PLC hardware. As shown in Figure 8-9, click the value cell of address S0,
select ON or OFF in the drop down list, click the OK button, and the value will be downloaded to the PLC hardware.
When these values are effective in the hardware, you will see the changed results in later debugging process. The
dialog box for Write element value is as shown in Figure 8-9.
The process of “force” is the same with that of “write”, and the dialog box is as shown in Figure 8-10.
The forced component are marked with a lock in the SFC, for example: .
8.5.3 Unforce
For the element that does not need to be forced any more, you can unforce it. To unforce an element, select the
element to be unforced, right click and select Unforce to pop up a dialog box as shown in Figure 8-11. All the forced
soft elements of the selected element are listed in the dialog box. You can select to unforce any elements, and click
the OK button to confirm. The forced value will be deleted from the PLC, so is the lock mark.
As all the forced soft element are stored in PLC hardware, you can read them during the debugging. Right click and
select Read all forced… to pop up a dialog box that displays all the forced soft element and forced values as shown
in Figure 8-12.
The EMT fields include the element address, data type, display format, current value and new value (written value).
74 Appendix 2 List Of Instructions
Each new project has a default EMT. Actually, according to the actual needs, you can add up to seven EMTs into the
project.
Right click the Element Monitoring Table node in the Project Manager window, and select Insert Monitoring Table
to add a new EMT. The default names of the newly added EMT are EMT_1, EMT_2, … and EMT_8. You can right
click an EMT in the Project Manager window and select Rename to change the EMT name, or select Delete to
delete the EMT.
The EMT has two modes: monitoring mode and editing mode. In the monitoring mode, besides the editing function,
the ControlStar also can automatically read PLC data, refresh element value, write, force/unforce and display
elements. In the editing mode, the software only has editing function.
In editing mode, click Debug -> Monitor, or click the icon to enter the monitoring mode. In monitoring mode,
execute the same operation to enter the editing mode.
Write
After selecting an element, right click and select Write select element in the popped up menu, and then enter the
element value. The software will check the validity of the entered contents (data type and value): legal data will be
written into the PLC and the current element value be refreshed immediately; illegal data cannot be executed and
system will prompt error. Note that some elements cannot be written. See section 8.3 Debugging Of Ladder
Diagram Program for details.
Force
After selecting an element, right click and select Force in the popped up menu to set the selected element to forced
status. If a legal value exists in the value-entering field at this time, the element will enter forced status, and that legal
value will be written into the PLC. After the element is forced, you can see the forced status mark in the EMT, and this
can also be recognized in online Ladder diagram. Note that some elements cannot be forced. See section 8.3
Debugging Of Ladder Diagram Program for details.
Unforce
Select the element to be unforced, right click and select Unforce to unforce a forced element. You can also select
Unforce all to unforce all the forced elements. After unforcing, you can see the element is in unforced status in EMT
and online Ladder diagram.
After entering the element address in the EMT Element Name field, if the element address has been defined in
global variable table, you can select View -> Symbol Addressing to switch between the variable name and element
address. In the addressing mode, all the elements are displayed as element addresses.
Appendix 2 List Of Instructions 75
In the Symbol Addressing mode, the address defined in global variable table is displayed as global variable name,
others that are not been defined are displayed as element addresses. Note that local variables cannot be switched to
symbol addressing.
Besides the frequently used editing functions such as copy and paste, the EMT also provides the functions of Copy
Fill and Sequence Fill. Use these functions when it is necessary to enter in batches the addresses and types of the
connected elements, and display the format.
Sequence Fill
Enter data into the top row in the area to be filled, and then select some rows below. Right click and select Sequence
Fill, the value in the top cell will be used to fill the selected cells in sequence and form a series of continuous data.
This function can only be used in the Element Name column. The interfaces before and after the Sequence Fill are
respectively shown in Figure 8-14 and Figure 8-15.
Figure 8-14 Before sequence fill Figure 8-15 After sequence fill
Copy Fill
Enter data into the top row in the area to be filled, and then select some rows below. Right click and select Copy Fill,
the value at the top cell will be copied to all the selected cells.
This function can only be used in the columns of Element Name, data type and display format. In the process of
filling in the data type and display format columns, if any element address cannot use the data in the first cell, it will
not be changed.
The interfaces before and after Copy Fill are respectively shown in Figure 8-16 and Figure 8-17.
Figure 8-16 Before copy fill Figure 8-17 After copy fill
The EMT can exchange data with Microsoft Excel tables. You can import the data edited by the Excel into the EMT,
as well as export the data in the EMT to a Excel file. The format of the Excel file that can exchange data with the EMT
is shown in Figure 8-18. In the file, the columns A, B, C, D and E represent element name, data type, display format,
current value and new value respectively.
Figure 8-18 Format of Excel file that can exchange data with EMT
76 Appendix 2 List Of Instructions
See section 4.5.3 Importing & Exporting Global Variable Table for the export and import operations.
How to operate
Click Debug -> Online Edit to switch to the online edit status. Before using this function, make sure the software has
set up communication with PLC hardware and the PLC is in running status.
In the online edit status, like in normal editing status, you can modify the main program, subprogram and interrupt
subprogram. After the modification, click PLC -> Download, and the software will compile all the programs in the
project and download them to the PLC hardware. After the download, PLC will run with the newly downloaded
programs.
When exiting the online edit status, in the case of several PLC models, the software will ask if the downloaded
programs need to be saved. If you select Yes, the modification will be stored in the PLC; otherwise, the PLC will
restore the original program.
Limitations
1. In online edit status, you can neither change the global or local variable table of any program, nor add or delete
any subprogram/interrupt subprogram.
2. When the program is in online edit status, if the PLC is stopped, the software will automatically exit the online
modification status.
Appendix 2 List Of Instructions 77
To facilitate easy control of inverters, ControlStar2.0 and its higher versions are embedded with a subprogram
database that can control the inverter. The subprogram database can be called through the so-called inverter
instructions. Such instructions can help you control the inverter operations, such as forward, reverse, stop and
frequency setting.
Note
The inverter instructions of PLC are totally different from the inverter instructions of subprogram database described in this
chapter. The former are PLC embedded instructions, while the latter are just an optional ControlStar tool package. This package
is developed based on the PLC communication instructions (MODBUS, XMT and RCV) and the inverter communication
protocol.
following callings will fail. Take care not to use the rising edge to call any inverter instruction; but in case that has
happened, stop the PLC and run it again.
Note
Different inverter models may use different protocols. Therefore, be careful in selecting the inverter model, because
the data sent by PLC will be different if the instruction and protocol are different. If a needed inverter model is not in
the drop down list, but it uses the same communication protocol as another inverter that is included in the drop down
list, you can use that inverter instead.
First select the station number. If the required station number does not exist in the drop down list, check the inverter
connection table. After entering the station number, the instruction parameters will be displayed as follows:
Appendix 2 List Of Instructions 79
The meanings of the instruction parameters will be introduced in the section 9.5.
Note that the parameters of an inverter instruction may be different or even incompatible with the instruction if the
station number is different. That is because different inverters use different protocols. An inverter instruction has at
least two parameters (to indicate whether the instruction execution is finished and whether the execution is
successful). If the input parameters are not displayed, it may be because the inverter does not support the protocol.
9.5.1 FRQ
Applicable model √EC20
Set inverter frequency
Affected flag bit
Instruction list: FRQ (S1) (S2) (D3) (D4)
Variable
Operator Category Applicable soft element
address
S1 INT Constant Alias
S2 WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z √
D3 BOOL Y M S LM SM
D4 INT KnY KnM KnS KnLM D SD C T V Z √
Operator description
S1: source data, the inverter station number, the Alias or station number correctly defined in the inverter connection
table.
S2: source data, the frequency to be set.
D3: target data, whether the instruction execution is finished or not. ON: yes. OFF: no.
D4: target data, instruction execution result. “0” means “success” and other values mean “failure”.
Function description
Set the frequency of inverter S1 to S2.
Example
80 Appendix 2 List Of Instructions
After setting M0, set the frequency of the inverter with station No. of 1 to D1, and send the complete flag and
execution result to M1 and D2 respectively. After the execution, the handling after success or handling after failure is
done according to the D2 value.
Note
This instruction is only used in Modbus protocol. The transmitting length is 6-byte (D7940 to D7945), and the
receiving length is 8-byte (D7970 to D7977).
9.5.2 FWD
Applicable Model √EC20
Control the inverter to run forward
Affected Flag Bit
When using MODBUS protocol: FWD (S1) (D3) (D4)
When using free port protocol: FWD (S1) (S2) (D3) (D4)
Variable
Operator Category Applicable soft element
address
S1 INT Constant Alias
S2 WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z √
D3 BOOL Y M S LM SM
D4 INT KnY KnM KnS KnLM D SD C T V Z √
Operator Description
S1: source data, the inverter station number, the Alias or station number correctly defined in the inverter connection
table.
S2: source data, the frequency value to be set.
D3: target data, whether the instruction execution is finished or not. ON: yes. OFF: no.
D4: target data, instruction execution result, “0” means “success” and other values mean “failure”.
Function description
With the MODBUS protocol, the PLC controls inverter S1 to run forward. With the free port protocol, the PLC controls
inverter S1 to run forward according to the frequency of S2.
Example
1. MODBUS PROTOCOL
After Setting M0, the PLC controls the inverter with station number of 1 to run forward, and sends the complete flag
and execution result to M1 and D2 respectively. After the execution, take measures corresponding to the success or
failure as determined by the D2 value.
2. Free port protocol
Appendix 2 List Of Instructions 81
After Setting M0, the PLC controls the inverter with station number of 1 to run forward according to frequency D1, and
send the complete flag and execution result to M1 and D2 respectively. After the execution, take measures
corresponding to the success or failure as determined by the D2 value.
Note
Modbus protocol: The transmitting length is 6-byte (D7940 to D7945), and the receiving length is 8-byte (D7970 to
D7977).
Free port protocol: The transmitting length is 18-byte (D7940 to D7957), and the receiving length is 18-byte (D7970 to
D7987).
9.5.3 REV
Applicable model √EC20
Control the inverter to run reverse
Affected flag bit
When using MODBUS protocol: REV (S1) (D3) (D4)
When using free port protocol: REV (S1) (S2) (D3) (D4)
Variable
Operator Category Applicable soft element
address
S1 INT Constant Alias
S2 WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z √
D3 BOOL Y M S LM SM
D4 INT KnY KnM KnS KnLM D SD C T V Z √
Operator description
S1: source data, the inverter station number, the Alias or station number correctly defined in the inverter connection
table.
S2: source data, frequency value to be set.
D3: target data, whether the instruction execution is finished or not. ON: yes. OFF: no.
D4: target data, instruction execution result, “0” means “success” and other values mean “failure”.
Function
With MODBUS protocol, the PLC controls inverter S1 to run reverse. With free port protocol, the PLC controls the
inverter S1 to run reverse according to the frequency of S2.
Example
1. MODBUS protocol
82 Appendix 2 List Of Instructions
After Setting M0, the PLC controls the inverter with station number of 1 to run reverse, and sends the complete flag
and execution result to M1 and D2 respectively. After the execution is finished, take measures corresponding to the
success or failure as determined by the D2 value.
2. Free port protocol
After Setting M0, the PLC controls the inverter with station number of 1 to run reverse according to frequency D1, and
send the complete flag and execution result to M1 and D2 respectively. After the execution, take measures
corresponding to the success or failure as determined by the D2 value.
Note
Modbus protocol: The transmitting length is 6-byte (D7940 to D7945), and the receiving length is 8-byte (D7970 to
D7977).
Free port protocol: The transmitting length is 18-byte (D7940 to D7957), and the receiving length is 18-byte (D7970 to
D7987).
9.5.4 STP
Applicable model √EC20
Control the inverter to stop
Affected flag bit
Operator description
S1: source data, the inverter station number, the Alias or station number correctly defined in the inverter connection
table.
S2: source data, stop mode. 0: decelerate to stop; 1: coast to stop; 2: emergency stop.
D3: target data, whether the instruction execution is finished or not. ON: yes. OFF: no.
D4: target data, instruction execution result. 0: success. Other values: failure.
Function description
Control the inverter S1 to stop through the specified mode.
Example
1. MODBUS protocol
Appendix 2 List Of Instructions 83
After Setting M0, the PLC controls the inverter with station number of 1 to stop through D1 mode, and sends the
complete flag and execution result to M1 and D2 respectively. After the execution, take measures corresponding to
the success or failure as determined by the D2 value.
2. Free port protocol
After Setting M0, the PLC controls the inverter with station number of 1 to stop through D1 mode, and sends the
complete flag and execution result to M1 and D2 respectively. After the execution, take measures corresponding to
the success or failure as determined by the D2 value.
Note
Modbus protocol: The transmitting length is 6-byte (D7940 to D7945), and the receiving length is 8-byte (D7970 to
D7977).
Free port protocol: The transmitting length is 14-byte (D7940 to D7953), and the receiving length is 14-byte (D7970 to
D7983).
9.5.5 GET
Applicable model √EC20
Read the inverter parameters
Affected flag bit
Instruction list: GET (S1) (S2) (D3) (D4) (D5)
Variable
Operator Category Applicable soft element
address
S1 INT Constant Alias
S2 INT Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z √
D3 BOOL Y M S LM SM
D4 INT KnY KnM KnS KnLM D SD C T V Z √
D5 WORD KnY KnM KnS KnLM D SD C T V Z √
Operator description
S1: source data, the inverter station number, the Alias or station number correctly defined in the inverter connection
table.
S2: source data, the read parameter category. 1: running frequency; 2: output current; 3: running speed; 4: output
power.
D3: target data, whether the instruction execution is finished or not. ON: yes. OFF: no.
D4: target data, instruction execution result. 0: success. Other values: failure.
84 Appendix 2 List Of Instructions
Function description
Read the values of S2 category parameters of inverter S1, and store the result in D5. The software cannot read the
output power of EV1000 and EV2000 inverters in free port protocol.
Example
1. MODBUS protocol
After Setting M0, the PLC reads the value of D1 category parameter of the inverter with station number of 1, stores
the result in D3, and sends the complete flag and execution result to M1 and D2 respectively. After the execution,
take measures corresponding to the success or failure as determined by the D2 value.
2. Free port protocol
After Setting M0, the PLC reads the value of D1 category parameter of the inverter with station number of 1, stores
the result in D3, and sends the complete flag and execution result to M1 and D2 respectively. After the execution,
take measures corresponding to the success or failure as determined by the D2 value.
Note
Modbus protocol: The transmitting length is 6-byte (D7940 to D7945), and the receiving length is 8-byte (D7970 to
D7977).
Free port protocol: The transmitting length is 14-byte (D7940 to D7953), and the receiving length is 18-byte (D7970 to
D7987).
9.5.6 RD
Applicable model √EC20
Read the register value of the inverter
Affected flag bit
Instruction list: RD (S1) (S2) (D3) (D4) (D5)
Variable
Operator Category Applicable soft element
address
S1 INT Constant Alias
S2 WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z √
D3 BOOL Y M S LM SM
D4 INT KnY KnM KnS KnLM D SD C T V Z √
D5 WORD KnY KnM KnS KnLM D SD C T V Z √
Appendix 2 List Of Instructions 85
Operator description
S1: source data, the inverter station number, the Alias or station number correctly defined in the inverter connection
table.
S2: source data, the read register address.
D3: target data, whether the instruction execution is finished or not. ON: yes. OFF: no.
D4: target data, instruction execution result. 0: success. Other values: failure.
D5: target data, the read result.
Function description
Read the values of register S2 of inverter S1, and store the result in D5.
Example
After Setting M0, the PLC reads the D10 register value of the inverter with station number of 1, stores the result in
D11, and sends the complete flag and execution result to M1 and D2 respectively. After the execution, take measures
corresponding to the success or failure as determined by the D2 value.
Note
This instruction is only used in Modbus protocol. The transmitting length is 6-byte (D7940 to D7945), and the
receiving length is 7-byte (D7970 to D7976).
9.5.7 WRT
Applicable model √EC20
Write in the register of the inverter
Affected flag bit
Instruction List: RD (S1) (S2) (D3) (D4) (D5)
Variable
Operator Category Applicable soft element
address
S1 INT Constant Alias
S2 WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z √
S3 WORD Constant KnX KnY KnM KnS KnLM KnSM D SD C T V Z √
D4 BOOL Y M S LM SM
D5 INT KnY KnM KnS KnLM D SD C T V Z √
Operator Description
S1: source data, the inverter station number, the Alias or station number correctly defined in the inverter connection
table.
S2: source data, the register address to be written.
S3: source data, the written value.
D4: target data, whether the instruction execution is finished or not. ON: yes. OFF: no.
D5: target data, instruction execution result. 0: success. Other values: failure.
Function description
Write in S3 as the value of register S2 of inverter S1.
86 Appendix 2 List Of Instructions
Example
After Setting M0, the PLC writes the D10 register value of the inverter with station number of 1 as D11, and sends the
complete flag and execution result to M1 and D2 respectively. After the execution, take measures corresponding to
the success or failure as determined by the D2 value.
Note
This instruction is only used in Modbus protocol. The transmitting length is 9-byte (D7940 to D7948), and the
receiving length is 8-byte (D7970 to D7977).
Appendix 2 List Of Instructions 87
MOV 6 Z1
SFTR X0Z1 M0 8 2
The above instructions are equivalent to:
Ladder M1
SFTR X6 M0 8 2
The addressing process is as follows:
Z1=6
X0Z1 = X (0+ Z1) = X6
An example for bit string variable addressing:
Ladder M1
MOV 3 Z10
MOV K1X0Z10 D0
The above instructions are equivalent to:
Ladder M1
MOV K1X3 D0
The addressing process is as follows:
Z10=3
K1X0Z10 = K1X (0+Z10)= K1X3
An example for word element variable addressing:
Ladder M1
MOV 30 Z20
MOV D100Z20 D0
The above instructions are equivalent to:
Ladder M1
MOV D130 D0
The addressing process is as follows:
Z20=30
D100Z20 = D (100+ Z20)= D130
Appendix 2 List Of Instructions 89
This section lists all the instructions. Refer to EC20/EC10 Series PLC Programming Manual for detailed description of
the instructions.
Type Instruct. Function
LD NO contact power-flow loading
LDI NC contact power-flow loading
AND NO contact power-flow AND
ANI NC contact power-flow AND
OR NO contact power-flow OR
ORI NC contact power-flow OR
OUT Power-flow output
SET Set
RST Reset
ANB Power-flow block AND
ORB Power-flow block OR
INV Power-flow block inverse
Basic instruction NOP No operation
MPS Output power-flow input stack
MRD Read output power-flow stack top value
MPP Output power-flow stack pop off
EU Power-flow rising edge detection
ED Power-flow trailing edge detection
TON On-delay timing
TOF Off-delay timing
TMON Monostable timing
TONR On-delay remember timing
CTU 16bit counter counting up
CTR 16bit counter loop cycle counting
DCNT 32bit counting
LBL Jump label definition
CJ Conditional jump
CALL Calling a subprogram
CSRET Conditional return from user subprogram
CFEND Conditional end from user main program
CIRET Conditional return from user interrupt subprogram
FOR Cycle instruction
Program control instruction
NEXT Return from cycle
MC Main control
MCR Main control remove
WDT User program watchdog reset
STOP User program stop
EI Enable interrupt
DI Disable interrupt
STL SFC state load
SET Sxx SFC state shift
SFC instruction OUT Sxx SFC state jump
RST Sxx SFC state reset
RET SFC program end
90 Appendix 2 List Of Instructions