0% found this document useful (0 votes)
12 views22 pages

How To Create A Template - bcnp59990029b

Uploaded by

Chau
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views22 pages

How To Create A Template - bcnp59990029b

Uploaded by

Chau
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

How to create a template

This manual describes how to create a template.

A template contains the following four data.


・ A project contains function blocks and labels created with GX Works2 or GX Works3
・ Symbols created with GraphWorX64
・ Faceplates created with GraphWorX64
・ Trend and alarm settings set with MC AppBuilder

1. GX Works2 Project
Refer to Chapter2 “GX Works3 Project” if you make a PLC project with GX Works3.
1.1. Prerequisites
A project is created as a Structured project in the single file format.

The following items are the edit targets of the project.


・ Global label
・ Local label
・ Task
・ Program
・ Function Block/Function
Since other items such as PLC parameter are not used in a template, they are ignored when a
template is registered.

<Name conversion with MC AppBuilder’s SCADA generation>


MC AppBuilder has the function to convert the name in the SCADA generation. Because each
equipment must have unique name when a template is assigned to multiple equipments, and
program and label list should be generated for each unit.
MC AppBuilder converts the string “EEE” and “UUU” in global label name, local label name,
program name, task name, and global label list name as shown below.

Before After
EEE Equipment name
UUU Unit name

How to create a template


1/22
1.2. How to create a project
A project is created in the following procedure.
1. Define labels.
2. Create a function block.
3. Place the function block to the program.
4. Register the task.

1.2.1. Defining labels


Labels to connect to the input/output pins of the function block are defined.
In order to use the labels for each equipment, each label name should include “EEE”. In order to use
the labels for each unit, each label name should include “UUU”. The label names which do not
include “EEE” or “UUU”, they become common labels for templates.

MC AppBuilder handles the labels of GX Works2 project in the following rule.

1.2.1.1. Label types in MC AppBuilder


Inputs and outputs of function block defined as label are classified into the following four types.
Label type Description
I/O Access Interface A label that assigns fixed address to connect the equipment

Example: control signal to the equipment, feedback signal from the


equipment
Monitoring Interface A label registered as a tag to the OPC server to communicate with
SCADA
It is register to the OPC Server with a system label Ver.1.
When structured data is Monitoring Interface, the maximum number of
members is 36. If more members are required, the structured data
should be divided into multiple structures.

Example: displayed value on the screen, setpoint value on the screen


Equipment Parameter A label with a fixed value for each instance of function block

Example: initial value for function block, setting value for function block
Program Interface Other labels used in a user program after the SCADA generation

Example: auto command from user program, feedback of equipment


condition to user program

How to create a template


2/22
1.2.1.2. Label types of GX Works2 project
・Global label
I/O Access Interface, Monitoring Interface, Program Interface, and instance of function block are
defined as global label.

・Local label
Equipment Parameter is defined as local label.

1.2.1.3. The format of the label information for MC AppBuilder in the label editor of GX Works2
The label information for MC AppBuilder is written in the remark of global label or the comment of
local label according to the following format.
These settings are used by MC AppBuilder when registering the template. They can be edited with
MC AppBuilder after the registration of template.

Keywor Value Global Label Local Label Description


d Variable Constant Variable Constant
type Either Monitoring Interface or Equipment
Parameter can be specified for the label.
M x This value indicates Monitoring Interface.
A child element also becomes Monitoring
Interface when it is specified as a
structured label.
IO x This value indicates I/O Access Interface.
This is ignored when it is specified as a
structured label or array label.
In order to set this as I/O Access Interface
for child elements, use the subType key
string.
M, IO x These values indicate both Monitoring
IO, M x Interface and I/O Access Interface. A child
element also becomes Monitoring Interface
when it is specified as a structured label,

How to create a template


3/22
and the setting of I/O Access Interface is
ignored.
The setting of I/O Access Interface is
ignored when it is specified as an array
label.
param x x This value indicates Equipment
Parameter.
subType This format specifies whether the child
element of specified structured label is I/O
Access Interface.
This is ignored when it is not specified as a
child element of structured label.
IO x This value indicates I/O Access Interface.
attr This format specifies the attribute (Read,
Write, Read/Write) for the label.
If the label is a structured label, the
attribute for child element can be specified
by separating the element with comma. If
it is not specified, its attribute becomes
Read in the default.
R x This value indicates Read.
W x This value indicates Write.
RW x This value indicates Read/Write.
name Any x x x This format defines the specified label
characters name as a property name. The property
name is used in symbols and faceplates.
ex Any x This format is used to write comments
characters when the area to write comments is not
available for a local label.

