Omron TJ1-MC04 - PROGRAMMING 1, TJ1-MC16 - PROGRAMMING 1, TJ1-MC04 1 Programming Manual

Note:
Although we do strive for perfection, Omron Europe BV and/or its subsidiary and affiliated companies do not warrant or make any representations regarding the correctness or completeness
of information described in this catalogue. Product information in this catalogue is provided ‚as is‘ without warranty of any kind, either express or implied, including, but not limited to, the
implied warranties of merchantability, fitness for a particular purpose, or non-infringement. In a jurisdiction where the exclusion of implied warranties is not valid, the exclusion shall be
deemed to be replaced by such valid exclusion, which most closely matches the intent and purpose of the original exclusion. Omron Europe BV and/or its subsidiary and affiliated companies
reserve the right to make any changes to the products, their specifications, data at its sole discretion at any time without prior notice. The material contained in this catalogue may be out of
date and Omron Europe BV and/or its subsidiary and affiliated companies make no commitment to update such material.
Cat. No. I52E-E N-03
PROGRAMMING MANUAL 2
Revision 3.0
Notice
OMRON products are manufactured for use according to proper procedures by a qualified operator and only for the purposes described in this manual. The following conventions are used to indicate and classify precautions in this manual. Always heed the information provided with them. Failure to heed precautions can result in injury to people or damage to property.
Definition of precautionary information
Trademarks and Copyrights
PROFIBUS is a registered trademark of PROFIBUS International. MECHATROLINK is a registered trademark of Yaskawa Corporation. DeviceNet is a registered trademark of Open DeviceNet Vendor Assoc INC. CIP is a registered trademark of Open DeviceNet Vendor Assoc INC. Trajexia is a registered trademark of OMRON. Motion Perfect is a registered trademark of Trio Motion Technology Ltd.
/i
DANGER
Indicates an imminently hazardous situation, which, if not avoided, will result in death or serious injury.
WARNING
Indicates a potentially hazardous situation, which, if not avoided, could result in death or serious injury.
Caution
Indicates a potentially hazardous situation, which, if not avoided, may result in minor or moderate injury, or property damage.
© OMRON, 2007
All rights reserved. No part of this publication may be reproduced, stored in a retrieval sys­tem, or transmitted, in any form, or by any means, mechanical, electronic, photocopying, recording, or otherwise, without the prior written permission of OMRON. No patent liability is assumed with respect to the use of the information contained herein. Moreover, because OMRON is constantly striving to improve its high-quality products, the information contained in this manual is subject to change without notice. Every precaution has been taken in the preparation of this manual. Nevertheless, OMRON assumes no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained in this publication.
I52E-EN-03.book Seite 2 Freitag, 29. Juni 2007 11:55 11
PROGRAMMING MANUAL 3
Revision 3.0
About this manual
This manual describes the installation and operation of the Trajexia Motion Control System. Please read this manual and the related manuals listed in the following table carefully and be sure you understand the information provided before attempting to install or operate the Trajexia Motion Control units. Be sure to read the precautions provided in the following section.
/i
Name Cat. No. Contents
Trajexia motion control system QUICK START GUIDE
I50E Describes how to get quickly
familiar with Trajexia, moving a single axis using MECHA­TROLINK-II, in a test set-up.
Trajexia motion control system HARDWARE REFERENCE MANUAL
I51E Describes the installation and
hardware specification of the Trajexia units, and explains the Trajexia system philoso­phy.
Trajexia motion control system PROGRAMMING MANUAL
I52E Describes the BASIC com-
mands to be used for pro­gramming Trajexia, explains the communication protocols and Trajexia Tools software, gives practical examples and troubleshooting information.
Sigma-II Servo Driver manual SIEP S800000 15 Describes the installation and
operation of Sigma-II servo drives
JUNMA series servo drive manual
TOEP-C71080603 01-OY Describes the installation and
operation of JUNMA servo drives
JUSP-NS115 manual SIEP C71080001 Describes the installation and
operation of the MECHA­TROLINK-II application mod­ule
Sigma-III with MECHATRO­LINK interface manual
SIEP S800000 11 Describes the installation an d
operation of Sigma-III servo drives with MECHATRO­LINK interface
V7 Inverter TOEP C71060605 02-OY Describes the installation and
operation of V7 inverters
F7Z Inverter TOE S616-55 1-OY Describes the installation and
operation of F7Z inverters
G7 Inverter TOE S616-60 Describes the installation and
operation of G7 inverters
SI-T MECHATROLINK inter­face for the G7 & F7
SIBP-C730600-08 Describes the installation and
operation of MECHATRO­LINK interfaces for G7 and F7 inverters
ST-T/V7 MECHATROLINK interface for the V7
SIBP-C730600-03 Describes the installation and
operation of MECHATRO­LINK interfaces for V7 invert­ers
MECHATROLINK IO Modules SIE C887-5 Describes the installation and
operation of MECHATRO­LINK input and output mod­ules and the MECHATROLINK-II repeater
SYSMAC CS/CJ Series Com­munications Commands
W342 Describes FINS communica-
tions protocol and FINS com­mands
WARNING
Failure to read and understand the information provided in this manual may result in personal injury or death, damage to the prod­uct, or product failure. Please read each section in its entirety and be sure you understand the information provided in the section and related sections before attempting any of the procedures or opera­tions given.
Name Cat. No. Contents
I52E-EN-03.book Seite 3 Freitag, 29. Juni 2007 11:55 11
PROGRAMMING MANUAL 4
Revision 3.0
Functions supported by unit versions
During the development of Trajexia new functionality was added to the controller unit after market release. This functionality is implemented in the firmware, and/or the FPGA of the controller unit. In the table below, the overview of the applicable functionality is shown related to the firmware and FPGA version of the TJ1-MC__.
/i
Verify the firmware and FPGA versions of the TJ1-MC__
Connect the TJ1-MC__ to Trajexia Tools software. Refer to the Programming Manual. Open the terminal window and type the following commands:
Type
PRINT VERSION in the terminal window. The version parameter returns
the current firmware version number of the motion controller. Type
PRINT FPGA_VERSION SLOT(-1) in the terminal window. The
parameter returns the current FPGA version number of the TJ1-MC__.
Functionality TJ1-MC__ Firmware
version
TJ1-MC__ FPGA version
Full support TJ1-FL02 V1.6509 21 and higher.
Support BASIC commands FINS_COMMS
V1.6509 All versions
Support TJ1-DRT V1.6509 All versions
Support TJ1-MC04 and TJ1-ML04
V1.6607 21 and higher
I52E-EN-03.book Seite 4 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 5
Revision 3.0
1 Safety warnings and precautions..............................................................................................................................................................16
1.1 Intended audience ..........................................................................................................................................................................................................................16
1.2 General precautions .......................................................................................................................................................................................................................16
1.3 Safety precautions ......................................................................................................................................................................................................................... 16
1.4 Operating environment precautions................................................................................................................................................................................................ 17
1.5 Application precautions...................................................................................................................................................................................................................18
1.6 Unit assembly precautions..............................................................................................................................................................................................................21
2 Trajexia system ..........................................................................................................................................................................................22
2.1 Introduction .....................................................................................................................................................................................................................................22
2.1.1 Trajexia hardware ............................................................................................................................................................................................................ 23
2.1.2 This manual ......................................................................................................................................................................................................................23
2.2 Multitasking BASIC programming ...................................................................................................................................................................................................23
2.3 BASIC programming .......................................................................................................................................................................................................................24
2.3.1 Axis, system and task statements ....................................................................................................................................................................................24
2.3.2 Memory areas...................................................................................................................................................................................................................24
2.3.3 Data structures and variables........................................................................................................................................................................................... 25
2.3.4 Mathematical specifications..............................................................................................................................................................................................27
2.4 Motion execution.............................................................................................................................................................................................................................28
2.4.1 Motion generator .............................................................................................................................................................................................................. 28
2.4.2 Sequencing.......................................................................................................................................................................................................................29
2.4.3 Move loading ....................................................................................................................................................................................................................29
2.5 Command line interface ..................................................................................................................................................................................................................30
2.6 BASIC programs .............................................................................................................................................................................................................................30
2.6.1 Managing programs..........................................................................................................................................................................................................30
2.6.2 Program compilation.........................................................................................................................................................................................................31
2.6.3 Program execution ........................................................................................................................................................................................................... 31
3 BASIC commands ...................................................................................................................................................................................... 33
3.1 Categories ...................................................................................................................................................................................................................................... 33
3.1.1 Axis commands ...............................................................................................................................................................................................................33
3.1.2 Axis parameters ...............................................................................................................................................................................................................34
3.1.3 Communication commands and parameters ...................................................................................................................................................................36
3.1.4 Constants .........................................................................................................................................................................................................................36
3.1.5 I/O commands, functions and parameters ......................................................................................................................................................................36
3.1.6 Mathematical functions and operands .........................................................................................................................................................................37
3.1.7 Program commands ........................................................................................................................................................................................................37
3.1.8 Program control commands ............................................................................................................................................................................................38
3.1.9 Slot parameters and modifiers ........................................................................................................................................................................................ 38
3.1.10 System commands and functions ..................................................................................................................................................................................38
I52E-EN-03.book Seite 5 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 6
Revision 3.0
3.1.11 System parameters .........................................................................................................................................................................................................39
3.1.12 Task commands and parameters .................................................................................................................................................................................... 40
3.2 All BASIC commands .....................................................................................................................................................................................................................41
3.2.1 + (Addition) ....................................................................................................................................................................................................................... 41
3.2.2 - (Subtraction)...................................................................................................................................................................................................................41
3.2.3 * (Multiplication) ................................................................................................................................................................................................................41
3.2.4 / (Division).........................................................................................................................................................................................................................41
3.2.5 ^ (Power) .......................................................................................................................................................................................................................... 42
3.2.6 = (Is equal to) ...................................................................................................................................................................................................................42
3.2.7 = (Assignment) .................................................................................................................................................................................................................42
3.2.8 <> (Is not equal to) ...........................................................................................................................................................................................................42
3.2.9 > (Is greater than).............................................................................................................................................................................................................43
3.2.10 >= (Is greater than or equal to).........................................................................................................................................................................................43
3.2.11 < (Is less than)..................................................................................................................................................................................................................43
3.2.12 <= (Is less than or equal to).............................................................................................................................................................................................. 43
3.2.13 $ (Hexadecimal input).......................................................................................................................................................................................................44
3.2.14 ' (Comment field) ..............................................................................................................................................................................................................44
3.2.15 : (Statement separator).....................................................................................................................................................................................................44
3.2.16 #........................................................................................................................................................................................................................................44
3.2.17 ABS ..................................................................................................................................................................................................................................45
3.2.18 ACC ..................................................................................................................................................................................................................................45
3.2.19 ACCEL..............................................................................................................................................................................................................................45
3.2.20 ACOS ...............................................................................................................................................................................................................................45
3.2.21 ADD_DAC ........................................................................................................................................................................................................................46
3.2.22 ADDAX .............................................................................................................................................................................................................................46
3.2.23 ADDAX_AXIS ...................................................................................................................................................................................................................47
3.2.24 AIN....................................................................................................................................................................................................................................47
3.2.25 AND ..................................................................................................................................................................................................................................47
3.2.26 AOUT................................................................................................................................................................................................................................48
3.2.27 ASIN .................................................................................................................................................................................................................................48
3.2.28 ATAN ................................................................................................................................................................................................................................48
3.2.29 ATAN2 ..............................................................................................................................................................................................................................48
3.2.30 ATYPE..............................................................................................................................................................................................................................49
3.2.31 AUTORUN........................................................................................................................................................................................................................49
3.2.32 AXIS .................................................................................................................................................................................................................................49
3.2.33 AXIS_DISPLAY ................................................................................................................................................................................................................50
3.2.34 AXIS_ENABLE .................................................................................................................................................................................................................50
3.2.35 AXISSTATUS ...................................................................................................................................................................................................................50
3.2.36 B_SPLINE ........................................................................................................................................................................................................................51
3.2.37 BASE ................................................................................................................................................................................................................................51
I52E-EN-03.book Seite 6 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 7
Revision 3.0
3.2.38 BASICERROR..................................................................................................................................................................................................................52
3.2.39 BATTERY_LOW...............................................................................................................................................................................................................53
3.2.40 BREAK_RESET ...............................................................................................................................................................................................................53
3.2.41 CAM..................................................................................................................................................................................................................................53
3.2.42 CAMBOX ..........................................................................................................................................................................................................................55
3.2.43 CANCEL ...........................................................................................................................................................................................................................56
3.2.44 CHECKSUM .....................................................................................................................................................................................................................56
3.2.45 CHR..................................................................................................................................................................................................................................56
3.2.46 CLEAR..............................................................................................................................................................................................................................57
3.2.47 CLEAR_BIT ......................................................................................................................................................................................................................57
3.2.48 CLEAR_PARAMS ............................................................................................................................................................................................................57
3.2.49 CLOSE_WIN ....................................................................................................................................................................................................................57
3.2.50 CLUTCH_RATE ...............................................................................................................................................................................................................57
3.2.51 COMMSERROR...............................................................................................................................................................................................................58
3.2.52 COMMSTYPE ..................................................................................................................................................................................................................58
3.2.53 COMPILE .........................................................................................................................................................................................................................58
3.2.54 CONNECT........................................................................................................................................................................................................................59
3.2.55 CONSTANT......................................................................................................................................................................................................................59
3.2.56 CONTROL ........................................................................................................................................................................................................................59
3.2.57 COPY ...............................................................................................................................................................................................................................60
3.2.58 COS..................................................................................................................................................................................................................................60
3.2.59 CREEP .............................................................................................................................................................................................................................60
3.2.60 D_GAIN ............................................................................................................................................................................................................................ 60
3.2.61 D_ZONE_MAX .................................................................................................................................................................................................................61
3.2.62 D_ZONE_MIN ..................................................................................................................................................................................................................61
3.2.63 DAC ..................................................................................................................................................................................................................................61
3.2.64 DAC_OUT ........................................................................................................................................................................................................................61
3.2.65 DAC_SCALE ....................................................................................................................................................................................................................61
3.2.66 DATE ................................................................................................................................................................................................................................62
3.2.67 DATE$ ..............................................................................................................................................................................................................................62
3.2.68 DATUM.............................................................................................................................................................................................................................62
3.2.69 DATUM_IN ....................................................................................................................................................................................................................... 63
3.2.70 DAY .................................................................................................................................................................................................................................. 64
3.2.71 DAY$ ................................................................................................................................................................................................................................64
3.2.72 DECEL..............................................................................................................................................................................................................................64
3.2.73 DEFPOS...........................................................................................................................................................................................................................64
3.2.74 DEL...................................................................................................................................................................................................................................65
3.2.75 DEMAND_EDGES ...........................................................................................................................................................................................................65
3.2.76 DEVICENET .....................................................................................................................................................................................................................65
3.2.77 DIR ...................................................................................................................................................................................................................................67
I52E-EN-03.book Seite 7 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 8
Revision 3.0
3.2.78 DISABLE_GROUP ...........................................................................................................................................................................................................67
3.2.79 DISPLAY ..........................................................................................................................................................................................................................67
3.2.80 DPOS ...............................................................................................................................................................................................................................68
3.2.81 DRIVE_ALARM ................................................................................................................................................................................................................68
3.2.82 DRIVE_CLEAR.................................................................................................................................................................................................................69
3.2.83 DRIVE_CONTROL ...........................................................................................................................................................................................................69
3.2.84 DRIVE_INPUTS ...............................................................................................................................................................................................................70
3.2.85 DRIVE_MONITOR............................................................................................................................................................................................................70
3.2.86 DRIVE_READ...................................................................................................................................................................................................................71
3.2.87 DRIVE_RESET.................................................................................................................................................................................................................71
3.2.88 DRIVE_STATUS ..............................................................................................................................................................................................................72
3.2.89 DRIVE_WRITE .................................................................................................................................................................................................................73
3.2.90 EDIT .................................................................................................................................................................................................................................73
3.2.91 ELSE ................................................................................................................................................................................................................................73
3.2.92 ELSEIF .............................................................................................................................................................................................................................73
3.2.93 ENCODER........................................................................................................................................................................................................................74
3.2.94 ENCODER_BITS..............................................................................................................................................................................................................74
3.2.95 ENCODER_CONTROL ....................................................................................................................................................................................................74
3.2.96 ENCODER_ID ..................................................................................................................................................................................................................75
3.2.97 ENCODER_RATIO...........................................................................................................................................................................................................75
3.2.98 ENCODER_READ............................................................................................................................................................................................................75
3.2.99 ENCODER_STATUS ....................................................................................................................................................................................................... 76
3.2.100 ENCODER_TURNS .........................................................................................................................................................................................................76
3.2.101 ENCODER_WRITE ..........................................................................................................................................................................................................76
3.2.102 ENDIF...............................................................................................................................................................................................................................76
3.2.103 ENDMOVE .......................................................................................................................................................................................................................77
3.2.104 EPROM ............................................................................................................................................................................................................................77
3.2.105 ERROR_AXIS ..................................................................................................................................................................................................................77
3.2.106 ERROR_LINE...................................................................................................................................................................................................................77
3.2.107 ERRORMASK ..................................................................................................................................................................................................................78
3.2.108 ETHERNET ......................................................................................................................................................................................................................78
3.2.109 EX.....................................................................................................................................................................................................................................79
3.2.110 EXP ..................................................................................................................................................................................................................................79
3.2.111 FALSE ..............................................................................................................................................................................................................................79
3.2.112 FAST_JOG .......................................................................................................................................................................................................................79
3.2.113 FASTDEC.........................................................................................................................................................................................................................80
3.2.114 FE .....................................................................................................................................................................................................................................80
3.2.115 FE_LATCH .......................................................................................................................................................................................................................80
3.2.116 FE_LIMIT..........................................................................................................................................................................................................................80
3.2.117 FE_LIMIT_MODE .............................................................................................................................................................................................................81
I52E-EN-03.book Seite 8 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 9
Revision 3.0
3.2.118 FE_RANGE ......................................................................................................................................................................................................................81
3.2.119 FHOLD_IN........................................................................................................................................................................................................................81
3.2.120 FHSPEED.........................................................................................................................................................................................................................82
3.2.121 FINS_COMMS..................................................................................................................................................................................................................82
3.2.122 FLAG ................................................................................................................................................................................................................................84
3.2.123 FLAGS..............................................................................................................................................................................................................................84
3.2.124 FOR..TO..STEP..NEXT ....................................................................................................................................................................................................85
3.2.125 FORWARD .......................................................................................................................................................................................................................86
3.2.126 FPGA_VERSION..............................................................................................................................................................................................................86
3.2.127 FRAC................................................................................................................................................................................................................................86
3.2.128 FRAME .............................................................................................................................................................................................................................86
3.2.129 FREE ................................................................................................................................................................................................................................87
3.2.130 FS_LIMIT..........................................................................................................................................................................................................................87
3.2.131 FWD_IN............................................................................................................................................................................................................................87
3.2.132 FWD_JOG ........................................................................................................................................................................................................................88
3.2.133 GET ..................................................................................................................................................................................................................................88
3.2.134 GLOBAL ...........................................................................................................................................................................................................................89
3.2.135 GOSUB..RETURN............................................................................................................................................................................................................89
3.2.136 GOTO ...............................................................................................................................................................................................................................89
3.2.137 HALT ................................................................................................................................................................................................................................90
3.2.138 HEX ..................................................................................................................................................................................................................................90
3.2.139 HLM_COMMAND .............................................................................................................................................................................................................90
3.2.140 HLM_READ ......................................................................................................................................................................................................................91
3.2.141 HLM_STATUS..................................................................................................................................................................................................................92
3.2.142 HLM_TIMEOUT................................................................................................................................................................................................................93
3.2.143 HLM_WRITE ....................................................................................................................................................................................................................94
3.2.144 HLS_NODE ......................................................................................................................................................................................................................95
3.2.145 HW_PSWITCH .................................................................................................................................................................................................................95
3.2.146 I_GAIN..............................................................................................................................................................................................................................96
3.2.147 IDLE..................................................................................................................................................................................................................................96
3.2.148 IEEE_IN............................................................................................................................................................................................................................96
3.2.149 IEEE_OUT........................................................................................................................................................................................................................96
3.2.150 IF..THEN..ELSE..ENDIF...................................................................................................................................................................................................97
3.2.151 IN ......................................................................................................................................................................................................................................97
3.2.152 INDEVICE.........................................................................................................................................................................................................................98
3.2.153 INITIALISE........................................................................................................................................................................................................................98
3.2.154 INPUT...............................................................................................................................................................................................................................99
3.2.155 INT....................................................................................................................................................................................................................................99
3.2.156 INVERT_IN.......................................................................................................................................................................................................................99
3.2.157 INVERT_STEP ...............................................................................................................................................................................................................100
I52E-EN-03.book Seite 9 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 10
Revision 3.0
3.2.158 INVERTER_COMMAND ................................................................................................................................................................................................100
3.2.159 INVERTER_READ ......................................................................................................................................................................................................... 101
3.2.160 INVERTER_WRITE........................................................................................................................................................................................................ 102
3.2.161 JOGSPEED.................................................................................................................................................................................................................... 103
3.2.162 KEY ................................................................................................................................................................................................................................103
3.2.163 LAST_AXIS ....................................................................................................................................................................................................................104
3.2.164 LINKAX...........................................................................................................................................................................................................................104
3.2.165 LINPUT...........................................................................................................................................................................................................................104
3.2.166 LIST ................................................................................................................................................................................................................................105
3.2.167 LIST_GLOBAL................................................................................................................................................................................................................105
3.2.168 LN ...................................................................................................................................................................................................................................106
3.2.169 LOCK..............................................................................................................................................................................................................................106
3.2.170 MARK .............................................................................................................................................................................................................................106
3.2.171 MARKB...........................................................................................................................................................................................................................107
3.2.172 MECHATROLINK ...........................................................................................................................................................................................................107
3.2.173 MERGE ..........................................................................................................................................................................................................................108
3.2.174 MHELICAL......................................................................................................................................................................................................................109
3.2.175 MOD ...............................................................................................................................................................................................................................109
3.2.176 MOTION_ERROR ..........................................................................................................................................................................................................109
3.2.177 MOVE .............................................................................................................................................................................................................................110
3.2.178 MOVEABS......................................................................................................................................................................................................................111
3.2.179 MOVECIRC ....................................................................................................................................................................................................................112
3.2.180 MOVELINK .....................................................................................................................................................................................................................114
3.2.181 MOVEMODIFY ...............................................................................................................................................................................................................115
3.2.182 MPOS .............................................................................................................................................................................................................................116
3.2.183 MSPEED ........................................................................................................................................................................................................................116
3.2.184 MTYPE ...........................................................................................................................................................................................................................116
3.2.185 NAIO...............................................................................................................................................................................................................................117
3.2.186 NEG_OFFSET................................................................................................................................................................................................................117
3.2.187 NEW ...............................................................................................................................................................................................................................117
3.2.188 NEXT ..............................................................................................................................................................................................................................117
3.2.189 NIO .................................................................................................................................................................................................................................117
3.2.190 NOT ................................................................................................................................................................................................................................118
3.2.191 NTYPE............................................................................................................................................................................................................................118
3.2.192 OFF ................................................................................................................................................................................................................................118
3.2.193 OFFPOS.........................................................................................................................................................................................................................118
3.2.194 ON ..................................................................................................................................................................................................................................119
3.2.195 ON.. GOSUB ..................................................................................................................................................................................................................119
3.2.196 ON.. GOTO.....................................................................................................................................................................................................................119
3.2.197 OP ..................................................................................................................................................................................................................................119
I52E-EN-03.book Seite 10 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 11
Revision 3.0
3.2.198 OPEN_WIN ....................................................................................................................................................................................................................120
3.2.199 OR ..................................................................................................................................................................................................................................120
3.2.200 OUTDEVICE...................................................................................................................................................................................................................121
3.2.201 OUTLIMIT....................................................................................................................................................................................................................... 121
3.2.202 OV_GAIN........................................................................................................................................................................................................................121
3.2.203 P_GAIN ..........................................................................................................................................................................................................................122
3.2.204 PI ....................................................................................................................................................................................................................................122
3.2.205 PMOVE...........................................................................................................................................................................................................................122
3.2.206 POS_OFFSET................................................................................................................................................................................................................ 123
3.2.207 POWER_UP ...................................................................................................................................................................................................................123
3.2.208 PRINT.............................................................................................................................................................................................................................123
3.2.209 PROC .............................................................................................................................................................................................................................124
3.2.210 PROC_STATUS .............................................................................................................................................................................................................124
3.2.211 PROCESS ......................................................................................................................................................................................................................125
3.2.212 PROCNUMBER..............................................................................................................................................................................................................125
3.2.213 PROFIBUS .....................................................................................................................................................................................................................125
3.2.214 PSWITCH .......................................................................................................................................................................................................................126
3.2.215 RAPIDSTOP................................................................................................................................................................................................................... 127
3.2.216 READ_BIT ......................................................................................................................................................................................................................127
3.2.217 REG_POS ......................................................................................................................................................................................................................128
3.2.218 REG_POSB....................................................................................................................................................................................................................128
3.2.219 REGIST ..........................................................................................................................................................................................................................128
3.2.220 REMAIN..........................................................................................................................................................................................................................130
3.2.221 REMOTE_ERROR .........................................................................................................................................................................................................130
3.2.222 RENAME ........................................................................................................................................................................................................................130
3.2.223 REP_DIST ......................................................................................................................................................................................................................131
3.2.224 REP_OPTION ................................................................................................................................................................................................................131
3.2.225 REPEAT..UNTIL.............................................................................................................................................................................................................131
3.2.226 RESET............................................................................................................................................................................................................................132
3.2.227 RETURN.........................................................................................................................................................................................................................132
3.2.228 REV_IN...........................................................................................................................................................................................................................132
3.2.229 REV_JOG....................................................................................................................................................................................................................... 133
3.2.230 REVERSE ......................................................................................................................................................................................................................133
3.2.231 RS_LIMIT .......................................................................................................................................................................................................................133
3.2.232 RUN................................................................................................................................................................................................................................133
3.2.233 RUN_ERROR.................................................................................................................................................................................................................134
3.2.234 RUNTYPE ......................................................................................................................................................................................................................134
3.2.235 S_REF ............................................................................................................................................................................................................................135
3.2.236 S_REF_OUT ..................................................................................................................................................................................................................135
3.2.237 SCOPE ...........................................................................................................................................................................................................................136
I52E-EN-03.book Seite 11 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 12
Revision 3.0
3.2.238 SCOPE_POS .................................................................................................................................................................................................................137
3.2.239 SELECT..........................................................................................................................................................................................................................137
3.2.240 SERVO ...........................................................................................................................................................................................................................137
3.2.241 SERVO_PERIOD ...........................................................................................................................................................................................................137
3.2.242 SET_BIT .........................................................................................................................................................................................................................138
3.2.243 SETCOM ........................................................................................................................................................................................................................138
3.2.244 SGN................................................................................................................................................................................................................................139
3.2.245 SIN..................................................................................................................................................................................................................................139
3.2.246 SLOT ..............................................................................................................................................................................................................................139
3.2.247 SPEED ...........................................................................................................................................................................................................................139
3.2.248 SQR................................................................................................................................................................................................................................140
3.2.249 SRAMP...........................................................................................................................................................................................................................140
3.2.250 STEP ..............................................................................................................................................................................................................................140
3.2.251 STEP_RATIO .................................................................................................................................................................................................................140
3.2.252 STEPLINE ......................................................................................................................................................................................................................141
3.2.253 STOP..............................................................................................................................................................................................................................141
3.2.254 SYSTEM_ERROR.......................................................................................................................................................................................................... 142
3.2.255 T_REF ............................................................................................................................................................................................................................142
3.2.256 TABLE ............................................................................................................................................................................................................................143
3.2.257 TABLEVALUES.............................................................................................................................................................................................................. 143
3.2.258 TAN ................................................................................................................................................................................................................................144
3.2.259 THEN..............................................................................................................................................................................................................................144
3.2.260 TICKS .............................................................................................................................................................................................................................144
3.2.261 TIME ...............................................................................................................................................................................................................................144
3.2.262 TIME$ .............................................................................................................................................................................................................................145
3.2.263 TO...................................................................................................................................................................................................................................145
3.2.264 TRANS_DPOS ...............................................................................................................................................................................................................145
3.2.265 TRIGGER .......................................................................................................................................................................................................................145
3.2.266 TROFF............................................................................................................................................................................................................................145
3.2.267 TRON .............................................................................................................................................................................................................................146
3.2.268 TRUE..............................................................................................................................................................................................................................146
3.2.269 TSIZE .............................................................................................................................................................................................................................146
3.2.270 UNITS.............................................................................................................................................................................................................................147
3.2.271 UNLOCK.........................................................................................................................................................................................................................147
3.2.272 UNTIL .............................................................................................................................................................................................................................147
3.2.273 VERIFY...........................................................................................................................................................................................................................147
3.2.274 VERSION .......................................................................................................................................................................................................................147
3.2.275 VFF_GAIN ......................................................................................................................................................................................................................148
3.2.276 VP_SPEED.....................................................................................................................................................................................................................148
3.2.277 VR...................................................................................................................................................................................................................................148
I52E-EN-03.book Seite 12 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 13
Revision 3.0
3.2.278 VRSTRING .....................................................................................................................................................................................................................149
3.2.279 WA..................................................................................................................................................................................................................................149
3.2.280 WAIT IDLE......................................................................................................................................................................................................................150
3.2.281 WAIT LOADED............................................................................................................................................................................................................... 150
3.2.282 WAIT UNTIL ...................................................................................................................................................................................................................150
3.2.283 WDOG ............................................................................................................................................................................................................................151
3.2.284 WHILE..WEND ...............................................................................................................................................................................................................151
3.2.285 XOR................................................................................................................................................................................................................................152
4 Communication protocols ...................................................................................................................................................................... 153
4.1 Available interfaces.......................................................................................................................................................................................................................153
4.2 Ethernet ......................................................................................................................................................................................................................................153
4.2.1 Communicate with Trajexia directly from your computer ............................................................................................................................................... 154
4.2.2 Communicate with Trajexia remotely .............................................................................................................................................................................155
4.2.3 Trajexia Tools protocol ................................................................................................................................................................................................156
4.2.4 FINS server protocol ...................................................................................................................................................................................................156
4.2.5 FINS client protocol ........................................................................................................................................................................................................158
4.3 Serial protocol ............................................................................................................................................................................................................................158
4.3.1 Host Link master ............................................................................................................................................................................................................158
4.3.2 Host Link slave ...........................................................................................................................................................................................................163
4.3.3 User-defined protocol ...................................................................................................................................................................................................165
4.4 PROFIBUS ..............................................................................................................................................................................................................................167
4.4.1 Introduction.....................................................................................................................................................................................................................167
4.4.2 Communication set-up....................................................................................................................................................................................................167
4.4.3 Communication Status ...................................................................................................................................................................................................172
4.5 DeviceNet .....................................................................................................................................................................................................................................173
4.5.1 Introduction.....................................................................................................................................................................................................................173
4.5.2 Communication set-up....................................................................................................................................................................................................173
4.5.3 Communication Status ..................................................................................................................................................................................................178
4.6 MECHATROLINK-II ................................................................................................................................................................................................................. 179
5 Trajexia Tools interface ........................................................................................................................................................................... 180
5.1 Introduction ................................................................................................................................................................................................................................... 180
5.2 Specifications and connections ....................................................................................................................................................................................................180
5.2.1 PC Specifications ..........................................................................................................................................................................................................180
5.2.2 Install the Trajexia Tools software ................................................................................................................................................................................. 181
5.2.3 Connection to the TJ1-MC__ .........................................................................................................................................................................................186
5.3 Projects ........................................................................................................................................................................................................................................191
5.3.1 Trajexia Tools Projects ...................................................................................................................................................................................................191
5.3.2 Check Project window ................................................................................................................................................................................................192
5.4 Trajexia Tools application window ...............................................................................................................................................................................................194
I52E-EN-03.book Seite 13 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 14
Revision 3.0
5.4.1 Control panel .................................................................................................................................................................................................................. 194
5.4.2 Menu bar ........................................................................................................................................................................................................................194
5.4.3 Toolbar ..........................................................................................................................................................................................................................195
5.5 Menu descriptions ........................................................................................................................................................................................................................196
5.5.1 Project menu ................................................................................................................................................................................................................ 196
5.5.2 Controller menu .............................................................................................................................................................................................................198
5.5.3 Program menu ............................................................................................................................................................................................................... 203
5.5.4 Tools menu .................................................................................................................................................................................................................... 205
5.5.5 Options menu ................................................................................................................................................................................................................221
5.5.6 Windows Menu ..............................................................................................................................................................................................................224
5.5.7 Help Menu .....................................................................................................................................................................................................................224
6 Examples and tips .................................................................................................................................................................................... 225
6.1 How-to’s ........................................................................................................................................................................................................................................ 225
6.1.1 Startup program .............................................................................................................................................................................................................225
6.1.2 Gain settings .................................................................................................................................................................................................................229
6.1.3 Setting the UNITS axis parameter and gear ratio...........................................................................................................................................................239
6.1.4 Mapping Servo Driver inputs and outputs ......................................................................................................................................................................251
6.1.5 Origin search ..................................................................................................................................................................................................................253
6.1.6 Registration ....................................................................................................................................................................................................................259
6.1.7 Tracing and monitoring...................................................................................................................................................................................................269
6.2 Practical examples........................................................................................................................................................................................................................279
6.2.1 Shell program ...............................................................................................................................................................................................................279
6.2.2 Initialization program ................................................................................................................................................................................................... 283
6.2.3 Single axis program ......................................................................................................................................................................................................286
6.2.4 Position with product detection ......................................................................................................................................................................................287
6.2.5 Position on a grid ..........................................................................................................................................................................................................289
6.2.6 Bag feeder program ......................................................................................................................................................................................................291
6.2.7 CAM table inside a program ........................................................................................................................................................................................ 293
6.2.8 Flying shear program ....................................................................................................................................................................................................295
6.2.9 Correction program .......................................................................................................................................................................................................298
7 Troubleshooting........................................................................................................................................................................................300
7.1 Voltage and analysis tools ............................................................................................................................................................................................................300
7.2 TJ1-MC__ ..................................................................................................................................................................................................................................... 300
7.2.1 System errors .................................................................................................................................................................................................................300
7.2.2 Axis errors ......................................................................................................................................................................................................................300
7.2.3 Unit errors....................................................................................................................................................................................................................... 301
7.2.4 Configuration errors........................................................................................................................................................................................................ 302
7.2.5 Replace the battery ........................................................................................................................................................................................................ 302
7.3 TJ1-PRT ....................................................................................................................................................................................................................................... 302
I52E-EN-03.book Seite 14 Freitag, 29. Juni 2007 11:55 11
Contents
PROGRAMMING MANUAL 15
Revision 3.0
7.3.1 System errors .................................................................................................................................................................................................................302
7.3.2 I/O data communication problems..................................................................................................................................................................................303
7.4 TJ1-DRT .......................................................................................................................................................................................................................................304
7.4.1 System errors .................................................................................................................................................................................................................304
7.4.2 I/O data communication problems..................................................................................................................................................................................304
7.5 TJ1-ML__......................................................................................................................................................................................................................................304
7.5.1 System errors .................................................................................................................................................................................................................304
7.5.2 Bus errors .......................................................................................................................................................................................................................304
7.6 TJ1-FL02 ...................................................................................................................................................................................................................................... 305
7.6.1 System errors .................................................................................................................................................................................................................305
I52E-EN-03.book Seite 15 Freitag, 29. Juni 2007 11:55 11
Safety warnings and precautions
PROGRAMMING MANUAL 16
Revision 3.0
1 Safety warnings and precautions
1.1 Intended audience
This manual is intended for personnel with knowledge of electrical systems (electrical engineers or the equivalent) who are responsible for the design, installation and management of factory automation systems and facilities.
1.2 General precautions
The user must operate the product according to the performance specifications described in this manual. Before using the product under conditions which are not described in the manual or applying the product to nuclear control systems, railroad systems, aviation systems, vehicles, safety equipment, petrochemical plants, and other systems, machines and equipment that can have a serious influence on lives and property if used improperly, consult your OMRON representative.
1.3 Safety precautions
WARNING
Do not attempt to take the Unit apart and do not touch any of the internal parts while power is being supplied. Doing so may result in electrical shock.
WARNING Do not touch any of the terminals or terminal blocks while power is being supplied. Doing so may result in electric shock.
WARNING Never short-circuit the positive and negative terminals of the bat­teries, charge the batteries, disassemble them, deform them by applying pressure, or throw them into a fire. The batteries may explode, combust or leak liquid.
WARNING Fail-safe measures must be taken by the customer to ensure safety in the event of incorrect, missing, or abnormal signals caused by broken signal lines, momentary power interruptions, or other causes. Not doing so may result in serious accidents.
WARNING Emergency stop circuits, interlock circuits, limit circuits, and similar safety measures must be provided by the customer as external cir­cuits, i.e., not in the Trajexia motion controller. Not doing so may result in serious accidents.
WARNING When the 24-VDC output (I/O power supply to the TJ1) is over­loaded or short-circuited, the voltage may drop and result in the outputs being turned off.As a countermeasure for such problems, external safety measures must be provided to ensure safety in the system.
WARNING The TJ1 outputs will go off due to overload of the output transistors (protection).As a countermeasure for such problems, external safety measures must be provided to ensure safety in the system.
I52E-EN-03.book Seite 16 Freitag, 29. Juni 2007 11:55 11
Safety warnings and precautions
PROGRAMMING MANUAL 17
Revision 3.0
1.4 Operating environment precautions
WARNING
The TJ1 will turn off the WDOG when its self-diagnosis function detects any error.As a countermeasure for such errors, external safety measures must be provided to ensure safety in the system.
WARNING Provide safety measures in external circuits, i.e., not in the Tra­jexia Motion Controller (referred to as "TJ1"), in order to ensure safety in the system if an abnormality occurs due to malfunction of the TJ1 or another external factor affecting the TJ1 operation. Not doing so may result in serious accidents.
WARNING Do not attempt to disassemble, repair, or modify any Units. Any attempt to do so may result in malfunction, fire, or electric shock.
Caution Confirm safety at the destination unit before transferring a program to another unit or editing the memory. Doing either of these without confirming safety may result in injury.
Caution User programs written to the Motion Control Unit will not be auto­matically backed up in the TJ1 flash memory (flash memory func­tion).
Caution Pay careful attention to the polarity (+/-) when wiring the DC power supply.A wrong connection may cause malfunction of the system.
Caution Tighten the screws on the terminal block of the Power Supply Unit to the torque specified in this manual. Loose screws may result in burning or malfunction.
Caution Do not operate the Unit in any of the following locations. Doing so may result in malfunction, electric shock, or burning.
- Locations subject to direct sunlight.
- Locations subject to temperatures or humidity outside the range specified in the specifications.
- Locations subject to condensation as the result of severe changes in temperature.
- Locations subject to corrosive or flammable gases.
- Locations subject to dust (especially iron dust) or salts.
- Locations subject to exposure to water, oil, or chemicals.
- Locations subject to shock or vibration.
Caution Take appropriate and sufficient countermeasures when installing systems in the following locations. Inappropriate and insufficient measures may result in malfunction.
- Locations subject to static electricity or other forms of noise.
- Locations subject to strong electromagnetic fields.
- Locations subject to possible exposure to radioactivity.
- Locations close to power supplies.
I52E-EN-03.book Seite 17 Freitag, 29. Juni 2007 11:55 11
Safety warnings and precautions
PROGRAMMING MANUAL 18
Revision 3.0
1.5 Application precautions
Caution
The operating environment of the TJ1 System can have a large effect on the longevity and reliability of the system. Improper operating environments can lead to malfunction, failure, and other unforeseeable problems with the TJ1 System. Make sure that the operating environment is within the specified conditions at installation and remains within the specified condi­tions during the life of the system.
WARNING Do not start the system until you check that the axes are present and of the correct type. The numbers of the Flexible axes will change if MECHATROLINK­II network errors occur during start-up or if the MECHATROLINK-II network configuration changes.
WARNING Check the user program for proper execution before actually run­ning it in the Unit. Not checking the program may result in an unexpected operation.
Caution Always use the power supply voltage specified in this manual. An incorrect voltage may result in malfunction or burning.
Caution Take appropriate measures to ensure that the specified power with the rated voltage and frequency is supplied. Be particularly careful in places where the power supply is unstable. An incorrect power supply may result in malfunction.
Caution Install external breakers and take other safety measures against short-circuiting in external wiring. Insufficient safety measures against short-circuiting may result in burning.
Caution Do not apply voltage to the Input Units in excess of the rated input voltage. Excess voltage may result in burning.
Caution Do not apply voltage or connect loads to the Output Units in excess of the maximum switching capacity. Excess voltage or loads may result in burning.
Caution Disconnect the functional ground terminal when performing with­stand voltage tests. Not disconnecting the functional ground terminal may result in burning.
I52E-EN-03.book Seite 18 Freitag, 29. Juni 2007 11:55 11
Safety warnings and precautions
PROGRAMMING MANUAL 19
Revision 3.0
Caution Always connect to a class-3 ground (to 100Ω or less) when install­ing the Units. Not connecting to a class-3 ground may result in electric shock.
Caution Always turn off the power supply to the system before attempting any of the following. Not turning off the power supply may result in malfunction or elec­tric shock.
- Mounting or dismounting expansion Units, CPU Units, or any other Units.
- Assembling the Units.
- Setting dipswitches or rotary switches.
- Connecting or wiring the cables.
- Connecting or disconnecting the connectors.
Caution Be sure that all mounting screws, terminal screws, and cable con­nector screws are tightened to the torque specified in this manual. Incorrect tightening torque may result in malfunction.
Caution Leave the dust protective label attached to the Unit when wiring. Removing the dust protective label may result in malfunction.
Caution Remove the dust protective label after the completion of wiring to ensure proper heat dissipation. Leaving the dust protective label attached may result in malfunc­tion.
Caution Use crimp terminals for wiring. Do not connect bare stranded wires directly to terminals. Connection of bare stranded wires may result in burning.
Caution Double-check all the wiring before turning on the power supply. Incorrect wiring may result in burning.
Caution Wire correctly. Incorrect wiring may result in burning.
Caution Mount the Unit only after checking the terminal block completely.
Caution
Be sure that the terminal blocks, expansion cables, and other items with locking devices are properly locked into place. Improper locking may result in malfunction.
I52E-EN-03.book Seite 19 Freitag, 29. Juni 2007 11:55 11
Safety warnings and precautions
PROGRAMMING MANUAL 20
Revision 3.0
Caution Confirm that no adverse effect will occur in the system before changing the operating mode of the system. Not doing so may result in an unexpected operation.
Caution Resume operation only after transferring to the new CPU Unit the contents of the VR and table memory required for operation. Not doing so may result in an unexpected operation.
Caution When replacing parts, be sure to confirm that the rating of a new part is correct. Not doing so may result in malfunction or burning.
Caution Do not pull on the cables or bend the cables beyond their natural limit. Doing so may break the cables.
Caution Before touching the system, be sure to first touch a grounded metallic object in order to discharge any static build-up. Otherwise it might result in a malfunction or damage.
Caution UTP cables are not shielded. In environments that are subject to noise use a system with shielded twisted-pair (STP) cable and hubs suitable for an FA environment. Do not install twisted-pair cables with high-voltage lines. Do not install twisted-pair cables near devices that generate noise. Do not install twisted-pair cables in locations that are subject to high humidity. Do not install twisted-pair cables in locations subject to excessive dirt and dust or to oil mist or other contaminants.
Caution Use the dedicated connecting cables specified in operation manu­als to connect the Units.Using commercially available RS-232C computer cables may cause failures in external devices or the Motion Control Unit.
Caution Outputs may remain on due to a malfunction in the built-in transis­tor outputs or other internal circuits.As a countermeasure for such problems, external safety measures must be provided to ensure the safety of the system.
Caution The TJ1 will start operating in RUN mode when the power is turned on and if a BASIC program is set to Auto Run mode.
I52E-EN-03.book Seite 20 Freitag, 29. Juni 2007 11:55 11
Safety warnings and precautions
PROGRAMMING MANUAL 21
Revision 3.0
1.6 Unit assembly precautions
Caution
Install the unit properly. Improper installation of the unit may result in malfunction.
Caution Be sure to mount the Termination Unit supplied with the TJ1­MC__ to the right most Unit. Unless the Termination Unit is properly mounted, the TJ1 will not function properly.
I52E-EN-03.book Seite 21 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 22
Revision 3.0
2 Trajexia system
2.1 Introduction
fig. 1
Trajexia is OMRON's motion platform that offers you the performance and the ease of use of a dedicated motion system.
Trajexia is a stand-alone modular system that allows maximum flexibility and scalability. At the heart of Trajexia lies the TJ1 multi­tasking motion coordinator. Powered by a 32-bit DSP, it can do motion tasks such as e-cam, e-gearbox, registration control and interpolation, all using simple motion commands.
Trajexia offers control of up to 16 axes over a MECHATROLINK-II motion bus or traditional analogue or pulse control with independent position, speed or torque control for every axis. And its powerful motion instruction set makes programming intuitive and easy.
You can select from a wide choice of best-in-class rotary, linear and direct-drive servos as well as inverters. The system is scalable up to 16 axes and 8 inverters & I/O modules.
NS-series HMI
CJ-series PLC CX-one
Trajexia Tools
PROFIBUS-DP
Master
DEVICENET
Master
Ethernet
Digital I/O
Hostlink
MECHATROLINK-II
I52E-EN-03.book Seite 22 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 23
Revision 3.0
2.1.1 Trajexia hardware
The Trajexia hardware is described in the Trajexia Hardware Reference manual. It is recommend to read the Hardware Reference manual first. The Trajexia system gives these advantages:
Direct connectivity via Ethernet
Trajexia's Ethernet built-in port provides direct and fast connectivity to PCs, PLCs, HMIs and other devices while providing full access to the drives over a MECHATROLINK-II motion bus. It allows explicit messaging over Ethernet and through MECHATROLINK-II to provide full transparency down to the actuator level, and making remote access possible.
Keep your know-how safe
Trajexia's encryption method guarantees complete protection and confidentiality for your valuable know-how.
Serial Port and Local I/Os
A serial port provides direct connectivity with any OMRON PLC, HMIs or any other field device. 16 Inputs and 8 outputs are freely configurable embedded I/Os in the controller to enable you to tailor Trajexia to your machine design.
MECHATROLINK-II Master
The MECHATROLINK-II master performs control of up to 16 servos, inverters or I/Os while allowing complete transparency across the whole system.MECHATROLINK-II offers the communication speed and time accuracy essential to guarantee perfect motion control of servos. The motion cycle time is selectable between 0.5 ms, 1 ms or 2 ms.
TJ1-FL02 (Flexible Axis Unit)
The TJ1-FL02 allows full control of two actuators via an analogue output or pulse train. The module supports the main absolute encoder protocols allowing the connection of an external encoder to the system.
Drives and Inverters
A wide choice of rotary, linear and direct-drive servos as well as inverters are available to fit your needs in compactness, performance and reliability. The inverters connected to the MECHATROLINK-II are driven at the same update cycle time as the servo drives.
Remote I/Os
The I/Os on the MECHATROLINK-II motion bus provide for system expansion while keeping the devices under one motion bus.
PROFIBUS-DP
The PROFIBUS-DP slave allows connectivity to the PROFIBUS network in your machine.
DeviceNet
The DeviceNet slave allows connectivity to the DeviceNet network in your machine.
2.1.2 This manual
This Programming Manual gives the dedicated information for:
The description and use of the BASIC commands
The communication protocols necessary for the Trajexia system
The use and description of the parts of the Trajexia Tools interface
Program examples and good programming practices
Troubleshooting and fault finding.
2.2 Multitasking BASIC programming
The TJ1-MC__ units (Motion Controller Unit) feature a multitasking version of the BASIC programming language. The motion control language is largely based upon a tokenised BASIC and the programs are compiled into the tokenised form prior to their execution.
I52E-EN-03.book Seite 23 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 24
Revision 3.0
Multitasking is simple to set up and use and allows very complex machines to be programmed. Multitasking gives the TJ1-MC__ a significant advantage over equivalent single task systems. It allows modular applications where the logically connected processes can be grouped together in the same task program, thus simplifying the code architecture and design. The TJ1-MC__ can hold up to 14 programs if memory size permits. The execution of the programs is user controlled using BASIC. The BASIC commands, functions and parameters presented here can be found in chapter 3.
2.3 BASIC programming
The BASIC language consists among others of commands, functions and parameters. These BASIC statements are the building blocks provided to control the TJ1-MC__ operation. Commands are words recognized by the processor that perform a certain action but do not return a value. For example, PRINT is a recognized word that will cause the value of the following functions or variables to be printed on a certain output device. Functions are words recognized by the processor that perform a certain action and return a value related to that action. For example, ABS will take the value of its parameter and return the absolute value of it to be used by some other function or command. For example ABS(-1) will return the value 1, which can be used by the PRINT command, for example, to generate a string to be output to a certain device. Parameters are words recognized by the processor that contain a certain value. This value can be read and, if not read only, written. Parameters are used to determine and monitor the behavior of the system. For example,
ACCEL determines the acceleration rate of a movement for a certain axis.
2.3.1 Axis, system and task statements
The commands, functions and parameters apply either to (one of) the axes, the tasks running or the general system.
Axis statements
The motion control commands and the axis parameters apply to one or more axes. Axis parameters determine and monitor how an axis reacts on commands given and how it reacts to the outside world. Every axis has a set of parameters, so that all axes can work independently of each other. The motion control commands are able to control one or more of the axes simultaneously, while every axis has its own behavior. The axis parameters are reset to their default values for each startup. The commands and parameters work on some base axis or group of axes, specified by the BASE command. The BASE command is used to change this base axis group and every task has its own group which can be changed at any time. The default base axis is 0. Individual axis dependent commands or parameters can also be programmed to work on a temporary base axis by including the AXIS function as a modifier in the axis dependent command. A temporary base axis is effective only for the command or parameter after which AXIS appears.
Task statements
The task parameters apply to a single task. The task parameters monitor the task for example for error handling. The PROC modifier allows the user to access a parameter of a certain task. Without PROC the current task is assumed. The BASE command (see above) is task specific and can be used with the PROC modifier.
System statements
These statements govern the overall system features, which are basically all statements which do not belong to the first two groups.
2.3.2 Memory areas
Three main memory areas can be identified in the Trajexia Motion Controller Unit:
I/O memory.
VR memory.
TABLE memory.
I52E-EN-03.book Seite 24 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 25
Revision 3.0
I/O memory
I/O memory is used for holding the status of input and output devices connected to the Trajexia system. It is divided into two sub-areas: one for digital I/O memory, and one for analog I/O memory. The digital I/O memory holds input and output statuses of digital I/O devices. Its capacity is 256 bits (input points) for input and 256 bits (output points) for outputs. The inputs in this memory can be accessed using the IN command. The outputs can be accessed using the OUT command. The analog I/O memory holds input and output values of analog I/O devices. Its capacity is 36 input channels and 36 output channels. The analog input channels can be accessed using the AIN command. The analog output channels can be accessed using the AOUT command.
VR memory
VR memory is commonly used if some data or value needs to be global, which means that it is accessible from all programs in the project at the same time. The size of this memory is 1024 slots with indexes 0 to 1023. A memory slot is addressed using the VR(x) macro where x is index of the VR memory slot. The VR memory is accessible for reading and writing. Writing is done by making mathematical assignment using the = command in the program. The content of this memory is held in the battery powered RAM memory and is preserved during power off. The VR memory is also preserved when changing the battery, if this is done quickly.
TABLE memory
TABLE is commonly used if some data or value needs to be global, which means that it is accessible from all programs in the project at the same time. Whereas the VR memory is used for similar purposes to define several global data and values, TABLE memory is used for much bigger amounts of global data, which also need to be arranged in a certain order. For this reason, TABLE memory is commonly used for storing TABLE data, motion profiles, logging data, etc. Some BASIC commands that provide this type and size of data, for example SCOPE, CAM, CAMBOX etc., require use of TABLE memory to write their results. The size of this memory is 64000 slots with indexes 0 to 63999. The TABLE is accessible for reading and writing too, but the way it is accessed differs for those two operations. Before being read, a particular TABLE memory slot needs to be defined and written first,
using the command TABLE(x, value1, value2,…) where x is the index of the start TABLE memory slot to define, and value1, value2, ... are the values written into the TABLE memory at indexes x, x+1, ... Once defined and written, the TABLE memory slot can be read using the TABLE( x) command, where x is the index of the TABLE memory slot. An attempt to read an undefined TABLE memory slot results in an error reported by the TJ1-MC__. The TABLE memory content is held in the battery powered RAM memory and is preserved during power off. The TABLE memory is also preserved when changing the battery, if this is done quickly.
2.3.3 Data structures and variables
BASIC programs can store numerical data in various types of variables. Some variables have predefined functions, such as the axis parameters and system parameters; other variables are available for the programmer to define as required in programming. The TABLE, global and local variables of the TJ1-MC__ are explained in this section. Furthermore also the use of labels will be specified.
TABLE variables
The TABLE is an array structure that contains a series of numbers. These numbers are used for instance to specify positions in the profile for a CAM or CAMBOX command. They can also be used to store data for later use, for example to store the parameters used to define a workpiece to be processed. The TABLE is common to all tasks on the TJ1-MC__. This means that the values written to the TABLE from one task can be read from other tasks. TABLE values can be written and read using the TA BLE command. The maximum length of the array is 64000 elements, from TABLE (0) to TABLE(63999). The TABLE array is initialized up to the highest defined element.
Global variables
The global variables, defined in VR memory, are common to all tasks on the TJ1-MC__. This means that if a program running on task 2 sets VR(25) to a certain value, then any other program running on a different task can read that same value from VR(25). This is very useful for synchronizing two or
I52E-EN-03.book Seite 25 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 26
Revision 3.0
more tasks, but care must be taken to avoid more than one program writing to the same variable at the same time. The controller has 1024 global variables, VR(0) to VR(1023). The variables are read and written using the
VR command.
Local variables
Named variables or local variables can be declared in programs and are local to the task. This means that two or more programs running on different tasks can use the same variable name, but their values can be different. Local variables cannot be read from any task except for the one in which they are declared. Local variables are always cleared when a program is started. The local variables can be cleared by using either the CLEAR or the RESET command. A maximum of 255 local variables can be declared. Only the first 16 characters of the name are significant. Undefined local variables will return zero. Local variables cannot be declared on the command line.
Labels
The BASIC programs are executed in descending order through the lines. Labels can be used to alter this execution flow using the BASIC commands GOTO and GOSUB. To define a label it must appear as the first statement on a line and it must be ended by a colon (:). Labels can be character strings of any length, but only the first 15 characters are significant.
Using variables and labels
Each task has its own local labels and local variables. For example, consider the two programs shown below:
/i
These two programs when run simultaneously in different tasks and have their own version of variable a and label start. If you need to hold data in common between two or more programs, VR variables should be used. Or alternatively if the large amount of data is to be held, the TABLE memory can be used. To make a program more readable when using a global VR variable, two approaches can be taken. The first is using a named local variable as a constant in the VR variable. The local constant variable, however, must be declared in each program using the global VR variable. Using this approach, the example below shows how to use VR(3) to hold a length parameter common for several programs:
/i
The other approach is even more readable and uses the GLOBAL command to declare the name as a reference to one of the global VR variables. The name can then be used from within the program containing the GLOBAL definition and all other programs. Take care that the program containing the GLOBAL definition must be run before the name is used in other programs. The best practice is to define global names in the start-up program. Using this approach, the example above becomes:
The TABLE and VR data can be accessed from the differ­ent running tasks. When using either VR or TABLE varia­bles, make sure to use only one task to write to one particular variable. This to avoid problems of two program tasks writing unexpectedly to one variable.
start: FOR a = 1 to 100 MOVE(a) WAIT IDLE NEXT a GOTO start
start: a=0 REPEAT a = a + 1 PRINT a UNTIL a = 300 GOTO start
start: GOSUB Initial VR(length) = x ... ...
Initial: length = 3 RETURN
start: GOSUB Initial MOVE(VR(length)) PRINT(VR(length)) ...
Initial: length = 3 RETURN
I52E-EN-03.book Seite 26 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 27
Revision 3.0
/i
2.3.4 Mathematical specifications
Number format
The TJ1-MC__ has two main formats for numeric values: single precision floating point and single precision integer. The single precision floating point format is internally a 32 bit value. It has an 8 bit exponent field, a sign bit and a 23 bit fraction field with an implicit 1 as the 24th bit. Floating point numbers have a valid range of ±5.9×10
39
to
±3.4×10
38
. Integers are essentially floating point numbers with a zero exponent. This implies that the integers are 24 bits wide. The integer range is therefore given from -16,777,216 to 16,777,215. Numeric values outside this range will be floating point.
Hexadecimal format
The TJ1-MC__ supports assigning and printing hexadecimal values. A hexadecimal number is input by prefixing the number with the $ character. Valid range is from 0x0 to 0xFFFFFF. Example:
>> VR(0)=$FF >> PRINT VR(0)
255.0000
A value can be printed in hexadecimal by using the HEX function. Negative values result in the 2’s complement hexadecimal value (24-bit). Valid range is from 8,388,608 to 16,777,215. Example:
>> TABLE(0,-10,65536) >> PRINT HEX(TABLE(0)),HEX(TABLE(1)) FFFFF6 10000
Positioning
For positioning, the TJ1-MC__ will round up if the fractional encoder edge distance calculated exceeds 0.9. Otherwise the fractional value will be rounded down. The internal measured position and demanded position of the axes, represented by the MPOS and DPOS axis parameters, have 32-bit counters.
Floating point comparison
The comparison function considers a small difference between values as equal to avoid unexpected comparison results. Therefore any two values for which the difference is less than 1.19×10
6
are considered equal.
Precedence
The precedence of the operators is given below:
1. Unary minus, NOT
2. ^
3. / *
4. MOD
5. + -
6. = <> > >= <= <
7. AND OR XOR
8. Left to right
The best way to ensure the precedence of various operators is through the use of parentheses.
'The declaration in start-up program GLOBAL length, 3
'In other programs executed after the start-up program
start: length = x ... ...
start: MOVE(length) PRINT(length) ...
All mathematical calculations are done in floating point format. This implies that for calculations of/with larger val­ues the results may have limited accuracy. The user should be aware of this when developing the motion con­trol application.
I52E-EN-03.book Seite 27 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 28
Revision 3.0
2.4 Motion execution
Every task on the TJ1-MC__ has a set of buffers that holds the information from the motion commands given.
2.4.1 Motion generator
The motion generator has a set of two motion buffers for each axis. One buffer called MTYPE, holds the Actual Move, which is the move currently executing on the axis. The other buffer called NTYPE, holds the Next Move, which is executed after the Actual Move has finished. See chapter 2.8 “Motion Buffers” in the Trajexia Hardware Reference manual for detailed explanation.
The BASIC programs are separate from the motion generator program, which controls moves for the axes. The motion generator has separate functions for each axis, so each axis is capable of being programmed with its own axis parameters (for example speed, acceleration) and moving independently and simultaneously or they can be linked together using special commands. When a move command is being processed, the motion generator waits until the move is finished and the buffer for the required axis has become empty, and then loads these buffers with the next move information.
I52E-EN-03.book Seite 28 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 29
Revision 3.0
fig. 2
2.4.2 Sequencing
On each servo cycle interrupt (see section 2.6.3), the motion generator examines the NTYPE buffers to see if any of them are available. If there are any available then it checks the task buffers to see if there is a move waiting to be loaded. If a move can be loaded, then the data for all the specified axes is loaded from the task buffers into the NTYPE buffers and the corresponding task buffers are marked as idle. This process is called sequencing.
2.4.3 Move loading
Once sequencing has been completed, the MTYPE buffers are checked to see if any moves can be loaded. If the required MTYPE buffers are available, then the move is loaded from the NTYPE buffers to the MTYPE buffers and the NTYPE buffers are marked as idle. This process is called move loading. If there is a valid move in the MTYPE buffers, then it is processed. When the move has been completed, the MTYPE buffers are marked as idle.
Move Loading
Sequencing
Axis
Task 1
MOVECIRC(..) AXIS(0) FORWARD AXIS(1)
MOVE(..) AXIS(0)
Task 2
Motion
Generator
Task 3
Next Move (NTYPE)
Move buffers
Task buffers
Next Move (NTYPE)
MOVE (1)
MOVECIRC (4)
FORWARD (10)
MOVECIRC (4)
IDLE (0)
IDLE (0)
012
If the task buffers are full, the program execution is paused until buffers are available again. This also applies to the command line task and no commands can be given for that period. Trajexia Tools will disconnect in such a case. The PMOVE task parameter will be set to TRUE when the task buffers are full and will be reset to FALSE when the task buffers are available again.
I52E-EN-03.book Seite 29 Freitag, 29. Juni 2007 11:55 11
Trajexia system
PROGRAMMING MANUAL 30
Revision 3.0
2.5 Command line interface
The command line interface provides a direct interface for the user to execute commands and access parameters on the system. Use the Terminal Window in Trajexia Tools when the TJ1-MC__ is connected. See section 5.5.4 for details. The TJ1-MC__ puts the last 10 commands given on the command line in a buffer. Pressing the Up and Down Cursor Key will cycle through the buffer to execute the command again.
2.6 BASIC programs
The TJ1-MC__ can store up to 14 programs in memory, provided the capacity of memory is not exceeded. The TJ1-MC__ supports simple file­handling instructions for managing these program files rather like the DOS filing system on a computer. The Trajexia Tools software package is used to store and load programs to and from a computer for archiving, printing and editing. It also has several controller monitor and debugging facilities. Refer to chapter 5.
2.6.1 Managing programs
Trajexia Tools automatically creates a project which contains the programs to be used for an application. The programs of the project are kept both in the controller and on the computer. Whenever a program is created or edited, Trajexia Tools edits both copies in order to always have an accurate backup outside the controller at any time. Trajexia Tools checks that the two versions of the project are identical using a cyclic redundancy check. If the two differ, Trajexia Tools allows copying the TJ1-MC__ version to disk or vice versa. Programs on the computer are stored in ASCII text files. They may therefore be printed, edited and copied using a simple text editor. The source programs are held in the TJ1-MC__ in a tokenised form and as a result, the sizes of the programs will be less on the TJ1-MC__ compared to the same programs on the computer.
Storing programs
Programs in the TJ1-MC__ are held in the battery powered RAM memory and are preserved during power off. This is similar to VR and TABLE memory. The content of the program RAM memory is preserved when the battery is in the TJ1-MC__. The programs are also preserved when changing the battery, if this is done quickly. To preserve programs without the battery for a longer period, the current programs must be copied to the Flash memory of the controller using the EPROM command, and read back during power up, which is determined by the POWER_UP system parameter.
Program commands
The TJ1-MC__ has a number of BASIC commands to allow creation, manipulation and deletion of programs. Trajexia Tools provides buttons which also perform these operations, so the use of those commands is normally not required in the programs.
/i
Command Function
SELECT Selects a program for editing, deleting etc.
NEW Deletes the current selected program, a specified program or all programs.
DIR Lists the directory of all programs.
COPY Duplicates a specified program.
RENAME Renames a specified program.
DEL Deletes the current selected program or a specified program.
LIST Lists the current selected program or a specified program.
I52E-EN-03.book Seite 30 Freitag, 29. Juni 2007 11:55 11
Loading...
+ 282 hidden pages