Omron TJ2-MC64 - PROGRAMMING, TJ1-PRT, TJ1-DRT, TJ1-CORT, TJ1-ML 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. I58E-EN-01
PROGRAMMING MANUAL III
Revision 1.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. CANopen is a registered trademark of CAN in Automation (CiA). ModbusTCP is a registered trademark of Modbus IDA. Trajexia is a registered trademark of OMRON. All other product names, company names, logos or other designations mentioned herein are trademarks of their respective owners.
/i
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, 2010
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.
PROGRAMMING MANUAL IV
Revision 1.0
About this manual
This manual describes the installation and operation of the Trajexia Machine 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 Machine Control units. Be sure to read the precautions provided in the following section.
/i
Name Cat. No. Contents
Trajexia motion con­trol system QUICK START GUIDE
I50E Describes how to get quickly familiar
with Trajexia, moving a single axis using MECHATROLINK-II, in a test set-up.
Trajexia machine control system HARDWARE REF­ERENCE MANUAL
I57E Describes the installation and hardware
specification of the Trajexia units, and explains the Trajexia system philosophy.
Trajexia machine control system PROGRAMMING MANUAL
I58E Describes the BASIC commands to be
used for programming Trajexia, commu­nication protocols and Trajexia Studio software, gives practical examples and troubleshooting information.
Sigma-II Servo Drive manual
SIEP S800000 15 Describes the installation and operation
of Sigma-II Servo Drives
Sigma-III with MECHATROLINK interface manual
SIEP S800000 11 Describes the installation and operation
of Sigma-III Servo Drives with MECHA­TROLINK-II interface
Sigma-V Servo Drive manual
SIEP S800000-44 SIEP S800000-46 SIEP S800000-48
Describes the installation and operation of Sigma-V Servo Drives
JUNMA series servo drive manual
TOEP-C71080603 01-OY Describes the installation and operation
of JUNMA Servo Drives
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
JUSP-NS115 man­ual
SIEP C71080001 Describes the installation and operation
of the MECHATROLINK-II application module
SI-T MECHATRO­LINK interface for the G7 & F7
SIBP-C730600-08 Describes the installation and operation
of MECHATROLINK-II interfaces for G7 and F7 Inverters
ST-T/V7 MECHA­TROLINK interface for the V7
SIBP-C730600-03 Describes the installation and operation
of MECHATROLINK-II interfaces for V7 Inverters
MECHATROLINK IO Modules
SIE C887-5 Describes the installation and operation
of MECHATROLINK-II input and output modules and the MECHATROLINK-II repeater
SYSMAC CS/CJ Series Communica­tions Commands
W342 Describes FINS communications proto-
col and FINS commands
Omron Smartslice GRT1-Series, slice I/ O units, Operation manual
W455-E1 Describes the installation and operation
of Omron slice I/O units
Omron G-series user’s manual
I566-E1 Describes the installation and operation
of G-series Servo Drives
Omron Accurax G5 user’s manual
I572-E1 Describes the installation and operation
of Accurax Servo Drives
Trajexia Studio user manual
I56E-EN Describes the use of Trajexia Studio
programming software
Name Cat. No. Contents
PROGRAMMING MANUAL V
Revision 1.0
Functions supported by unit versions
During the development of Trajexia new functionality will be 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 TJ2-MC64.
/i
Verify the firmware and FPGA versions of the TJ2-MC64
Connect the TJ2-MC64 to Trajexia Studio 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 TJ2-MC64.
WARNING
Failure to read and understand the information provided in this manual may result in personal injury or death, damage to the pro­duct, 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.
Functionality TJ2-MC64 Firmware
version
TJ2-MC64 FPGA version
Initial release V2.00xx 7
Contents
PROGRAMMING MANUAL VI
Revision 1.0
1 Safety warnings and precautions................................................................................................................................................................1
1.1 Intended audience ............................................................................................................................................................................................................................1
1.2 General precautions .........................................................................................................................................................................................................................1
1.3 Safety precautions ...........................................................................................................................................................................................................................1
1.4 Operating environment precautions..................................................................................................................................................................................................2
1.5 Application precautions.....................................................................................................................................................................................................................3
1.6 Unit assembly precautions................................................................................................................................................................................................................ 5
2 Trajexia system ...........................................................................................................................................................................................6
2.1 Introduction .......................................................................................................................................................................................................................................6
2.2 Multitasking BASIC programming.....................................................................................................................................................................................................8
2.3 BASIC programming .........................................................................................................................................................................................................................9
2.4 Motion execution.............................................................................................................................................................................................................................14
2.5 Command line interface ..................................................................................................................................................................................................................15
2.6 BASIC programs .............................................................................................................................................................................................................................15
3 BASIC commands ......................................................................................................................................................................................17
3.1 Categories ......................................................................................................................................................................................................................................17
3.2 All BASIC commands .....................................................................................................................................................................................................................26
4 Communication protocols ......................................................................................................................................................................204
4.1 Available interfaces.......................................................................................................................................................................................................................204
4.2 Ethernet .................................................................................................................................................................................................................................... 204
4.3 Serial protocol ........................................................................................................................................................................................................................... 212
4.4 PROFIBUS ...................................................................................................................................................................................................................................221
4.5 DeviceNet ..................................................................................................................................................................................................................................... 226
4.6 CANopen ...................................................................................................................................................................................................................................... 232
4.7 MECHATROLINK-II ................................................................................................................................................................................................................237
4.8 GRT1-ML2 I/O mapping ...............................................................................................................................................................................................................237
5 Examples and tips ....................................................................................................................................................................................245
5.1 How-to’s........................................................................................................................................................................................................................................245
5.2 Practical examples........................................................................................................................................................................................................................306
Contents
PROGRAMMING MANUAL VII
Revision 1.0
6 Troubleshooting........................................................................................................................................................................................341
6.1 Voltage and analysis tools ............................................................................................................................................................................................................341
6.2 TJ2-MC64 .....................................................................................................................................................................................................................................341
6.3 TJ1-PRT .......................................................................................................................................................................................................................................344
6.4 TJ1-DRT ....................................................................................................................................................................................................................................... 345
6.5 TJ1-CORT ....................................................................................................................................................................................................................................345
6.6 TJ1-ML__......................................................................................................................................................................................................................................346
6.7 GRT1-ML2 ....................................................................................................................................................................................................................................346
6.8 TJ1-FL02 ......................................................................................................................................................................................................................................349
A GRT1-ML2 timing......................................................................................................................................................................................350
A.1 Timing concepts............................................................................................................................................................................................................................350
A.2 Examples ......................................................................................................................................................................................................................................352
Revision history ..............................................................................................................................................................................................355
Safety warnings and precautions
PROGRAMMING MANUAL 1
Revision 1.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 TJ2) 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 TJ2 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.
Safety warnings and precautions
PROGRAMMING MANUAL 2
Revision 1.0
1.4 Operating environment precautions
WARNING
The TJ2 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 Machine Controller (referred to as "TJ2"), in order to ensure safety in the system if an abnormality occurs due to malfunction of the TJ2 or another external factor affecting the TJ2 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
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.
Caution
The operating environment of the TJ2 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 TJ2 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.
Safety warnings and precautions
PROGRAMMING MANUAL 3
Revision 1.0
1.5 Application precautions
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
When using multiple TJ1-ML__ units, do not swap the MECHA­TROLINK-cables. This can result in different axis allocation. This can result in serious injury and/or significant damage.
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.
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.
Safety warnings and precautions
PROGRAMMING MANUAL 4
Revision 1.0
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.
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.
Safety warnings and precautions
PROGRAMMING MANUAL 5
Revision 1.0
1.6 Unit assembly precautions
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 TJ2 will start operating in RUN mode when the power is turned on and if a BASIC program is set to Auto Run mode.
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 TJ2­MC__ to the right most Unit. Unless the Termination Unit is properly mounted, the TJ2 will not function properly.
Trajexia system
PROGRAMMING MANUAL 6
Revision 1.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 TJ2 multi-tasking machine controller. Powered by a 64-bit processor, it can do motion tasks such as e­cam, e-gearbox, registration control and interpolation, all using simple motion commands.
The TJ2-MC64 offers control of up to 64 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 Servo systems as well as Inverters. The system is scalable up to 64 axes and 8 Inverters & I/O modules.
The TJ2-MC64 also contains an IEC 61131-3 compliant soft PLC, capable of controlling I/O and performing motion.
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 built-in Ethernet interface provides direct and fast connectivity to PCs, PLCs, HMIs and other devices while providing full access to the CPU and to the Drives over a MECHATROLINK-II motion bus. It allows explicit
NS-series HMI
CJ-series PLC CX-one
Trajexia Tools
PROFIBUS-DP
Master
DEVICENET
Master
CANopen
Master
Ethernet
Digital I/O
Hostlink
MECHATROLINK-II
Trajexia system
PROGRAMMING MANUAL 7
Revision 1.0
messaging over Ethernet and through MECHATROLINK-II to provide full transparency down to the actuator level, and making remote access possible.
Trajexia system
PROGRAMMING MANUAL 8
Revision 1.0
Keep your know-how safe
By preventing access to the programs in the controller Trajexia 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 Servo Drives, 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 Servo Drives. 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 Servo systems 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.
CANopen
The CANopen master allows connectivity to the CANopen network in your machine.
Modbus
Both ModbusRTU via serial and ModbusTCP via Ethernet are supported to be able to connect to masters supporting the same interface.
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 Studio interface
Program examples and good programming practices
Troubleshooting and fault finding.
2.2 Multitasking BASIC programming
The TJ2-MC64 units (Machine 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. Multitasking is simple to set up and use and allows very complex machines to be programmed. Multitasking gives the TJ2-MC64 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 TJ2-MC64 can hold up to 32 programs if memory size permits. Up to 22 programs can be run simultaneously. The execution of the programs is user controlled using BASIC. The BASIC commands, functions and parameters presented here can be found in chapter 3.
Trajexia system
PROGRAMMING MANUAL 9
Revision 1.0
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 TJ2-MC64 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.
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.
Trajexia system
PROGRAMMING MANUAL 10
Revision 1.0
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 64,000 slots with indexes 0 to 63,999. 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 500,000 slots with indexes 0 to 499,999. 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 TAB LE(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 TJ2-MC64. The first 65,536 TABLE memory entries are held in the battery powered RAM memory and is preserved during power off. This part of 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 TJ2-MC64 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 TJ2-MC64. 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 TABLE command. The maximum length of the array is 500,000 elements, from TABLE(0) to TABLE(499999). 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 TJ2-MC64. 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 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 64,000 global variables, VR(0) to VR(63999). The variables are read and written using the VR command.
Trajexia system
PROGRAMMING MANUAL 11
Revision 1.0
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 1024 local variables can be declared. Only the first 32 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 32 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:
Note
The TABLE and VR data can be accessed from the different run­ning tasks. When using either VR or TABLE variables, 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
Trajexia system
PROGRAMMING MANUAL 12
Revision 1.0
/i
'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) ...
Trajexia system
PROGRAMMING MANUAL 13
Revision 1.0
2.3.4 Mathematical specifications
Number format
The TJ2-MC64 has two main formats for numeric values: double precision floating point and double precision integer. The double precision floating point format is internally a 64 bit value. It has an 11 bit exponent field, a sign bit and a 52 bit fraction field. Floating point numbers have a valid range of ±2.2×10
308
to ±1.8×10
308
. Integers are essentially floating point numbers with a zero exponent. This implies that the integers are 53 bits wide. The integer range is therefore given from -9,007,199,254,740,992 to 9,007,199,254,740,991. Numeric values outside this range will be floating point.
Hexadecimal format
The TJ2-MC64 supports assigning and printing hexadecimal values. A hexadecimal number is input by prefixing the number with the $ character. Valid range is from 0x0 to 0xFFFFFFFFFFFFF. 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 (53-bit). Valid range is from xxx to xxx. Example:
>> TABLE(0,-10,65536) >> PRINT HEX(TABLE(0)),HEX(TABLE(1)) 1FFFFFFFFFFFF6 10000
Positioning
For positioning, the TJ2-MC64 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 xxx­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 <EXOO>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.
WARNING
All mathematical calculations are done in floating point format. This implies that for calculations of/with larger values the results may have limited accuracy. The user should be aware of this when developing the motion control application.
Trajexia system
PROGRAMMING MANUAL 14
Revision 1.0
2.4 Motion execution
Every task on the TJ2-MC64 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 up to 64 motion buffers for each axis. One buffer called MTYPE, holds the Actual Move, which is the move currently executing on the axis. The next 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.
fig. 2
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
Note
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 Stu­dio 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.
Trajexia system
PROGRAMMING MANUAL 15
Revision 1.0
2.4.2 Sequencing
On each servo cycle interrupt (see section 2.6.2), 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.
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 Studio when the TJ2-MC64 is connected. The TJ2-MC64 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 TJ2-MC64 can store up to 32 programs in memory, provided the capacity of memory is not exceeded. The TJ2-MC64 supports simple file­handling instructions for managing these program files rather like the DOS filing system on a computer.
The Trajexia Studio 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.
2.6.1 Managing programs
The Trajexia Studio 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. For more information please refer to the Trajexia Studio user manual.
Storing programs
Programs in the TJ2-MC64 are stored automatically in Flash-ROM memory and therefore do not rely on the battery.
2.6.2 Program execution
The timing of the execution for the different tasks and the refreshing of the I/ O of the TJ2-MC64 revolves around the servo cycle period of the system. The servo cycle period is determined by the SERVO_PERIOD system parameter. The TJ2-MC64 will either have a servo cycle period of 0.25, 0.5,
1.0 or 2.0 ms.
I/O refresh
The I/O status of the TJ2-MC64 is refreshed at the beginning of every cycle time.
The captured status of the digital inputs is transferred to the IN system input variable. Note that this is the status captured in the previous servo cycle.
The analogue outputs for the speed references are updated.
The digital outputs are updated conform the status of the OP system output variable.
The status of the digital inputs is captured.
Trajexia system
PROGRAMMING MANUAL 16
Revision 1.0
Note that no automatic processing of the I/O signals is taking place, except for registration. This implies that all actions must be programmed in the BASIC programs.
Relevant commands
Trajexia Studio provides several ways of executing, pausing and stopping the programs using buttons on the control panel and the editing windows. The following commands can be given on the command line to control the execution.
/i
The user can explicitly allocate the task priority on which the BASIC program is expected to run. When a user program is run without explicit task allocation, it is assigned the highest available task priority.
Setting programs to run at start-up
Programs can be set to run automatically at different priorities when power is turned on. If required, the computer can be left connected as an operator interface or may be removed and the programs run stand-alone. Programs are set in Trajexia Studio to run automatically at start-up by setting the startup priority with the Priority property in the Properties window. If you click the ellipsis button in the edit field of this property, the StartUp Priority window shows. To set the program to run at power up, select the Run at Power Up check box and select a priority in the list. Possible priority values are Default or 0 (lowest priority) to 21 (highest priority).The current status in the controller can be seen using the DIR command. For more information on program control, multitasking and cycle times, refer to sections 2.2 and 2.3 of the Trajexia Hardware Reference Manual.
Command Function
RUN Run the current selected program or a specified program, optionally on a
specified task number.
STOP Stop the current selected program or a specified program.
HALT Stop all programs on the system.
PROCESS Displays all running tasks.
BASIC commands
PROGRAMMING MANUAL 17
Revision 1.0
3 BASIC commands
3.1 Categories
This section lists all BASIC commands divided by categories. The categories are:
Axis commands.
•Axis parameters.
Communication commands and parameters.
Constants.
I/O commands, functions and parameters.
Mathematical functions and operations.
Program commands.
Program control commands.
Slot parameters and modifiers.
System commands and functions.
System parameters.
Task commands and parameters.
The lists are quick reference guides only. A complete description of the commands is given in alphabetical order in the next section.
3.1.1 Axis commands
/i
Name Description
ACC Changes the ACCEL and DECEL at the same time.
ADD_DAC Sum to the DAC value of one axis to the analogue output of the
base axis.
ADDAX Sets a link to a superimposed axis. All demand position movements
for the superimposed axis will be added to any moves that are cur­rently being executed.
BACKLASH Allows the backlash compensation to be loaded.
BASE Used to set the base axis to which the commands and parameters
are applied.
CAM Moves an axis according to values of a movement profile stored in
the TABLE variable array.
CAMBOX Moves an axis according to values of a movement profile stored in
the TABLE variable array. The motion is linked to the measured motion of another axis to form a continuously variable software gear­box.
CANCEL Cancels the move on an axis.
CONNECT Connects the demand position of an axis to the measured move-
ments of an other axis to produce an electronic gearbox.
DATUM Performs one of 7 origin search sequences to position an axis to an
absolute position or reset a motion error.
DEFPOS Defines the current position as a new absolute position.
DISABLE_GROUP Groups axes together for error disabling.
DRIVE_ALARM Monitors the current alarm.
DRIVE_CLEAR Clears the alarm status of the Servo Drive.
DRIVE_READ Reads the specified parameter of the Servo Drive.
DRIVE_RESET Resets the Servo Drive.
DRIVE_WRITE Writes a specific value to the specified parameter of the Servo Drive.
ENCODER_READ Reads a parameter of the EnDat absolute encoder.
ENCODER_WRITE Writes to a parameter of the EnDat absolute encoder.
FORWARD Moves an axis continuously forward at the speed set in the SPEED
parameter.
MECHATROLINK Initializes MECHATROLINK-II bus and performs various operations
on MECHATROLINK-II stations connected to the bus.
MHELICAL Interpolates 3 orthogonal axes in a helical move.
MHELICALSP Forced speed version of the MHELICAL command.
MOVE Moves one or more axes at the demand speed, acceleration and
deceleration to the position specified as increment from the current position.
Name Description
BASIC commands
PROGRAMMING MANUAL 18
Revision 1.0
3.1.2 Axis parameters
/i
MOVEABS Moves one or more axes at the demand speed, acceleration and
deceleration to the position specified as absolute position.
MOVEABSSP Forced speed version of the MOVEABS command.
MOVECIRC Interpolates 2 orthogonal axes in a circular arc.
MOVECIRCSP Forced speed version of the MOVECIRC command.
MOVELINK Creates a linear move on the base axis linked via a software gear-
box to the measured position of a link axis.
MOVEMODIFY Changes the absolute end position of the current single-axis linear
move (MOVE or MOVEABS).
MOVESP Forced speed version of the MOVE command.
MOVETANG Performs a Tangential move.
MSPHERICAL Moves a group of three axes along a spherical path.
RAPIDSTOP Cancels the current move on all axes.
REGIST Captures an axis position when a registration input or the Z mark on
the encoder is detected.
REVERSE Moves an axis continuously in reverse at the speed set in the
SPEED parameter.
SPHERE_CENTRE Returns the co-ordinates of the centre point (x, y, z) of the most
recent MSPHERICAL.
STEP_RATIO Sets the ratio for the axis stepper output.
Name Description
Name Description
ACCEL Contains the axis acceleration rate.
ADDAX_AXIS Contains the number of the axis to which the base axis is cur-
rently linked to by ADDAX.
ATYPE Contains the axis type.
AXIS_DISPLAY Selects information that are represented by the LEDs on the
front cover of the TJ1-FL02.
AXIS_ENABLE Enables and disables particular axis independently of other axis.
AXISSTATUS Contains the axis status.
BACKLASH_DIST Defines the amount of backlash compensation.
CHANGE_DIR_LAST Defines the change in direction in radians of the last pro-
grammed MOVESP/MOVEABSSP/MOVECIRCSP move of 2 or more axes.
CLOSE_WIN Defines the end of the window in which a registration mark is
expected.
CLUTCH_RATE Defines the change in connection ratio when using the
CONNECT command.
CORNER_STATE Allows a BASIC program to interact with the move loading proc-
ess to facilitate knife rotation at sharp corners.
CREEP Contains the creep speed.
D_GAIN Contains the derivative control gain.
DAC_SCALE Sets scale and polarity applied to DAC values.
DATUM_IN Contains the input number to be used as the origin input.
DECEL Contains the axis deceleration rate.
DECEL_ANGLE Defines the angle change in radians above which an X-Y sys-
tem should start to decelerate.
DEMAND_EDGES Contains the current value of the DPOS axis parameter in
encoder edges.
BASIC commands
PROGRAMMING MANUAL 19
Revision 1.0
DPOS Contains the demand position generated by the move com-
mands.
DRIVE_CONTROL Selects data to be monitored using DRIVE_MONITOR for axes
connected via the MECHATROLINK-II bus. For axes connected via the TJ1-FL02, DRIVE_CONTROL sets outputs of the TJ1­FL02.
DRIVE_INPUTS Holds I/O data of the Drive connected to MECHATROLINK-II
bus. Data is updated every servo cycle.
DRIVE_MONITOR Monitors data of the Servo Drive connected to MECHATRO-
LINK-II bus. Data are updated every servo cycle.
DRIVE_STATUS Contains the current status of the Servo Drive.
ENCODER Contains a raw copy of the encoder hardware register.
ENCODER_BITS Sets the number of bits for the absolute encoder connected to
TJ1-FL02.
ENCODER_CONTROL Controls operating mode of the EnDat absolute encoder.
ENCODER_ID Returns the ID value of the absolute encoder connected to TJ1-
FL02.
ENCODER_RATIO Sets scaling value for incoming encoder counts.
ENCODER_STATUS Returns the status of the Tamagawa absolute encoder.
ENCODER_TURNS Returns the multi-turn count of the absolute encoder.
END_DIR_LAST Defines the end direction in radians of the last programmed
forced speed move of 2 or more axes.
ENDMOVE Holds the position of the end of the current move.
ENDMOVE_BUFFER Holds the absolute position at the end of the buffered sequence.
ENDMOVE_SPEED Contains the ramp to exit speed when forced speed moves are
loaded.
ERRORMASK Contains the mask value that determines if MOTION_ERROR
occurs depending on the axis status.
FAST _JOG Contains the input number to be used as the fast jog input.
Name Description
FAS TDEC Defines ramp to zero deceleration ratio when an axis limit switch
or position is reached.
FE Contains the Following Error.
FE_LATCH Contains the FE value which caused the axis to put controller in
MOTION_ERROR state.
FE_LIMIT Contains the maximum allowable Following Error.
FE_LIMIT_MODE Defines how FE influences MOTION_ERROR state.
FE_RANGE Contains the Following Error warning range limit.
FHOLD_IN Contains the input number to be used as the feedhold input.
FHSPEED Contains the feedhold speed.
FORCE_SPEED Contains the speed when forced speed moves are loaded.
FS_LIMIT Contains the absolute position of the forward software limit.
FULL_SP_RADIUS Contains the full speed radius in user UNITS.
FWD_IN Contains the input number to be used as a forward limit input.
FWD_JOG Contains the input number to be used as a jog forward input.
I_GAIN Contains the integral control gain.
INVERT_STEP Switches a hardware Inverter into the stepper output circuit.
JOGSPEED Sets the jog speed.
LIMIT_BUFFERED Contains the maximum number of move buffers available in the
controller.
MARK Detects the primary registration event on a registration input.
MARKB Detects the secondary registration event on a registration input.
MERGE Is a software switch that can be used to enable or disable the
merging of consecutive moves.
MOVES_BUFFERED Holds the number of moves being buffered by the axis.
MPOS Is the position of the axis as measured by the encoder.
MSPEED Represents the change in the measured position in the last
servo period.
Name Description
BASIC commands
PROGRAMMING MANUAL 20
Revision 1.0
MTYPE Contains the type of move currently being executed.
NTYPE Contains the type of the move in the Next Move buffer.
OFFPOS Contains an offset that will be applied to the demand position
without affecting the move in any other way.
OPEN_WIN Defines the beginning of the window in which a registration
mark is expected.
OUTLIMIT Contains the limit that restricts the speed reference output from
the TJ2-MC64.
OV_GAIN Contains the output velocity control gain.
P_GAIN Contains the proportional control gain.
RAISE_ANGLE Defines the angle change in radians above which an X-Y sys-
tem will interact with a BASIC program.
REG_POS Contains the position at which the (primary) registration event
occurred.
REG_POSB Contains the position at which the secondary registration event
occurred.
REGIST_SPEED Contains the speed when the (primary) registration event
occurred.
REGIST_SPEEDB Contains the speed when the secondary registration event
occurred.
REMAIN Is the distance remaining to the end of the current move.
REP_DIST Contains or sets the repeat distance.
REP_OPTION Controls the application of the REP_DIST axis parameter.
REV_IN Contains the input number to be used as a reverse limit input.
REV_JOG Contains the input number to be used as a jog reverse input.
RS_LIMIT Contains the absolute position of the reverse software limit.
S_REF Contains the speed reference value which is applied when the
axis is in open loop.
S_REF_OUT Contains the speed reference value being applied to the Servo
Drive for both open as closed loop.
Name Description
SERVO Determines whether the axis runs under servo control or open
loop.
SPEED Contains the demand speed in units/s.
SPEED_SIGN Configures the voltage range of the analog speed reference out-
put of the TJ1-FL02.
SRAMP Contains the S-curve factor.
START_DIR_LAST Defines the start direction in radians of the last programmed
forced speed move of 2 or more axes.
STOP_ANGLE Defines the angle change in radians above which an X-Y sys-
tem should decelerate to zero speed.
T_REF Contains the torque reference value which is applied to the
servo motor.
TABLE_POINTER Parmeter to determine which TABLE memory location is cur-
rently being used by the CAM.
TANG_DIRECTION Parameter returns the angle in radians that represents the vec-
tor direction of the interpolated axes.
TRANS_DPOS Contains axis demand position at output of frame transforma-
tion.
UNITS Contains the unit conversion factor.
VECTOR_BUFFERED Holds the total vector length of the buffered moves.
VFF_GAIN Contains the speed feed forward control gain.
VP_SPEED Contains the speed profile speed.
Name Description
BASIC commands
PROGRAMMING MANUAL 21
Revision 1.0
3.1.3 Communication commands and parameters
/i
3.1.4 Constants
/i
3.1.5 I/O commands, functions and parameters
/i
3.1.6 Mathematical functions and operands
/i
Name Description
FINS_COMMS Sends FINS Read Memory and Write Memory to a designated
FINS server unit.
GET Waits for the arrival of a single character and assigns the ASCII
code of the character to variable.
HLM_COMMAND Executes a specific Host Link command to the Slave.
HLM_READ Reads data from the Host Link Slave to either VR or TABLE var-
iable array.
HLM_STATUS Represents the status of the last Host Link Master command.
HLM_TIMEOUT Defines the Host Link Master timeout time.
HLM_WRITE Writes data to the Host Link Slave from either VR or TABLE var-
iable array.
HLS_NODE Defines the Slave unit number for the Host Link Slave protocol.
INDEVICE Parameter defines the default input device.
INPUT Waits for a string to be received and assigns the numerical value
to variable.
KEY Returns TRUE or FALSE depending on if character is received.
LINPUT Waits for a string and puts it in VR variables.
OUTDEVICE Defines the default output device.
PRINT Outputs a series of characters to a serial port.
SETCOM Sets the serial communications.
Name Description
FALS E Equal to the numerical value 0.
OFF Equal to the numerical value 0.
ON Equal to the numerical value 1.
PI Equal to the numerical value 3.1416.
TRUE Equal to the numerical value -1.
Name Description
AIN Holds the value of the analog channel.
AOUT Holds the value of the analog channel.
HW_PSWITCH Sets on and off the hardware switch on output 0 of the TJ1-FL02
when predefined positions are reached.
IN Returns the value of digital inputs.
OP Sets one or more outputs or returns the state of the first 24 out-
puts.
PSWITCH Turns on an output when a predefined position is reached, and
turns off the output when a second position is reached.
READ_OP Returns the value of the digital outputs.
Name Description
+ (ADDITION) Adds two expressions.
- (SUBTRACTION) Subtracts two expressions.
* (MULTIPLICATION) Multiplies two expressions.
/ (DIVISION) Divides two expressions.
^ (POWER) Takes the power of one expression to the other expression.
= (IS EQUAL TO) Checks two expressions to see if they are equal.
= (ASSIGNMENT) Assigns an expression to a variable.
Name Description
BASIC commands
PROGRAMMING MANUAL 22
Revision 1.0
3.1.7 Program commands
/i
<> (IS NOT EQUAL TO)
Checks two expressions to see if they are different.
> (IS GREATER THAN) Checks two expressions to see if the expression on the left is
greater than the expression on the right.
>= (IS GREATER THAN OR EQUAL TO)
Checks two expressions to see if the expression on the left is greater than or equal to the expression on the right.
< (IS LESS THAN) Checks two expressions to see if the expression on the left is
less than the expression on the right.
<= (IS LESS THAN OR EQUAL TO)
Checks two expressions to see if the expression on the left is less than or equal to the expression on the right.
ABS Returns the absolute value of an expression.
ACOS Returns the arc-cosine of an expression.
AND Performs an AND operation on corresponding bits of the integer
parts of two expressions.
ASIN Returns the arc-sine of an expression.
ATAN Returns the arc-tangent of an expression.
ATAN2 Returns the arc-tangent of the non-zero complex number made
by two expressions.
B_SPLINE Expands the profile stored in TAB LE memory using the B-Spline
mathematical function.
COS Returns the cosine of an expression.
EXP Returns the exponential value of an expression.
FRAC Returns the fractional part of an expression.
IEEE_IN Returns floating point number in IEEE format, represented by 4
bytes.
IEEE_OUT Returns single byte extracted from the floating point number in
IEEE format.
INT Returns the integer part of an expression.
LN Returns the natural logarithm of an expression.
MOD Returns the modulus of two expressions.
Name Description
NOT Performs a NOT operation on corresponding bits of the integer
part of the expression.
OR Performs an OR operation between corresponding bits of the
integer parts of two expressions.
SGN Returns the sign of an expression.
SIN Returns the sine of an expression.
SQR Returns the square root of an expression.
TAN Returns the tangent of an expression.
XOR Performs an XOR function between corresponding bits of the
integer parts of two expressions.
Name Description
' (COMMENT FIELD) Enables a line not to be executed.
: (STATEMENT SEPARATOR)
Enables more statements on one line.
AUTORUN Starts all the programs that have been set to run at start-up.
COMPILE Compiles the current program.
COPY Copies an existing program in the motion controller to a new
program.
DEL Deletes a program from the motion controller.
DIR Displays a list of the programs in the motion controller, their size
and their RUNTYPE on the standard output.
LIST Prints the program on the standard output.
NEW Deletes all lines of the program in the motion controller.
PROCESS Returns the running status and task number for each current
task.
RENAME Changes the name of a program in the motion controller.
Name Description
BASIC commands
PROGRAMMING MANUAL 23
Revision 1.0
3.1.8 Program control commands
/i
3.1.9 Slot parameters and modifiers
/i
3.1.10 System commands and functions
/i
RUN Executes a program.
RUNTYPE Determines if a program is run at start-up, and which task it is to
run on.
SELECT Specifies the current program.
STEPLINE Executes a single line in a program.
STOP Halts program execution.
TROFF Suspends a trace at the current line and resumes normal pro-
gram execution.
TRON Creates a breakpoint in a program.
Name Description
FOR..TO..STEP..NEXT Loop allows a program segment to be repeated with increasing/
decreasing variable.
GOSUB..RETURN Jumps to a subroutine at the line just after label. The program
execution returns to the next instruction after a RETURN.
GOTO Jumps to the line containing the label.
IF..THEN..ELSE..ENDIF Controls the flow of the program base on the results of the con-
dition.
ON.. GOSUB or ON.. GOTO
Enables a conditional jump to one of several labels.
REPEAT..UNTIL Loop allows the program segment to be repeated until the con-
dition becomes TRUE.
WHILE..WEND Loop allows the program segment to be repeated until the con-
dition becomes FA LSE.
Name Description
Name Description
ALL Is a modifier that specifies that all items in the controller are con-
cerned.
COMMSTYPE Contains the type of unit in a controller slot.
FPGA_VERSION Returns the FPGA version of unit with unit_number in a control-
ler system.
SLOT Is a modifier that specifies slot number of unit.
Name Description
$ (HEXADECIMAL INPUT)
Assigns a hexadecimal number to a variable.
AXIS Sets the axis for a command, axis parameter read, or assign-
ment to a particular axis.
AXIS_OFFSET Defines the axis offset per unit when axes are assigned.
BASICERROR Is used to run a specific routine when an error occurs in a
BASIC command.
CAN_CORT Configures the TJ1-CORT for data exchange, or returns the sta-
tus of the TJ1-CORT.
CLEAR Clears all global variables and the local variables on the current
task.
CLEAR_BIT Clears the specified bit of the specified VR variable.
CLEAR_PARAMS Clears all parameters and variables stored in Flash-ROM to
their default values.
CONSTANT Declares a constant for use in BASIC program.
CRC16 Calculates the 16 bit CRC of data stored in contiguous TABLE
or VR Memory locations.
BASIC commands
PROGRAMMING MANUAL 24
Revision 1.0
3.1.11 System parameters
/i
DATE$ Prints the current date as a string.
DAY$ Prints the current day as a string
DEVICENET Configures the TJ1-DRT (DeviceNet Slave Unit) for data
exchange, or returns the data exchange status of the TJ1-DRT.
ETHERNET Reads and sets various parameters of TJ2-MC64 Ethernet port.
EX Resets the controller.
FREE Returns the amount of available memory.
GLOBAL Declares a reference to one of VR variables.
HALT Stops execution of all programs currently running.
HEX Used in a print statement to output a number in hexadecimal for-
mat.
INITIALISE Sets all axes and parameters to their default values.
INTEGER_READ Splits a 64 bit variable in 2 32 bit values and copies
these values to 2 other variables.
INVERT_IN Inverts input channels 0 - 31 in the software.
INVERTER_COMMAND Reads I/O and clears alarm of the Inverter.
INVERTER_READ Reads parameter, alarm, speed and torque reference of the
Inverter.
INVERTER_WRITE Writes to parameter, speed and torque reference of the Inverter.
LIST_GLOBAL Shows all GLOBAL and CONSTANT variables.
LOCK Prevents the programs from being viewed or modified.
PROFIBUS Configures the TJ1-PRT (PROFIBUS-DP Slave Unit) to
exchange I/O data with the master and returns the status of the TJ1-PRT.
READ_BIT Returns the value of the specified bit in the specified VR varia-
ble.
RESET Resets all local variables on a task.
SCOPE Programs the system to automatically store up to 4 parameters
every sample period to the TABLE variable array.
Name Description
SET_BIT Sets the specified bit in the specified VR variable to one.
TABLE Writes and reads data to and from the TABLE variable array.
TABLEVALUES Returns list of values from the TABLE memory.
TIME$ Prints the current time as a string.
TRIGGER Starts a previously set SCOPE command.
VR Writes and reads data to and from the global (VR) variables.
VRSTRING Combines VR memory values so they can be printed as a string.
WA Holds program execution for the number of milliseconds speci-
fied.
WAIT IDLE Suspends program execution until the base axis has finished
executing its current move and any buffered move.
WAIT LOADED Suspends program execution until the base axis has no moves
buffered ahead other than the currently executing move.
WAIT UNTIL Repeatedly evaluates the condition until it is TRUE.
Name Description
ADDRESS Sets the ModbusRTU multidrop address for the controller
BATTERY_LOW Returns the current status of the battery condition.
CHECKSUM Contains the checksum for the programs in RAM.
COMMSERROR Contains all the communications errors that have occurred since
the last time that it was initialised.
CONTROL Contains the type of TJ2-MC64 in the system.
CORNER_MODE Allows the program to control the cornering action.
D_ZONE_MAX Controls the DAC output in conjunction with the Following Error
value.
D_ZONE_MIN Controls the DAC output in conjunction with the Following Error
value.
Name Description
Loading...
+ 332 hidden pages