If type is not specified, it is treated as Program Interface.

Examples
(1) Defining the type as IO Access Interface, and the property name as RUNFB.
type=IO;name=RUNFB

(2) Defining the type as Monitoring Interface, and the property name as SDT_EqMotor for label
of structured data with 19 members. attr should be set in the order of the defined members.
type=M;attr=R,RW,RW,R,RW,RW,R,R,RW,RW,R,R,R,R,R,R,R,R,RW;name=SDT_EqMotor

(3) Defining the type as Equipment Parameter, and the property name as ENABLE_INTLK.
type=param;name=ENABLE_INTLK

How to create a template


4/22
1.2.2. Creating a function block
Create a function block with the logic to control the equipment.
Define the function block’s input and output pins paired to labels, and create control logic of
function block in structured ladder.

When setting an initial value to Monitoring Interface or the internal parameter of function block,
the initialization logic should be implemented on the function block.

Example of initialization program:


In the first part of function block, the logic to initialize the parameters is implemented.
The initialization is executed by the initialization request (i_Init). The initialized flag (io_InitFlag)
is used to execute the initialization only once.
When “When writing to PLC after a Rebuild All operation, clear the device ranges set in the
Device/Label Automatic–Assign setting to 0.” is selected in the option setting of GX Works2, it is
executed only once after the program is written to the programmable controller.

The latch information should be stored in the function block by using VAR_RETAIN in local label.
In the Mitsubishi template, values are copied from latched device in the first scan, and they are
written to the latched device in the end of every scan.
Example of latch program:

How to create a template


5/22
How to create a template
6/22
1.2.3. Placing a function block to a program
Place the function block in the program and connect the labels defined in the section 1.2.1 to the
input/output pins of the function block.
In order to improve the readability, using a fixed name begins with “UUU” for the program name
and placing the function block within a unit are recommended.
Mitsubishi template uses the program name “UUU_MainPrg” as shown below.

1.2.4. Registering a task


Register the program to a task.
In order to improve the readability, using a fixed name begins with “UUU” for the task name and
registering the program within a unit are recommended.
Mitsubishi template registers the program to the task “UUU_MainTask” as shown below.
The execution of this task is controlled by “UUU_Event”.

How to create a template


7/22
1.3. Caution
Define unique names for functions and function blocks with different logic among templates. When
structures, functions, and function blocks with the same name exist among templates, only one
template’s structure, function, and function block are output to the project in the SCADA
generation.
When creating the structure with the same members, or the function or function block with the
same logic among templates, only one structure, function, or function block can be output to the
project in the SCADA generation by setting the same name.

Do not use labels with “EEE” or “UUU” in a function block. When they are used in a function block,
the SCADA generation process does not work correctly.

When a user applies online program change to a user’s template, there are restrictions to use rise,
fall, and SCJ instructions.
Refer to the section 15.9.4 “Considerations for Online program change of rise, fall, or SCJ
instruction” in “GX Works2 Version 1 Operating Manual (Common)” for detailed information.

How to create a template


8/22
2. GX Works3 Project
Refer to Chapter1 “GX Works2 Project” if you make a PLC project with GX Works2.
2.1. Prerequisites
Programming language is FBD/LD in main program.

The following items are the edit targets of the project.


・ Global label
・ Local label
・ Program
・ FB/FUN
Since other items such as PLC parameter are not used in a template, they are ignored when a
template is registered.

<Name conversion with MC AppBuilder’s SCADA generation>


MC AppBuilder has the function to convert the name in the SCADA generation. Because each
equipment must have unique name when a template is assigned to multiple equipments, and
program and label list should be generated for each unit.
MC AppBuilder converts the string “EEE” and “UUU” in global label name, local label name,
program name, and global label list name as shown below.

Before After
EEE Equipment name
UUU Unit name

2.2. How to create a project


A project is created in the following procedure.
1. Define labels.
2. Create a function block.
3. Place the function block to the program.

2.2.1. Defining labels


