Multiprog Programming Manual 1.0
Multiprog Programming Manual 1.0
MULTIPROG
Programming Manual
Version: V1.0 2011N24
1
TPM EasyPAC User Manual
Revision History
Date Revision Description
2011/5/5 1.0 Document Creation
2
TPM EasyPAC User Manual
The product, including the product itself, the accessories, the software, the manual and the software
description in it, without the permission of TPM Inc. (TPM), is not allowed to be reproduced, transmitted,
transcribed, stored in a retrieval system, or translated into any language in any form or by any means, except
the documentation kept by the purchaser for backup purposes.
The names of products and corporations appearing in this manual may or may not be registered trademarks,
and may or may not have copyrights of their respective companies. These names should be used only for
identification or explanation, and to the owners benefit, should not be infringed without any intention.
The products name and version number are both printed on the product itself. Released manual visions for
each product design are represented by the digit before and after the period of the manual vision number.
Manual updates are represented by the third digit in the manual vision number.
Trademark
MS-DOS and Windows 95/98/NT/2000/XP, Visual Studio, Visual C++, Visual BASIC are registered
trademarks of Microsoft.
BCB (Borland C++ Builder) is registered trademark of Borland.
MULTIPROG is registered trademark of KW software.
Other product names mentioned herein are used for identification purposes only and may be trademarks
and/or registered trademarks of their respective companies.
3
TPM EasyPAC User Manual
Electrical safely
To prevent electrical shock hazard, disconnect the power cable from the electrical outlet before relocating
the system.
When adding or removing devices to or from the system, ensure that the power cables for the devices are
unplugged before the signal cables are connected. Disconnect all power cables from the existing system
before you add a device.
Before connecting or removing signal cables from motherboard, ensure that all power cables are
unplugged.
Seek professional assistance before using an adapter or extension card. These devices could interrupt the
grounding circuit.
Make sure that your power supply is set to the voltage available in your area.
If the power supply is broken, contact a qualified service technician or your retailer.
Operational safely
Please carefully read all the manuals that came with the package, before installing the new device.
Before use ensure all cables are correctly connected and the power cables are not damaged. If you detect
and damage, contact the dealer immediately.
To avoid short circuits, keep paper clips, screws, and staples away from connectors, slots, sockets and
circuitry.
Avoid dust, humidity, and temperature extremes. Do not place the product in any area where it may
become wet.
If you encounter technical problems with the product, contact a qualified service technician or the dealer.
4
TPM EasyPAC User Manual
Contents
CONTENTS .................................................................................................................................................................................. 5
2. MULTIPROG INTRODUCTIONS............................................................................................................................................... 41
6
TPM EasyPAC User Manual
1. Software Utilities
A software utility is developed to help users easily make use of data type conversion for MULTIPROG,
MyDataCheck.
1.1. MyDataCheck
Software Installation
1 executable file: MyDataCheck.exe
Ring_0 of EasyPAC supports up to 48 DIO modules and 16 (IP48~IP63) AIO or PIO modules.
INPUT/OUTPUT is explained in the following:
8
TPM EasyPAC User Manual
Local DI 1
Non Retain
INPUT (%I) Motionnet DI 449 192
0 ~ 448
Motionnet AI 256
Local DO 1
Non Retain
OUTPUT (%Q) Motionnet DO 449 192
0 ~ 448
Motionnet AO 256
MB (Coil) 1024
MB (Holding Register) 1024
MB (Discrete Input) 1024
Non Retain MB (Input Register) 1024
48000
0 ~ 47999 User Define 35904
VARCONF (%M) Motion (Single) 5000
Motion (Multiple) 1000
Gateway 2000
Retain
User Define 13312 13312
10000000 ~ 10013311
Local 8DI/8DO is mapped to port 0 and can be accessed by %IB 0 (%IX 0.0 ~ %IX 0.7) and %QB 0 (%QX
0.0~%QX 0.7).
Each Motionnet DIO slave module has 4 ports (0~3) and each port is 8-bit.
%ID: Double Word Input. This is used to get counter value by channel.
The maximum channel number of Motionnet counter module is 4 (0~3).
9
TPM EasyPAC User Manual
VARCONF
Virtual variable (%M)
%MX: used for BOOL type
%MB: used for BYTE type
%MW: used for WORD type
%MD: used for DWORD type
Retain Memory is ranged from %MB 3.10000000 to %MB 3.10013311 (i.e. 13312 Bytes).
10
TPM EasyPAC User Manual
To support connection with HMI by Modbus the following memory design is implemented
Modbus Memory
Modbus Memory is grouped into the following 4 sections:
Coil: Output Tag (Bit)
Real I/O: ranged from 0 to 1543 (BOOL)
Virtual: ranged from 1544 to 9735 (BOOL)
Holding Register: Output Data (Word)
Real I/O: ranged from0 to 127 (WORD)
Virtual: ranged from 128 to 639 (WORD)
Discrete Input: Input Tag (Bit)
Real I/O: ranged from 0 to 1543 (BOOL)
Virtual: ranged from 1544 to 9735 (BOOL)
Input Register: Input Data (Word)
Real I/O: ranged from 0 to 127 (WORD)
Virtual: ranged from 128 to 639 (WORD)
11
TPM EasyPAC User Manual
12
TPM EasyPAC User Manual
Ring_0 DI/O
DI MODBUS DO MODBUS
Discrete Input Coil
IP
%I Begin End %Q Begin End
DEC HEX DEC HEX DEC HEX DEC HEX
L %IB 0 0 0 7 7 %QB 0 0 0 7 7
%IB 1 8 8 15 F %QB 1 8 8 15 F
%IB 2 16 10 23 17 %QB 2 16 10 23 17
0
%IB 3 24 18 31 1F %QB 3 24 18 31 1F
%IB 4 32 20 39 27 %QB 4 32 20 39 27
14
TPM EasyPAC User Manual
IP: 48 Available IP for AIO/PIO is ranged from 48 to 63 and the total number is 16.
The following data types are available with the same slave IP: 8 Channel AI (%IW 193 ~ 207), 8 Ch. AO
(%QB 193 ~ 207) and 4 Channel PI Counter (%ID 193 ~ 205).
The data type of AIO is WORD (Hex 0x0000~0xFFFF). The engineering unit can be calculated. When the
gain of Ch.0 of AI is 10V, %IW 193 = 0x0000 (-10V) ~ 0xFFFF (+10V)
The data type of PIO counter module is DWORD (Hex 0x00000000~0xFFFFFFFF).
In the case of 108-P120, different modes can be set as described in the following:
1. Counter: Count the no. of pulses.
2. Frequency: Measure the frequency of the input pulse (Time is 0.1s~100s).
For example, When Time is set to 1s and gets 1000 pulse from IN0, %ID 193 = 0x000003E8. The freq. is
1 KHz.
3. Period: Measure the period of the incoming pulse in the unit of ns.
For example, when the input pulse is with 2ms width in IN0, %ID 193 = 0x001E8480, period is
2000000ns. The freq. is 500 Hz.
4. GT: Measure the ON/Off Time in the Gate, sampling period is 0.1ms.
For example, the signal in the gate is 2 seconds, 2000ms/0.1ms= 20000, %ID 193 = 0x00004E20.
5. GC: Only 2 channels are available in this mode:
Channel 0 Channel 1
IN0: Count0 IN2: Count1
IN1: Gate0 IN3: Gate1
IN1 and IN3: Measure the Gate input time
IN0 and IN2: Measure the pulse input Count
15
TPM EasyPAC User Manual
Ring_1 Axis
AXES MODBUS
Input Registers
IP
Begin End
DEC HEX DEC HEX
AXIS_01.1 Command 640 280 641 281
AXIS_01.2 Position 642 282 643 283
1 AXIS_01.3 current velocity 644 284 645 285
AXIS_01.4 io_status 646 286 647 287
AXIS_01.5 motion done 648 288 648 288
IP: 1 The available IP for Axis module is 1 ~32 (Total no. is 32).
IP1 is for Axis_01
AXIS_01.1 command: DWORD
Command Position: 0x00000000~0xFFFFFFFF (Pulse).
AXIS_01.2 position: DWORD
Current Position: 0x00000000~0xFFFFFFFF (Pulse).
AXIS_01.3 current velocity: DWORD
Current velocity: 0x00000000~0xFFFFFFFF (PPS).
AXIS_01.4 io_status: DWORD
I/O status of the axis: 1 is ON, 0 is OFF, Bit16 ~ Bit31 is reserved.
Bit0 (RDY): RDY pin input
Bit1 (ALM): Alarm Signal
Bit2 (+EL): Positive Limit Switch
Bit3 (-EL): Negative Limit Switch
Bit4 (ORG): Origin Switch
Bit5 (DIR): DIR output
Bit6 (EMG): Emergency signal input
Bit7 (PCS): PCS signal input
Bit8 (ERC): ERC pin output
Bit9 (EZ): Index signal
Bit10 (CLR): Clear Counter Input
Bit11 (Latch): Latch signal input
Bit12 (SD): Slow Down signal input
Bit13 (INP): In-Position signal input
Bit14 (SVON): Servo-ON output status
Bit15 (RALM): Alarm Reset output status
16
TPM EasyPAC User Manual
Virtual Data
Digital output:
MODBUS
%M
Coil
%M
Begin End
Begin End
DEC HEX DEC HEX
B 3. X 3.
0 0 0 0 7 1544 608 1551 60F
17
TPM EasyPAC User Manual
Digital input:
MODBUS
%M
Discrete Input
%M
Begin End
Begin End
DEC HEX DEC HEX
B 3. X 3.
2048 2048 0 2048 7 1544 608 1551 60F
Register:
MODBUS MODBUS
Holding Input
%M %M
Registers Registers
DEC HEX DEC HEX
W 3. W 3.
1024 128 80 3072 128 80
18
TPM EasyPAC User Manual
19
TPM EasyPAC User Manual
20
TPM EasyPAC User Manual
21
TPM EasyPAC User Manual
22
TPM EasyPAC User Manual
23
TPM EasyPAC User Manual
24
TPM EasyPAC User Manual
25
TPM EasyPAC User Manual
26
TPM EasyPAC User Manual
27
TPM EasyPAC User Manual
28
TPM EasyPAC User Manual
29
TPM EasyPAC User Manual
30
TPM EasyPAC User Manual
31
TPM EasyPAC User Manual
32
TPM EasyPAC User Manual
33
TPM EasyPAC User Manual
34
TPM EasyPAC User Manual
35
TPM EasyPAC User Manual
36
TPM EasyPAC User Manual
37
TPM EasyPAC User Manual
38
TPM EasyPAC User Manual
39
TPM EasyPAC User Manual
40
TPM EasyPAC User Manual
2. MULTIPROG Introductions
MULTIPROG is an IEC-61131 Programming System developed by KW and MULTIPROG Express
5.35 is a compact version to be used with EasyPAC. The main features of MP Express 5.35 are
No. of IO per project 128 KB
No. of User Task 5
No. of POUs 256
Global Variables 5000
Local Variables per POU 1500
Languages Support 5
Example
%IX1.7 The 7th bit in 1st Byte at input data, must be BOOL type
%IB100 The 100th Byte at input data, must be SINT / USINT / BYTE type
%QW201 The 201th, 202th Bytes at output data, must be INT / UINT / WORD type
%QL100 The 100th to 107th Bytes at output data, must be LREAL type
%MD3.1024 The 1024th to 1027th Bytes at virtual memory
Must be DINT / UDINT / REAL / TIME / DWORD type
41
TPM EasyPAC User Manual
Software Installation
Install EasyPAC software and tools
Install MULTIPROG 5.35.252 Express
Install MULTIPROG Patch Files
Software Version
Run the successfully installed MULTIPROG 5.35 Express as shown below
If the software version is not 5.35 Build 252, please install the correct version.
42
TPM EasyPAC User Manual
There is a CD that is shipped together with the EasyPAC. Please follow these steps below to finish the
installation. Insert the CD into your PC and you will be asked to permit auto-installation. Please enter YES to
allow auto-installation as shown.
If the auto-installation does not work, please try it manually. Please go to Program Manager and run the
Auto.exe in the CD to start installation manually. Users could click on Install Products as shown below to
setup EasyPAC.
43
TPM EasyPAC User Manual
Press option Install EasyPAC Software and Tools to start setup EasyPAC related software and utilities.
44
TPM EasyPAC User Manual
The installation procedure leads to install the relative libraries of MULTIPROG 5.35.252 Express and
software development kit for KW applications. The default location for the installation is C:\Program
45
TPM EasyPAC User Manual
Files\KW-Software. If the operating system is Windows 7 64bit, the location would be C:\Program Files
(86)\KW-Software. Please do not modify the default location in case of patch failure hereafter. The
installation procedure installs the following software in sequence.
MICROSOFT Visual C++ 2005 runtime libraries
MICROSOFT Visual C++ 2008 runtime libraries
MULTIPROG 5.35.252 Express Build 252
MULTIPROG ProConOS AddOn
The first step of the installation is a prompt of installation of MICROSOFT Visual C++ 2005/2008 runtime
libraries. Please select Install to start the installation.
The setup wizard will lead users to complete the rest of the installation.
46
TPM EasyPAC User Manual
Please leave the installation path as the default one and press Next to continue.
Then the wizard would lead to install MULTIPROG ProConOS AddOn automatically.
After finishing this step, all the KW development environment setup is completed.
48
TPM EasyPAC User Manual
When the completion screen is shown means the patch file is successfully installed in the system. Please
take out the CD and keep it properly.
49
TPM EasyPAC User Manual
2.1.4. Uninstall
All the software installed could be easily removed by selecting Uninstall all for Win32 (Uninstall all for
Win64) button. The uninstall shield will lead you to remove EasyPAC related software as following figures.
50
TPM EasyPAC User Manual
51
TPM EasyPAC User Manual
2.2.2. DI Test
Set V000 ~ V003 as shown below:
V000 I/O address %IB 1 (IP0: DI port1 input)
V001 I/O address Blank
V002 I/O address %IB 2 (IP0: DI port2 input)
V003 I/O address Blank
52
TPM EasyPAC User Manual
2.2.3. Compile
Click on the Make button to compile the project.
53
TPM EasyPAC User Manual
2.2.4. Download
Please left-click on Project Control to download the compiled file to EasyPAC as shown below.
2.2.5. Debug
Click the Debug on to activate the debug mode.
54
TPM EasyPAC User Manual
There are 3 icons highlighted in the above from left to right are individually:
1. Project Tree: Project Tree Window can display the project in a tree structure.
2. Edit Wizard: Edit Wizard provides the edition of instruction and FB.
3. Message: Message Windows displays the information about PLC.
55
TPM EasyPAC User Manual
Users could create a new project from File New Project as shown below.
56
TPM EasyPAC User Manual
Project Tree Window and Edit Wizard are shown in the above picture. Double-click on INIT_AXES in the
Project Tree Window to open the edit window as shown above. There are 5 programming languages available
in the MULTIPROG Express 5.35 tool. The sample program with LD will be explained in the next section.
( 1. LD Ladder diagram )
( 2. SFC Sequential Function Charts )
( 3. FBD Function Block Diagram )
( 4. ST Structured Text )
( 5. IL Instruction List )
Right-click on the Logical POUs and select Insert Program and the following window will pop-up.
Enter the file name in the Name text area, select Type with Program and Select LD as the programming
language.
57
TPM EasyPAC User Manual
A pop-up window shows Invalid name! in this example. All the symbols including space are not allowed
to input as the name and the first character could not be a number. The following example is an example
with legal name.
Click on the Code: LD_sample tab so the LD editor will show up. The function icons listed on the left
including Network, Contact right, Parallel, Coil right, etc. Left-click on the space area and click on the Coil
right button after the symbol + showing up, then a Contact will be created as shown below:
58
TPM EasyPAC User Manual
Mouse-click on the gray area and bring up the functions by right clicking on it.
After selecting the Object Properties the following window will show up.
59
TPM EasyPAC User Manual
Please enter the name in the Name: field and select BOOL as the data type. Enter either VAR or
VAR_GLOBAL in the Usage field. Note that VAR indicates that it will be used only by this POU and
VAR_GLOBAL indicates that it can be accessed by other POU. In the bottom, users can select A or B type
contact or coil. Please follow the following diagram.
Name: PLCMODE_RUN. Data Type: BOOL. Usage: VAR_GLOBAL. In this example, the IO address will
mapped as %MX1.0.1.
60
TPM EasyPAC User Manual
Add a B type contact by selecting Contact right and modify the name as shown below.
Please change the name as Inside_coil01 and select BOOL, VAR and B Type contact then click OK to finish.
61
TPM EasyPAC User Manual
The IO address is not assigned automatically and will be done later. The use of FBs or FUs will be introduced
in the next section.
The parameter setting window brought up by double clicks is like the following figure.
62
TPM EasyPAC User Manual
The sample of TON is illustrated and the IL/ST related information is also available. FB can be moved behind
the contact and connect it with direct wiring as shown below.
Double-click on the blue point of PT to enter the desired timer value. In this example the name is given with
T#1s or T#1000ms as shown below.
Double-click on the green point of Q to set the coil output as shown below.
63
TPM EasyPAC User Manual
After setting name, data type and usage, users could select R_TRIG in the Edit Wizard and double click
on it to name it as R_TRIG_1 and press OK. Please then left-click on the blue point of CLK to make it blue
as shown below.
Figure 6-45: TON FB example with rising edge trigger properties set
Click on the Contact icon to add a new a type contact and enter the name with Inside_coil01. Then add a coil
on the Q position by selecting Coil right icon and name it as Rising_Edge as shown below.
Add an ending on the right-end by click the Right powerrail icon as shown below.
64
TPM EasyPAC User Manual
The program flow control will be illustrated in the following part. This is similar to if thenelse in C
language. Open a B contact named as Rising_Edge and add jump behind it and double-click connector/Jump
and enter the name with jump00 as shown below
65
TPM EasyPAC User Manual
These data types SINT, INT, DINT, USINT, UINT and UDINT can be set. The reference table is listed below.
Note that the IN1IN2OUT 3 of a MUL must be set with the same data type. In this example, users need
to enter the name and value.
66
TPM EasyPAC User Manual
Figure 6-52: specify the name and value for the MUL
Enter jump00 as the Name and select Label and then click OK. Complete the sample program and add a new
GE FB as shown below.
Add a new MOVE with Label jump01 as shown below. Select DINT_TO_WORD FB and add it on.
67
TPM EasyPAC User Manual
IO_Configuration circled by red rectangular shown above is used for I/O address configuration. Please refer
to the following table.
68
TPM EasyPAC User Manual
1. Name: Name can be English or Chinese characters. The first character cannot be a number.
2. Type: Several data types including BOOL/BYTE/WORD etc. are supported.
3. Usage: Can be local VAR or global variable VAR_GLOBAL.
4. Description: Comments can be entered here.
5. Address: 3 types of address are I for input / Q for Output / M for virtual.
6. Init: Initial value before PLC start up.
69
TPM EasyPAC User Manual
Double click on the LD_sample and the following window will pop up.
Inside_coil01 could be used in other programs in the same project. The usage must be set as
VAR_GLOBAL.
Figure 6-57: set the usage as VAR_GLOBAL for sharing with other programs
70
TPM EasyPAC User Manual
Select the designated input/output and then hit the Properties button to check the properties.
71
TPM EasyPAC User Manual
If the Driver Parameters button is pressed, the driver information window would come up.
Note that the only valid driver name is EasyPAC. Any others will not be accepted. The Datatype field
could be left default.
Connect an EasyPAC correctly and turn the power on. Use MyConfig to confirm the following setting.
The default IP of EasyPAC is 192.168.1.100. Check the setting in the MULTIPROG with resource
ProConOS Settings.
72
TPM EasyPAC User Manual
73
TPM EasyPAC User Manual
Click on Download to download the program. When users download the project, please check the Include
Bootproject.
75
TPM EasyPAC User Manual
Jump is used to avoid fast continuous execution of Add. GE means Great/Equal. MUL will be activated once
after 1 sec.
76
TPM EasyPAC User Manual
The OUT (0x1FFF) will be outputted from the DO module of IP 0, because the OUT was set to %QW 1.
77
TPM EasyPAC User Manual
This part is adopted from the PLCopen for motion control specification, and includes additional information
for functionality with TPM and other components. Each function block is listed in alphabetical order, and is
also linked to the feature or function from the software environment. A comprehensive list of axis parameters
and error codes is at the back of the manual. A subset of specific errors that each function block may generate
is included under each function block description. The other main concepts covered in this manual are the
Motion State Diagram, and documentation concerning the Data Types supplied with the Firmware Library.
Any motion command is a transition that changes the state of the axis and, as a consequence, modifies the way
the current motion is computed. A normal procedure would start in Standstill. In this state, the power can be
switched on per axis (via the Power command). Also, one can access the Homing state (via the issue of the
Home command per axis), which after normal completion returns to Standstill. From here, one can transfer an
axis to either Discrete Motion or Continuous Motion. Via the Stopping state, one can return to Standstill.
ErrorStop is a state to which the axis transfers in case of an error. Via a Reset command, one can return to
Standstill from which the machine can be moved to an operational state again. Please note that the states
define the functionality of the Function Blocks.
The diagram is focused on the states of a single axis. The multiple axis function blocks such as GA_Moving
change the state whereas these axes can have specific states.
78
TPM EasyPAC User Manual
79
TPM EasyPAC User Manual
on the same instance), the FB wont return any feedback, like Done or CommandAborted, for the previous
action.
Input parameters
The parameters are read at the rising edge of the 'Execute' input. To modify any parameter, it is necessary to
change the input parameter(s) and trigger the 'Execute' again.
Missing input parameters
According to IEC 61131-3, if any parameter of a function block input is missing (open) then the value from
the previous invocation of this instance will be used. In the first invocation the default value is applied.
Position versus distance
'Position' is a value defined within a coordinate system. 'Distance' is a relative measure, the difference between
two positions.
Sign rules
The 'Velocity', 'Acceleration', 'Deceleration' and 'Jerk' are always positive values. 'Position' and 'Distance' can
be positive or negative.
Error Handling Behavior
All blocks have two outputs, which deal with errors that can occur while executing that Function Block. These
outputs are defined as follow:
Error: Rising edge of 'Error' indicates that an error occurred during the execution of the Function Block.
ErrorID: Error number - see the Error Code List at the end of the manual.
'Done', 'InVelocity', indicate successful completion, so these signals are logically exclusive to Error. Types
of errors:
Function Block Error (e.g. parameters out of range, state machine violation attempted)
Communication Error
Amplifier/Axis Error: Instance errors do not always result in an axis error (forcing the axis to
'StandStill'). The error outputs of the relevant FB are reset with falling edge of 'Execute'.
Behavior of Done output
The Done output is set when the commanded action has been completed successfully. With multiple
Function Blocks working on the same axis in a sequence, the following applies: When one movement on an
axis is interrupted with another movement on the same axis without having reached the final goal, 'Done' of
the first FB will not be set.
Behavior of CommandAborted output
'CommandAborted' is set when a commanded motion is interrupted by another motion command. The
reset-behavior of 'CommandAborted' is like that of 'Done'. When 'CommandAborted' occurs, the other
output-signals such as 'InVelocity' are reset.
Inputs exceeding application limits
If a FB is commanded with parameters which result in a violation of application limits, the instance of the FB
generates an error. The consequences of this error for the axis are application specific and thus should be
handled by the application program.
Behavior of Busy output
81
TPM EasyPAC User Manual
'Busy' output indicates that the FB is not finished. 'Busy' is SET at the rising edge of 'Execute' and RESET
when one of the outputs 'Done', 'Aborted', or 'Error' is set. It is recommended that this FB should be kept in the
active loop of the application program for at least as long as Busy is true, because the outputs may still
change. For one axis, several Function Blocks might be busy, but only one can be active at a time.
Output Active
The 'Active' output is available on Function Blocks with buffering capabilities. This output is set at the
moment the function block takes control of the axis. For unbuffered mode the outputs Active and Busy
can have the same value.
Enable and Valid / Status
The 'Enable' input is coupled to a 'Valid' output. 'Enable' is level sensitive, and 'Valid' shows that a valid set of
outputs is available at the FB. The 'Valid' output is TRUE as long as a valid output value is available and the
'Enable' input is TRUE. The relevant output values are refreshed while the input 'Enable' is TRUE. If there is a
FB error, the output is not valid (Valid set to FALSE). When the error condition disappears, the values will
reappear and 'Valid' output will be set again.
The behavior of the Execute / Done style FBs is as follows:
First has completed, the output 'First.Done' triggers 'Second.Execute'. The output 'Second.Done' AND
In13 trigger 'Third.Execute'.
83
TPM EasyPAC User Manual
84
TPM EasyPAC User Manual
85
TPM EasyPAC User Manual
86
TPM EasyPAC User Manual
87
TPM EasyPAC User Manual
Rules for the definition of Motion Control function blocks according to PLCopen
The input/output variables of the function blocks mandatory according to the PLCopen Standard are marked
with the letter 'B' in the defined tables in the definition of the function blocks.
Input/output variables marked with the letter 'E' are optional, i.e. they can be implemented but are not
mandatory.
Vendor specific input / output variables, i.e. added by the vendor, are marked with the letter 'V'.
88
TPM EasyPAC User Manual
Execution Logic
The execution can be activated either by rising-edge or falling-edge and the data type is BOOL. In the case of
rising-edge Execute will be used as the parameter. In the case of level-trigger Enable is used as the parameter.
When level is HIGH, it will be executed repeatedly until the level becomes LOW.
Status Logic
The standard output includes Valid, Done, Busy, Active, CommandAborted, Error and ErrorID. The
corresponding data type is BOOL except that ErrorID is INT.
Valid represents that FB is executable, R/W of parameter is successful when Valid is TRUE and is failed when
Valid is FALSE. Done represents that FB is executed. Busy and Active represent that FB is being executed.
CommandAborted represents that FB is interrupted while being executed and is aborted therefore. Error
represents that the execution of FB is not correct. ErrorID can be used to check. Valid/Done, Busy/ Active,
CommandAborted and Error are mutually incompatible. When Error is TRUE, ErrorID is not 0.
89
TPM EasyPAC User Manual
90
TPM EasyPAC User Manual
2.6.5.1 GA_GroupDisable
Function
Disable the grouped motion function.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
91
TPM EasyPAC User Manual
2.6.5.2 GA_GroupEnable
Function
Enable the grouped motion function.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
92
TPM EasyPAC User Manual
2.6.5.3 GA_GroupReset
Function
Reset grouped axes to StandStill.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
93
TPM EasyPAC User Manual
2.6.5.4 GA_GroupStop
Function
Grouped axes stop.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
StopMode BOOL 0 for immediate stop, 1 for SlowDown stop
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
BOOL The FB is not finished and new output values are to be
Busy
expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
94
TPM EasyPAC User Manual
2.6.5.5 GA_MoveCircularAbsolute
Function
Make a grouped axes absolute circular motion with T-curve or S-curve.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
AxisX AXIS_REF X axis.
AxisY AXIS_REF Y axis.
Cx DINT (-134217728 ~ +134217728) Center position in X axis.
Cy DINT (-134217728 ~ +134217728) Center position in Y axis.
Ex DINT (-134217728 ~ +134217728) End position in X axis.
Ey DINT (-134217728 ~ +134217728) End position in Y axis.
StartVelocity DWORD Start velocity.
MaxVelocity DWORD End velocity.
TAcc REAL Acceleration time in the unit of second.
TDec REAL Deceleration time in the unit of second.
Curve BYTE Velocity profile. 0 for T-Curve, 1 for S-Curve.
Direction USINT 0 for positive direction, 1 for negative direction.
95
TPM EasyPAC User Manual
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
BOOL The FB is not finished and new output values are to be
Busy
expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
96
TPM EasyPAC User Manual
2.6.5.6 GA_MoveCircularRelative
Function
Make a grouped axes relative circular motion with T-curve or S-curve.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
AxisX AXIS_REF X axis.
AxisY AXIS_REF Y axis.
OffsetCx DINT (-134217728 ~ +134217728) Relative center position in X axis.
OffsetCy DINT (-134217728 ~ +134217728) Relative center position in Y axis.
OffsetEx DINT (-134217728 ~ +134217728) Relative end position in X axis.
OffsetEy DINT (-134217728 ~ +134217728) Relative end position in Y axis.
StartVelocity DWORD Start velocity.
MaxVelocity DWORD End velocity.
TAcc REAL Acceleration time in the unit of second.
TDec REAL Deceleration time in the unit of second.
Curve BYTE Velocity profile. 0 for T-Curve, 1 for S-Curve.
Direction USINT 0 for positive direction, 1 for negative direction.
97
TPM EasyPAC User Manual
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
The FB is not finished and new output values are to be
Busy BOOL
expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
98
TPM EasyPAC User Manual
2.6.5.7 GA_MoveLinearAbsolute
Function
Make a grouped axes absolute linear motion with T-curve or S-curve.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
DISTARRAY
PosArray Absolute position.
(-134217728 ~ +134217728)
StartVelocity DWORD Start velocity.
MaxVelocity DWORD End velocity.
TAcc REAL Acceleration time in the unit of second.
TDec REAL Deceleration time in the unit of second.
Curve BYTE Velocity profile. 0 for T-Curve, 1 for S-Curve.
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
The FB is not finished and new output values are to be
Busy BOOL
expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
99
TPM EasyPAC User Manual
2.6.5.8 GA_MoveLinearRelative
Function
Make a grouped axes relative linear motion with T-curve or S-curve.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
DISTARRAY
DisArray Relative position.
(-134217728 ~ +134217728)
StartVelocity DWORD Start velocity.
MaxVelocity DWORD End velocity.
TAcc REAL Acceleration time in the unit of second.
TDec REAL Deceleration time in the unit of second.
Curve BYTE Velocity profile. 0 for T-Curve, 1 for S-Curve.
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
The FB is not finished and new output values are to be
Busy BOOL
expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
100
TPM EasyPAC User Manual
2.6.5.9 GA_MovePath
Function
Make a continuous motion with multiple segments.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
RepeatCount UINT The path repeat count for a motion.
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
101
TPM EasyPAC User Manual
2.6.5.10 GA_PathSelect
Function
Select and download the continuous path from xxxx.kwpts.
Input Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
The path string indicating the motion path which is
PathFile STRING
edited in MyLink.
Output Parameters
Name Type Description
AxesGroup AXIS_GROUP_REF Reference to the group of axes.
SegmentCount UINT The segment count of the file opened.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
102
TPM EasyPAC User Manual
2.6.5.11 MC_Home
Function
Do homing of the axis.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
StartVelocity DWORD Start velocity.
MaxVelocity DWORD End velocity.
TAcc REAL Acceleration time in the unit of second.
TDec REAL Deceleration time in the unit of second.
Curve BYTE Velocity profile. 0 for T-Curve, 1 for S-Curve.
Direction USINT 0 for positive direction, 1 for negative direction.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
103
TPM EasyPAC User Manual
2.6.5.12 MC_MoveAbsolute
Function
Make an absolute motion with T-curve or S-curve.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Position DINT (-134217728 ~ +134217728) Absolute target position of the motion.
StartVelocity DWORD Start velocity.
MaxVelocity DWORD End velocity.
TAcc REAL Acceleration time in the unit of second.
TDec REAL Deceleration time in the unit of second.
Curve BYTE Velocity profile. 0 for T-Curve, 1 for S-Curve.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
104
TPM EasyPAC User Manual
2.6.5.13 MC_MoveRelative
Function
Make a relative motion with T-curve or S-curve.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Distance DINT (-134217728 ~ +134217728) Relative target position of the motion.
StartVelocity DWORD Start velocity.
MaxVelocity DWORD End velocity.
TAcc REAL Acceleration time in the unit of second.
TDec REAL Deceleration time in the unit of second.
Curve BYTE Velocity profile. 0 for T-Curve, 1 for S-Curve.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
105
TPM EasyPAC User Manual
2.6.5.14 MC_MoveVelocity
Function
Make a velocity motion with T-curve or S-curve.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
StartVelocity DWORD Start velocity.
MaxVelocity DWORD End velocity.
TAcc REAL Acceleration time in the unit of second.
TDec REAL Deceleration time in the unit of second.
Curve BYTE Velocity profile. 0 for T-Curve, 1 for S-Curve.
Direction USINT 0 for positive direction, 1 for negative direction.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
InVelocity BOOL Commanded velocity reached (first time reached)
Busy BOOL The FB is not finished and new output values are to be expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
106
TPM EasyPAC User Manual
2.6.5.15 MC_Power
Function
Enable Servo/Step Driver for IP1~IP32 (AXIS_01~AXIS_32).
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
AxisIP USINT The IP address of the axis.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Status BOOL Effective state of the power stage.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Active BOOL Indicates that the FB has control of the axis.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
107
TPM EasyPAC User Manual
2.6.5.16 MC_ReadActualPosition
Function
Get the axis actual position from encoder.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
LogicPosition DINT Logical / commanded position.
EncoderPosition DINT Encoder / actual position.
108
TPM EasyPAC User Manual
2.6.5.17 MC_ReadAcutalVelocity
Function
Get the axis actual velocity from encoder.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Velocity DWORD The current position from encoder feedback.
109
TPM EasyPAC User Manual
2.6.5.18 MC_ReadAxisInfo
Function
Get the axis information.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
GroupNo USINT The group number.
Checking the axis is grouped. If the axis is grouped up (TRUE),
IsGrouped BOOL it is not allowed to do single axis control. If it returns FALSE,
grouped control is not allowed.
SWLimitPos BOOL Checking the axis reaches the positive limit.
SWLimitNeg BOOL Checking the axis reaches the negative limit.
110
TPM EasyPAC User Manual
2.6.5.19 MC_ReadBoolParameter
Function
Get the axis value of type BOOL.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Value BOOL Actual parameter value.
111
TPM EasyPAC User Manual
2.6.5.20 MC_ReadParameter
Function
Get the axis value of type UDINT.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Value BOOL Actual parameter value.
112
TPM EasyPAC User Manual
2.6.5.21 MC_ReadStatus
Function
Get the axis status.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Disabled BOOL Servo/Step driver is disabled when value is TRUE.
Errorstop BOOL Axis is stopped with error when Errorstop is TRUE.
Stopping BOOL Axis is decelerating to stop when the value is TRUE.
Axis is ready to execute motion command when this value is
StandStill BOOL
TRUE.
113
TPM EasyPAC User Manual
114
TPM EasyPAC User Manual
2.6.5.22 MC_Reset
Function
Reset the axis to Standstill status.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Standstill or Disabled state is reached.
Error BOOL Signal that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
115
TPM EasyPAC User Manual
2.6.5.23 MC_Stop
Function
Grouped axes stop.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
If Execute were TRUE, status is always Stopping. If
Execute changes from TRUE to FALSE, status is Stopping
Execute BOOL
while the axis is still moving, status will change to StandStill
after the axis stops.
StopMode BOOL 0 for immediate stop, 1 for SlowDown stop
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Standstill or Disabled state is reached.
Busy BOOL The FB is not finished and new output values are to be expected.
Active BOOL Indicates that the FB has control of the axis.
CommandAborted BOOL Command is aborted by another command.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
116
TPM EasyPAC User Manual
2.6.5.24 MC_WriteBoolParameter
Function
Set BOOL type data.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
If Execute were TRUE, status is always Stopping. If
Execute changes from TRUE to FALSE, status is Stopping
Execute BOOL
while the axis is still moving, status will change to StandStill
after the axis stops.
ParameterNumber INT Please refer to section 6.6.7 for details.
Value BOOL Actual parameter value to be set.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
117
TPM EasyPAC User Manual
2.6.5.25 MC_WriteEncoderPosition
Function
Set the encoder value.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
DINT
EncoderPosition Encoder position value.
(-134217728 ~ +134217728)
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
118
TPM EasyPAC User Manual
2.6.5.26 MC_WriteLogicPosition
Function
Set the logical position value.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
DINT
LogicPosition Logical position value.
(-134217728 ~ +134217728)
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
119
TPM EasyPAC User Manual
2.6.5.27 MC_WriteParameter
Function
Set the logical position value.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
ParameterNumber INT Please refer to section 6.6.7 for details.
Value UDINT Actual parameter value to be set.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
120
TPM EasyPAC User Manual
2.6.5.28 SA_CheckSystemConfig
Function
Check the system configuration.
Input Parameters
Name Type Description
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Output Parameters
Name Type Description
Check to see if the system configuration matches with MyLink
IsMatched BOOL
settings.
Done BOOL Completion of the command execution.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
121
TPM EasyPAC User Manual
2.6.5.29 SA_ErrorJog
Function
Move the axis out of limit sensor.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
DINT
Distance The relative position.
(-134217728 ~ +134217728)
MaxVelocity DWORD Maximum velocity.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Busy BOOL The FB is not finished and new output values are to be expected.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
122
TPM EasyPAC User Manual
2.6.5.30 SA_GetSensor
Function
Move the axis out of limit sensor.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Ready BOOL Axis is enabled when Ready is TRUE and is disabled when FALSE.
123
TPM EasyPAC User Manual
124
TPM EasyPAC User Manual
2.6.5.31 SA_LoadConfigFile
Function
Move the axis out of limit sensor.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Status BOOL The status read complete flag.
Busy BOOL The FB is not finished and new output values are to be expected.
Active BOOL Indicates that the FB has control of the axis.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
125
TPM EasyPAC User Manual
2.6.5.32 SA_ReadByteParameter
Function
Get the parameter value of type BYTE.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Value BYTE Actual parameter value.
126
TPM EasyPAC User Manual
2.6.5.33 SA_ReadDintParameter
Function
Get the parameter value of type double integer.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Value DINT Actual parameter value.
127
TPM EasyPAC User Manual
2.6.5.34 SA_ReadDwordParameter
Function
Get the parameter value of type double word.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Value DWORD Actual parameter value.
128
TPM EasyPAC User Manual
2.6.5.35 SA_ReadIntParameter
Function
Get the parameter value of type integer.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Value INT Actual parameter value.
129
TPM EasyPAC User Manual
2.6.5.36 SA_ReadUsintParameter
Function
Get the parameter value of type unsigned integer.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Valid BOOL A valid output is available at the FB.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
Value USINT Actual parameter value.
130
TPM EasyPAC User Manual
2.6.5.37 SA_WriteByteParameter
Function
Get the parameter value of type BYTE.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Value BYTE Actual parameter value to be set.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
131
TPM EasyPAC User Manual
2.6.5.38 SA_WriteDintParameter
Function
Get the parameter value of type double integer.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Value DINT Actual parameter value to be set.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
132
TPM EasyPAC User Manual
2.6.5.39 SA_WriteDwordParameter
Function
Get the parameter value of type double word.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Value DWORD Actual parameter value to be set.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
133
TPM EasyPAC User Manual
2.6.5.40 SA_WriteIntParameter
Function
Get the parameter value of type integer.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Value INT Actual parameter value to be set.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
134
TPM EasyPAC User Manual
2.6.5.41 SA_WriteUsintParameter
Function
Get the parameter value of type unsigned integer.
Input Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Enable BOOL Get the value of the parameter continuously while enabled.
ParameterNumber INT Please refer to section 6.6.7 for details.
Value USINT Actual parameter value to be set.
Output Parameters
Name Type Description
Axis AXIS_REF Reference to the axis.
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
135
TPM EasyPAC User Manual
2.6.6.1 EP_SetCyclicTime
Function
Set the PLC cycle times and baud rates according to the number of slave modules.
Input Parameters
Name Type Description
Enable BOOL Get the value of the parameter continuously while enabled.
Baud rate of Ring_0.
BaudRate0 USINT
02.5Mbps, 15Mbps, 210Mbps, 320Mbps
Baud rate of Ring_1.
BaudRate1 USINT
02.5Mbps, 15Mbps, 210Mbps, 320Mbps
DioCount USINT Number of DI/O slave modules. 0 ~ 48
AioCount USINT Number of AI/O slave modules. 0 ~ 16
AxisCount USINT Number of motion slave modules. 0 ~ 32
Output Parameters
Name Type Description
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
CycleTime USINT Minimum cycle time in the unit of millisecond.
136
TPM EasyPAC User Manual
2.6.6.2 EP_GetVersion
Function
Set the PLC cycle times and baud rates according to the number of slave modules.
Input Parameters
Name Type Description
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Output Parameters
Name Type Description
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
KernelVersion INT Kernel version.
UserLibVersion INT User library version.
137
TPM EasyPAC User Manual
2.6.6.3 EP_CheckAesKey
Function
Check the AESkey set from EP_SetAesKey.
Input Parameters
Name Type Description
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Key1 ~ Key16 INT SI key with number from 0 to 9.
Output Parameters
Name Type Description
Valid BOOL A valid output is available at the FB.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
138
TPM EasyPAC User Manual
2.6.6.4 EP_SetAesKey
Function
Set the AES key in the system non-volatile memory.
Input Parameters
Name Type Description
Execute BOOL Please refer to the Execution Logic at section 6.6.5.
Key1 ~ Key8 WORD Set the encrypted AesKey which is from 0x0000 to 0xFFFF.
Output Parameters
Name Type Description
Done BOOL Completion of the command execution.
Error BOOL Signals that an error has occurred within the FB.
ErrorID INT Please refer to the Status Logic at section 6.6.8.
139
TPM EasyPAC User Manual
PN (Parameter Number) Parameter number applied to the input 'ParameterNumber' of the function blocks
mentioned above.
Name Parameter name.
Datatype Datatype of the axis parameter.
R/W Read/Write access (parameter can be read/written).
Comments Short description of the parameter function
140
TPM EasyPAC User Manual
141
TPM EasyPAC User Manual
2.7.1. AI/O
Module wiring
106-A104-01 and 106-A180-01 are used in this example. The IP of 106-A104-01 is set as 61 and
106-A180-01 as 62. Make the wiring as shown below.
AOUT0 of 106-A104-01 is connected to the AIN0+ of 106-A180-01.
AGND of 106-A104-01 is connected to AIN0-/AGND of 106-A180-01.
And AIN4+/AIN4-/AGND of 106-A180-01 are connected together.
106-A104-01 AOUT0 AGND AGND AOUT1 AGND AGND AOUT2 AGND AGND AOUT3 AGND AGND
106-A180-01 AIN0+ AIN0- AGND AIN1+ AIN1- AGND AIN2+ AIN2- AGND AIN3+ AIN3- AGND
106-A104-01
106-A180-01 AIN4+ AIN4- AGND AIN5+ AIN5- AGND AIN6+ AIN6- AGND AIN7+ AIN7- AGND
142
TPM EasyPAC User Manual
143
TPM EasyPAC User Manual
Click on Untitled
146
TPM EasyPAC User Manual
2.7.2. Counter
Module Wiring
108-P120 is used together with TTL encoder in this case. The wiring is shown below and the IP address is set
to 63
Wiring table:
108-P120 Encoder
24V 24V
GND GND
IN0+ connected to 24V
IN0- A-phase (NPN Open Collector)
IN1+ connected to 24V
IN1- B-phase (NPN Open Collector)
Table 6-7: counter module wiring table
147
TPM EasyPAC User Manual
148
TPM EasyPAC User Manual
3. Add variables Channel_1, Channel_2 and Channel_3 following the foregoing method.
150
TPM EasyPAC User Manual
2. Click on the corresponding parameter column and set it correctly as shown below.
151
TPM EasyPAC User Manual
MC_ReadStatus_1 and MC_ReadActualPosition_1 will be executed when InitFlag is TRUE and are used to
monitor the axis status. The axis is in the StandStill status as shown below.
153
TPM EasyPAC User Manual
154
TPM EasyPAC User Manual
155
TPM EasyPAC User Manual
156
TPM EasyPAC User Manual
157
TPM EasyPAC User Manual
159
TPM EasyPAC User Manual
GA_MoveLinearRelative_1 will make the axes move 100000 pulses in X and 120000 pulses in Y with
velocity 10000 pps.
160
TPM EasyPAC User Manual
2.7.5. HMI_DIO
Module wiring
106-D422-NN is used in this case with IP 0. 00 is connected to 20 and 10 is connected to 30 as shown below.
DI DO DI DO
00 20 10 30
01 21 11 31
02 22 12 32
03 23 13 33
04 24 14 34
05 25 15 35
06 26 16 36
07 27 17 37
Table 6-11: the wiring table
161
TPM EasyPAC User Manual
162
TPM EasyPAC User Manual
163
TPM EasyPAC User Manual
164
TPM EasyPAC User Manual
Download
The following menu will show up after successful download.
166
TPM EasyPAC User Manual
Click on Untitled
167
TPM EasyPAC User Manual
Add new variables and name them as IN_Port_0 (Byte), IN_Bit_0 (Bool), IN_Bit_1 (Bool), IN_Bit_2 (Bool),
IN_Bit_3 (Bool), IN_Bit_4 (Bool), IN_Bit_5 (Bool), IN_Bit_6 (Bool), IN_Bit_7 (Bool), Out_Port_0 (Byte),
Out_Bit_0 (Bool), Out_Bit_1 (Bool), Out_Bit_2 (Bool), Out_Bit_3 (Bool), Out_Bit_4 (Bool), Out_Bit_5
(Bool), Out_Bit_6 (Bool) and Out_Bit_7 (Bool) correspondingly as the screenshot below.
168
TPM EasyPAC User Manual
169