Labels to connect to the input/output pins of the function block are defined.
In order to use the labels for each equipment, each label name should include “EEE”. In order to use
the labels for each unit, each label name should include “UUU”. The label names which do not
include “EEE” or “UUU”, they become common labels for templates.

MC AppBuilder handles the labels of GX Works3 project in the following rule.

How to create a template


9/22
2.2.1.1. Label types in MC AppBuilder
Inputs and outputs of function block defined as label are classified into the following four types.
Label type Description
I/O Access Interface A label that assigns fixed address to connect the equipment

Example: control signal to the equipment, feedback signal from the


equipment
Monitoring Interface A label registered as a tag to the OPC server to communicate with
SCADA
It is register to the OPC Server with a system label Ver.1.
When structured data is Monitoring Interface, the maximum number of
members is 36. If more members are required, the structured data
should be divided into multiple structures.

Example: displayed value on the screen, setpoint value on the screen


Equipment Parameter A label with a fixed value for each instance of function block

Example: initial value for function block, setting value for function block
Program Interface Other labels used in a user program after the SCADA generation

Example: auto command from user program, feedback of equipment


condition to user program

2.2.1.2. Label types of GX Works3 project


・Global label
I/O Access Interface, Monitoring Interface, Program Interface, and instance of function block are
defined as global label.

・Local label
Equipment Parameter is defined as local label.

How to create a template


10/22
2.2.1.3. The format of the label information for MC AppBuilder in the label editor of GX Works3
The label information for MC AppBuilder is written in the comment5 of global label or the
comment5 of local label. The commnet5 can be displayed in the label editor by the following way.

Press the button

Press the button

After checked, press the button

These settings are used by MC AppBuilder when registering the template. They can be edited with
MC AppBuilder after the registration of template.
The label information is according to the following format.

Keywor Value Global Label Local Label Description


d Variable Constant Variable Constant
type Either Monitoring Interface or Equipment
Parameter can be specified for the label.
M x This value indicates Monitoring Interface.
A child element also becomes Monitoring
Interface when it is specified as a
structured label.
IO x This value indicates I/O Access Interface.
This is ignored when it is specified as a
structured label or array label.
In order to set this as I/O Access Interface
for child elements, use the subType key
string.
M, IO x These values indicate both Monitoring
IO, M x Interface and I/O Access Interface. A child
element also becomes Monitoring Interface
when it is specified as a structured label,
and the setting of I/O Access Interface is
ignored.
The setting of I/O Access Interface is
ignored when it is specified as an array
label.
param x x This value indicates Equipment
Parameter.
subType This format specifies whether the child
element of specified structured label is I/O
How to create a template
11/22
Access Interface.
This is ignored when it is not specified as a
child element of structured label.
IO x This value indicates I/O Access Interface.
attr This format specifies the attribute (Read,
Write, Read/Write) for the label.
If the label is a structured label, the
attribute for child element can be specified
by separating the element with comma. If
it is not specified, its attribute becomes
Read in the default.
R x This value indicates Read.
W x This value indicates Write.
RW x This value indicates Read/Write.
name Any x x x This format defines the specified label
characters name as a property name. The property
name is used in symbols and faceplates.

If type is not specified, it is treated as Program Interface.

Examples
(1) Defining the type as IO Access Interface, and the property name as RUNFB.
type=IO;name=RUNFB

(2) Defining the type as Monitoring Interface, and the property name as SDT_EqMotor for label
of structured data with 19 members. attr should be set in the order of the defined members.
type=M;attr=R,RW,RW,R,RW,RW,R,R,RW,RW,R,R,R,R,R,R,R,R,RW;name=SDT_EqMotor

(3) Defining the type as Equipment Parameter, and the property name as ENABLE_INTLK.
type=param;name=ENABLE_INTLK

2.2.2. Creating a function block


Create a function block with the logic to control the equipment.
Define the function block’s input and output pins paired to labels, and create control logic of
function block in structured ladder.

When setting an initial value to Monitoring Interface or the internal parameter of function block,
the initialization logic should be implemented on the function block.

Example of initialization program:


In the first part of function block, the logic to initialize the parameters is implemented.
The initialization is executed by the initialization request (i_Init). The initialized flag (int_InitFlag)
is used to execute the initialization only once.

How to create a template


12/22
If data is stored for latch information, you should set VAR_GLOBAL_RETAIN and VAR_RETAIN in
class.

2.2.3. Placing a function block to a program


Place the function block in the program and connect the labels defined in the section 2.2.1 to the
input/output pins of the function block.
In order to improve the readability, using a fixed name begins with “UUU” for the program name
and placing the function block within a unit are recommended.
Mitsubishi template uses the program name “UUU_MainPrg” as shown below.

How to create a template


13/22
2.3. Caution
Define unique names for functions and function blocks with different logic among templates. When
structures, functions, and function blocks with the same name exist among templates, only one
template’s structure, function, and function block are output to the project in the SCADA
generation.
When creating the structure with the same members, or the function or function block with the
same logic among templates, only one structure, function, or function block can be output to the
project in the SCADA generation by setting the same name.

Do not use labels with “EEE” or “UUU” in a function block. When they are used in a function block,
the SCADA generation process does not work correctly.

When a user applies online program change to a user’s template, there are restrictions to use rise,
fall, and SCJ instructions.
Refer to the section 13.3 “Writing Programs While CPU is in RUN” in “GX Works3 Operating
Manual” for detailed information.

How to create a template


14/22
3. Symbol and Faceplate
Symbol example

Faceplate example

3.1. Arranging screen layout with screen parts


Arrange buttons, text boxes, and graphic objects on the GraphWorX64 screen.

3.2. Setting data source


Assign a screen control (Text, Action, etc.) to arranged screen parts. Set the data source to control
the screen. By writing data source as formats shown in the table below, the data source is converted
according to the MC AppBuilder’s rule in the SCADA generation.

How to create a template


15/22
The rule of data source format conversion
Data source format Target Description
<??Name()?> Symbol, Faceplate Symbol: equipment name
Faceplate: alias of equipment name
<??AcPath(Tag name)?> Symbol The path on AssetWorX
<??Path(Tag name)?> Faceplate The alias of the path on AssetWorX
Tag name is the property name specified at “name” of Monitoring Interface. In the case of
structured data type, “/” and member name are suffixed to the property name.

Writing example
(1) Displaying the equipment name
<??Name()?>

(2) Displaying the state of the equipment on the symbol


<??AcPath(SDT_EqMotor/RunStatus)?>

(3) Switching the strings between “REMOTE” and “LOCAL” on the faceplate
x=IF {{<??Path(SDT_EqMotor/Remote)?>}} THEN "REMOTE" ELSE "LOCAL"

How to create a template


16/22
4. Template Registration
This section describes how to register a template on MC AppBuilder.

1. Select “Add Template” from the target folder to register the template on the “Templates” tree.

2. Enter the name of the template to register.

3. Press the “Import” button on the “General” tab to register the GX Works2/GX Works3 project.

How to create a template


17/22
4. If necessary, update the setting on the “Properties” and “Parameters” tab. Then press the “OK”
button.

5. Press the “Add” button on the “Symbols” tab to register the symbol. Multiple symbols can be
registered to a single template.

How to create a template


18/22
6. Press the “Add Faceplate” button on the “Displays” tab to register the faceplate. Multiple
faceplates can be registered to a single template.

7. Press the “Apply” button to save the settings.

8. Press the “General” tab, and set the description, the equipment type, the default symbol, the
default faceplate information, the version, and the author.

How to create a template


19/22
9. If necessary, set the Alarm and/or Trend information to property of Monitoring Interface. Refer
to the help file of AlarmWorX64 and TrendWorX64 for detailed information.

10. Press the “Apply” button to save the setting.

How to create a template


20/22
5. Other

5.1. How to edit a registered template

5.1.1. How to edit a registered GX Works2/GX Works3 project


Press the “Export” button to save the GX Works2/GX Works3 project. Press the "Import" button to
register the saved project again after editing.

5.1.2. How to edit a registered symbol


Press the “Extract Symbol” button to save the symbol file. Edit the saved symbol file, and press the
“Add” button to register as a new symbol or the “Replace” button to replace the existing symbol.

How to create a template


21/22
5.1.3. How to edit registered faceplate
Press the “Extract Display” button to save the faceplate file. Edit the saved faceplate, and press the
“Add Faceplate” button to register as a new faceplate or the “Replace” button to replace the existing
faceplate.

5.2. How to reuse created template


When registered templates are used on another MC AppBuilder database, use the MC AppBuilder’s
export/import function to copy the template data under the “Templates” tree.

How to create a template


22/22

You might also like