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
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.
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.
Motion Perfect is a registered trademark of Trio Motion Technology Ltd.
All other product names, company names, logos or other designations
mentioned herein are trademarks of their respective owners.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, 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 MANUALI
About this manual
NameCat. No.Contents
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
NameCat. No.Contents
Trajexia motion control system
QUICK START
GUIDE
Trajexia motion control system HARDWARE
REFERENCE MANUAL
Trajexia motion control system
PROGRAMMING
MANUAL
Sigma-II Servo
Driver manual
Sigma-III with
MECHATROLINK
interface manual
Sigma-V Servo
Driver manual
JUNMA series servo
Revision 5.0
drive manual
I50EDescribes how to get quickly familiar
with Trajexia, moving a single axis using
MECHATROLINK-II, in a test set-up.
I51EDescribes the installation and hardware
specification of the Trajexia units, and
explains the Trajexia system philosophy.
I52EDescribes the BASIC commands to be
used for programming Trajexia, communication protocols and Trajexia Studio
software, gives practical examples and
troubleshooting information.
SIEP S800000 15Describes the installation and operation
of Sigma-II Servo Drivers
SIEP S800000 11Describes the installation and operation
of Sigma-III Servo Drivers with MECHATROLINK-II interface
TOEP-C71080603 01-OY Describes the installation and operation
Describes the installation and operation
of Sigma-V Servo Drivers
of JUNMA Servo Drivers
V7 InverterTOEP C71060605 02-OY Describes the installation and operation
of V7 Inverters
F7Z InverterTOE S616-55 1-OYDescribes the installation and operation
of F7Z Inverters
G7 InverterTOE S616-60Describes the installation and operation
of G7 Inverters
JUSP-NS115 manual
SI-T MECHATROLINK interface for
the G7 & F7
ST-T/V7 MECHATROLINK interface
for the V7
MECHATROLINK IO
Modules
SYSMAC CS/CJ
Series Communications Commands
Omron Smartslice
GRT1-Series, slice I/
O units, Operation
manual
Omron G-series
user’s manual
Omron Accurax G5
user’s manual
Trajexia Studio user
manual
SIEP C71080001Describes the installation and operation
of the MECHATROLINK-II application
module
SIBP-C730600-08Describes the installation and operation
of MECHATROLINK-II interfaces for G7
and F7 Inverters
SIBP-C730600-03Describes the installation and operation
of MECHATROLINK-II interfaces for V7
Inverters
SIE C887-5Describes the installation and operation
of MECHATROLINK-II input and output
modules and the MECHATROLINK-II
repeater
W342Describes FINS communications proto-
col and FINS commands
W455-E1Describes the installation and operation
of Omron slice I/O units
I566-E1Describes the installation and operation
of G-series Servo Drivers
I572-E1Describes the installation and operation
of Accurax G5 Servo Drivers
I56E-ENDescribes the use of Trajexia Studio
programming software
PROGRAMMING MANUALII
WARNING
Failure to read and understand the information provided in this
manual may result in personal injury or death, damage to the product, 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 operations given.
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
Connect the TJ1-MC__ 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 TJ1-MC__.
FunctionalityTJ1-MC__ Firmware
version
Full support TJ1-FL02V1.650921 and higher
Support BASIC commands FINS_COMMSV1.6509All versions
Support TJ1-DRTV1.6509All versions
Support TJ1-MC04 andTJ1-ML04V1.660721 and higher
Support TJ1-CORT, GRT1-ML2, ModbusTCP, Sigma-V series Servo Drivers
(except DATUM and REGIST BASIC com-
mands) and allow Inverters to be controlled
as servo axes
Support for G-series Drivers, full support for
Sigma-V series Servo Drivers
Support for Accurax G5 DriversV1.672021 and higher
Revision 5.0
V1.665221 and higher
V1.671421 and higher
TJ1-MC__ FPGA
version
Verify the firmware and FPGA versions of the TJ1-MC__
PROGRAMMING MANUALIII
Contents
1Safety warnings and precautions................................................................................................................................................................1
2Trajexia system ...........................................................................................................................................................................................6
2.5Command line interface ..................................................................................................................................................................................................................13
5Examples and tips .................................................................................................................................................................................... 212
6.1Voltage and analysis tools ............................................................................................................................................................................................................293
Revision history ..............................................................................................................................................................................................307
Revision 5.0
PROGRAMMING MANUALV
Safety warnings and precautions
1Safety warnings and precautions
1.1Intended 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.
WARNING
Never short-circuit the positive and negative terminals of the batteries, charge the batteries, disassemble them, deform them by
applying pressure, or throw them into a fire.
The batteries may explode, combust or leak liquid.
1.2General 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.3Safety 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.
Revision 5.0
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 circuits, 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 overloaded 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.
PROGRAMMING MANUAL1
Safety warnings and 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 Trajexia 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 automatically backed up in the TJ1 flash memory (flash memory function).
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.
1.4Operating environment precautions
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.
Revision 5.0
Caution
Pay careful attention to the polarity (+/-) when wiring the DC power
supply.A wrong connection may cause malfunction of the system.
PROGRAMMING MANUAL2
Safety warnings and 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 conditions during the life of the system.
1.5Application 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 MECHATROLINKII network errors occur during start-up or if the MECHATROLINK-II
network configuration changes.
WARNING
Check the user program for proper execution before actually running it in the Unit.
Not checking the program may result in an unexpected operation.
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-
Caution
Always use the power supply voltage specified in this manual.
An incorrect voltage may result in malfunction or burning.
Revision 5.0
PROGRAMMING MANUAL3
stand voltage tests.
Not disconnecting the functional ground terminal may result in
burning.
Safety warnings and precautions
Caution
Always connect to a class-3 ground (to 100Ω or less) when installing 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 electric 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 connector screws are tightened to the torque specified in this manual.
Incorrect tightening torque may result in malfunction.
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
Leave the dust protective label attached to the Unit when wiring.
Removing the dust protective label 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
Remove the dust protective label after the completion of wiring to
Revision 5.0
ensure proper heat dissipation.
Leaving the dust protective label attached may result in malfunction.
PROGRAMMING MANUAL4
Safety warnings and precautions
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
Use the dedicated connecting cables specified in operation manuals to connect the Units.Using commercially available RS-232C
computer cables may cause failures in external devices or the
Motion Control Unit.
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
Outputs may remain on due to a malfunction in the built-in transistor 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
Do not pull on the cables or bend the cables beyond their natural
limit. Doing so may break the cables.
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.
Caution
1.6Unit assembly precautions
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
Install the unit properly.
Caution
Improper installation of the unit may result in malfunction.
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.
Caution
Be sure to mount the Termination Unit supplied with the TJ1MC__ to the right most Unit.
Unless the Termination Unit is properly mounted, the TJ1 will not
function properly.
Do not install twisted-pair cables in locations subject to excessive
Revision 5.0
dirt and dust or to oil mist or other contaminants.
PROGRAMMING MANUAL5
Trajexia system
2Trajexia system
2.1Introduction
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 directdrive servos as well as Inverters. The system is scalable up to 16 axes and 8
Inverters & I/O modules.
2.1.1Trajexia 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:
NS-series HMI
Digital I/O
Hostlink
CJ-series PLCCX-one
Ethernet
MECHATROLINK-II
fig. 1
Trajexia Tools
PROFIBUS-DP
Master
DEVICENET
Master
CANopen
Master
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.
Revision 5.0
PROGRAMMING MANUAL6
Trajexia system
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 Drivers.
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
Revision 5.0
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.
2.1.2This 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.2Multitasking 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.
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.
PROGRAMMING MANUAL7
Trajexia system
2.3BASIC 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.1Axis, system and task statements
The commands, functions and parameters apply either to (one of) the axes,
the tasks running or the general system.
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.2Memory areas
Three main memory areas can be identified in the Trajexia Motion Controller
Unit:
•I/O memory.
•VR memory.
•TABLE memory.
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,
Revision 5.0
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.
PROGRAMMING MANUAL8
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
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 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
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.
Revision 5.0
2.3.3Data 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 TABLE 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
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.
PROGRAMMING MANUAL9
Trajexia system
/i
Note
The TABLE and VR data can be accessed from the different running 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.
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:
Revision 5.0
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
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:
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:
PROGRAMMING MANUAL10
Trajexia system
/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)
...
2.3.4Mathematical 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
±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.
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.
−39
to
>> 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:
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
Hexadecimal format
Revision 5.0
The TJ1-MC__ supports assigning and printing hexadecimal values. A
hexadecimal number is input by prefixing the number with the $ character.
The best way to ensure the precedence of various operators is through the
use of parentheses.
Valid range is from 0x0 to 0xFFFFFF. Example:
PROGRAMMING MANUAL11
Trajexia system
2.4Motion execution
Every task on the TJ1-MC__ has a set of buffers that holds the information
from the motion commands given.
2.4.1Motion 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.
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 Studio 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.
Task buffers
Task 1
MOVECIRC(..) AXIS(0)
FORWARD AXIS(1)
Task 2
Task 3
MOVE(..) AXIS(0)
fig. 2
Motion
Generator
Sequencing
Move buffers
Revision 5.0
Axis
Next Move (NTYPE)
Next Move (NTYPE)
012
MOVE (1)
MOVECIRC (4)
FORWARD (10)
MOVECIRC (4)
IDLE (0)
IDLE (0)
Move
Loading
PROGRAMMING MANUAL12
Trajexia system
2.4.2Sequencing
On each servo cycle interrupt (see section 2.6.1), 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.3Move 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.5Command 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 TJ1-MC__ is
connected.
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.
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.
2.6.1Program execution
The timing of the execution for the different tasks and the refreshing of the I/
O of the TJ1-MC__ revolves around the servo cycle period of the system.
The servo cycle period is determined by the SERVO_PERIOD system
parameter. The TJ1-MC__ will either have a servo cycle period of 0.5, 1.0 or
2.0 ms.
I/O refresh
The I/O status of the TJ1-MC__ is refreshed at the beginning of every servo
cycle.
•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.
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.
2.6BASIC 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 filehandling instructions for managing these program files rather like the DOS
Revision 5.0
filing system on a computer.
PROGRAMMING MANUAL13
Trajexia system
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
CommandFunction
RUNRun the current selected program or a specified program, optionally on a
specified task number.
STOPStop the current selected program or a specified program.
HALTStop all programs on the system.
PROCESSDisplays all running tasks.
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 1 (lowest priority) to 14 (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.
Revision 5.0
PROGRAMMING MANUAL14
BASIC commands
3BASIC commands
3.1Categories
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.1Axis commands
/i
NameDescription
ACCChanges the ACCEL and DECEL at the same time.
ADD_DACSum to the DAC value of one axis to the analogue output of the
base axis.
ADDAXSets a link to a superimposed axis. All demand position movements
for the superimposed axis will be added to any moves that are currently being executed.
Revision 5.0
B_SPLINEExpands the profile stored in TABLE memory using the B-Spline
mathematical function.
BACKLASHAllows the backlash compensation to be loaded.
NameDescription
BASEUsed to set the base axis to which the commands and parameters
are applied.
CAMMoves an axis according to values of a movement profile stored in
the TABLE variable array.
CAMBOXMoves 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 gearbox.
CANCELCancels the move on an axis.
CONNECTConnects the demand position of an axis to the measured move-
ments of the driving axis to produce an electronic gearbox.
DATUMPerforms one of 7 origin search sequences to position an axis to an
absolute position or reset a motion error.
DEFPOSDefines the current position as a new absolute position.
DISABLE_GROUPGroups axes together for error disabling.
DRIVE_ALARMMonitors the current alarm.
DRIVE_CLEARClears the alarm status of the Servo Driver.
DRIVE_READReads the specified parameter of the Servo Driver.
DRIVE_RESETResets the Servo Driver.
DRIVE_WRITEWrites a specific value to the specified parameter of the Servo
Driver.
FORWARDMoves an axis continuously forward at the speed set in the SPEED
parameter.
HW_PSWITCHSets on and off the hardware switch on output 0 of the TJ1-FL02
when predefined positions are reached.
MECHATROLINKInitializes MECHATROLINK-II bus and performs various operations
on MECHATROLINK-II stations connected to the bus.
MHELICALInterpolates 3 orthogonal axes in a helical move.
MOVEMoves one or more axes at the demand speed, acceleration and
deceleration to the position specified as increment from the current
position.
PROGRAMMING MANUAL15
BASIC commands
NameDescription
MOVEABSMoves one or more axes at the demand speed, acceleration and
deceleration to the position specified as absolute position.
MOVECIRCInterpolates 2 orthogonal axes in a circular arc.
MOVELINKCreates a linear move on the base axis linked via a software gear-
box to the measured position of a link axis.
MOVEMODIFYChanges the absolute end position of the current single-axis linear
move (MOVE or MOVEABS).
RAPIDSTOPCancels the current move on all axes.
REGISTCaptures an axis position when a registration input or the Z mark on
the encoder is detected.
REVERSEMoves an axis continuously in reverse at the speed set in the
SPEED parameter.
STEP_RATIOSets the ratio for the axis stepper output.
3.1.2Axis parameters
/i
NameDescription
ACCELContains the axis acceleration rate.
ADDAX_AXISContains the number of the axis to which the base axis is cur-
rently linked to by ADDAX.
ATYPEContains the axis type.
AXIS_DISPLAYSelects information that are represented by the LEDs on the
front cover of the TJ1-FL02.
AXIS_ENABLEEnables and disables particular axis independently of other axis.
AXISSTATUSContains the axis status.
BACKLASH_DISTDefines the amount of backlash compensation.
CLOSE_WINDefines the end of the window in which a registration mark is
Revision 5.0
CLUTCH_RATEDefines the change in connection ratio when using the
expected.
CONNECT command.
NameDescription
CREEPContains the creep speed.
D_GAINContains the derivative control gain.
DAC_SCALESets scale and polarity applied to DAC values.
DATUM_INContains the input number to be used as the origin input.
DECELContains the axis deceleration rate.
DEMAND_EDGESContains the current value of the DPOS axis parameter in
encoder edges.
DPOSContains the demand position generated by the move com-
mands.
DRIVE_CONTROLSelects 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 TJ1FL02.
DRIVE_INPUTSHolds I/O data of the driver connected to MECHATROLINK-II
bus. Data is updated every servo cycle.
DRIVE_MONITORMonitors data of the Servo Driver connected to MECHATRO-
LINK-II bus. Data are updated every servo cycle.
DRIVE_STATUSContains the current status of the Servo Driver.
ENCODERContains a raw copy of the encoder hardware register.
ENCODER_BITSSets the number of bits for the absolute encoder connected to
TJ1-FL02.
ENCODER_CONTROLControls operating mode of the EnDat absolute encoder.
ENCODER_IDReturns the ID value of the absolute encoder connected to TJ1-
FL02.
ENCODER_RATIOSets scaling value for incoming encoder counts.
ENCODER_STATUSReturns the status of the Tamagawa absolute encoder.
ENCODER_TURNSReturns the multi-turn count of the absolute encoder.
ENDMOVEHolds the position of the end of the current move.
ERRORMASKContains the mask value that determines if MOTION_ERROR
occurs depending on the axis status.
PROGRAMMING MANUAL16
BASIC commands
NameDescription
FAST_JOGContains the input number to be used as the fast jog input.
FASTDECDefines ramp to zero deceleration ratio when an axis limit switch
or position is reached.
FEContains the Following Error.
FE_LATCHContains the FE value which caused the axis to put controller in
MOTION_ERROR state.
FE_LIMITContains the maximum allowable Following Error.
FE_LIMIT_MODEDefines how FE influences MOTION_ERROR state.
FE_RANGEContains the Following Error warning range limit.
FHOLD_INContains the input number to be used as the feedhold input.
FHSPEEDContains the feedhold speed.
FS_LIMITContains the absolute position of the forward software limit.
FWD_INContains the input number to be used as a forward limit input.
FWD_JOGContains the input number to be used as a jog forward input.
I_GAINContains the integral control gain.
INVERT_STEPSwitches a hardware Inverter into the stepper output circuit.
JOGSPEEDSets the jog speed.
MARKDetects the primary registration event on a registration input.
MARKBDetects the secondary registration event on a registration input.
MERGEIs a software switch that can be used to enable or disable the
merging of consecutive moves.
MPOSIs the position of the axis as measured by the encoder.
MSPEEDRepresents the change in the measured position in the last
servo period.
MTYPEContains the type of move currently being executed.
NTYPEContains the type of the move in the Next Move buffer.
Revision 5.0
OFFPOSContains an offset that will be applied to the demand position
without affecting the move in any other way.
NameDescription
OPEN_WINDefines the beginning of the window in which a registration
mark is expected.
OUTLIMITContains the limit that restricts the speed reference output from
the TJ1-MC__.
OV_GAINContains the output velocity control gain.
P_GAINContains the proportional control gain.
REG_POSContains the position at which a registration event occurred.
REG_POSBContains the position at which the secondary registration event
occurred.
REMAINIs the distance remaining to the end of the current move.
REP_DISTContains or sets the repeat distance.
REP_OPTIONControls the application of the REP_DIST axis parameter.
REV_INContains the input number to be used as a reverse limit input.
REV_JOGContains the input number to be used as a jog reverse input.
RS_LIMITContains the absolute position of the reverse software limit.
S_REFContains the speed reference value which is applied when the
axis is in open loop.
S_REF_OUTContains the speed reference value being applied to the Servo
Driver for both open as closed loop.
SERVODetermines whether the axis runs under servo control or open
loop.
SPEEDContains the demand speed in units/s.
SPEED_SIGNConfigures the voltage range of the analog speed reference out-
put of the TJ1-FL02.
SRAMPContains the S-curve factor.
T_REFContains the torque reference value which is applied to the
servo motor.
TRANS_DPOSContains axis demand position at output of frame transforma-
tion.
UNITSContains the unit conversion factor.
PROGRAMMING MANUAL17
BASIC commands
NameDescription
VERIFYSelects different modes of operation on a stepper output axis.
VFF_GAINContains the speed feed forward control gain.
VP_SPEEDContains the speed profile speed.
3.1.3Communication commands and parameters
/i
NameDescription
FINS_COMMSSends FINS Read Memory and Write Memory to a designated
FINS server unit.
HLM_COMMANDExecutes a specific Host Link command to the Slave.
HLM_READReads data from the Host Link Slave to either VR or TABLE var-
iable array.
HLM_STATUSRepresents the status of the last Host Link Master command.
HLM_TIMEOUTDefines the Host Link Master timeout time.
HLM_WRITEWrites data to the Host Link Slave from either VR or TABLE var-
iable array.
HLS_NODEDefines the Slave unit number for the Host Link Slave protocol.
SETCOMSets the serial communications.
3.1.4Constants
/i
NameDescription
FALSEEqual to the numerical value 0.
OFFEqual to the numerical value 0.
ONEqual to the numerical value 1.
PIEqual to the numerical value 3.1416.
TRUEEqual to the numerical value -1.
3.1.5I/O commands, functions and parameters
/i
NameDescription
AINHolds the value of the analog channel.
AOUTHolds the value of the analog channel.
GETWaits for the arrival of a single character and assigns the ASCII
code of the character to variable.
INReturns the value of digital inputs.
INDEVICEParameter defines the default input device.
INPUTWaits for a string to be received and assigns the numerical value
to variable.
KEYReturns TRUE or FALSE depending on if character is received.
LINPUTWaits for a string and puts it in VR variables.
OPSets one or more outputs or returns the state of the first 24 out-
puts.
OUTDEVICEDefines the default output device.
PRINTOutputs a series of characters to a serial port.
Revision 5.0
PSWITCHTurns on an output when a predefined position is reached, and
turns off the output when a second position is reached.
READ_OPReturns the value of the digital outputs.
PROGRAMMING MANUAL18
BASIC commands
3.1.6Mathematical functions and operands
/i
NameDescription
+ (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.
<> (IS NOT EQUAL
TO)
> (IS GREATER THAN) Checks two expressions to see if the expression on the left is
>= (IS GREATER
THAN OR EQUAL TO)
< (IS LESS THAN)Checks two expressions to see if the expression on the left is
<= (IS LESS THAN OR
EQUAL TO)
ABSReturns the absolute value of an expression.
ACOSReturns the arc-cosine of an expression.
ANDPerforms an AND operation on corresponding bits of the integer
ASINReturns the arc-sine of an expression.
ATANReturns the arc-tangent of an expression.
ATAN2Returns the arc-tangent of the non-zero complex number made
Revision 5.0
COSReturns the cosine of an expression.
EXPReturns the exponential value of an expression.
Checks two expressions to see if they are different.
greater than the expression on the right.
Checks two expressions to see if the expression on the left is
greater than or equal to the expression on the right.
less than the expression on the right.
Checks two expressions to see if the expression on the left is
less than or equal to the expression on the right.
parts of two expressions.
by two expressions.
NameDescription
FRACReturns the fractional part of an expression.
IEEE_INReturns floating point number in IEEE format, represented by 4
bytes.
IEEE_OUTReturns single byte extracted from the floating point number in
IEEE format.
INTReturns the integer part of an expression.
LNReturns the natural logarithm of an expression.
MODReturns the modulus of two expressions.
NOTPerforms a NOT operation on corresponding bits of the integer
part of the expression.
ORPerforms an OR operation between corresponding bits of the
integer parts of two expressions.
SGNReturns the sign of an expression.
SINReturns the sine of an expression.
SQRReturns the square root of an expression.
TANReturns the tangent of an expression.
XORPerforms an XOR function between corresponding bits of the
integer parts of two expressions.
3.1.7Program commands
/i
NameDescription
' (COMMENT FIELD)Enables a line not to be executed.
: (STATEMENT
SEPARATOR)
AUTORUNStarts all the programs that have been set to run at start-up.
COMPILECompiles the current program.
COPYCopies an existing program in the motion controller to a new
Enables more statements on one line.
program.
PROGRAMMING MANUAL19
BASIC commands
NameDescription
DELDeletes a program from the motion controller.
DIRDisplays a list of the programs in the motion controller, their size
and their RUNTYPE on the standard output.
EDITAllows a program to be modified using a VT100 Terminal.
EPROMStores a program in the flash memory.
LISTPrints the program on the standard output.
NEWDeletes all lines of the program in the motion controller.
PROCESSReturns the running status and task number for each current
task.
RENAMEChanges the name of a program in the motion controller.
RUNExecutes a program.
RUNTYPEDetermines if a program is run at start-up, and which task it is to
run on.
SELECTSpecifies the current program.
STEPLINEExecutes a single line in a program.
STOPHalts program execution.
TROFFSuspends a trace at the current line and resumes normal pro-
gram execution.
NameDescription
IF..THEN..ELSE..ENDIF Controls the flow of the program base on the results of the con-
dition.
ON.. GOSUB or ON..
GOTO
REPEAT..UNTILLoop allows the program segment to be repeated until the con-
WHILE..WENDLoop allows the program segment to be repeated until the con-
Enables a conditional jump to one of several labels.
dition becomes TRUE.
dition becomes FALS E.
3.1.9Slot parameters and modifiers
/i
NameDescription
ALLIs a modifier that specifies that all items in the controller are con-
cerned.
COMMSTYPEContains the type of unit in a controller slot.
FPGA_VERSIONReturns the FPGA version of unit with unit_number in a control-
ler system.
SLOTIs a modifier that specifies slot number of unit.
TRONCreates a breakpoint in a program.
3.1.8Program control commands
/i
NameDescription
FOR..TO..STEP..NEXTLoop allows a program segment to be repeated with increasing/
decreasing variable.
GOSUB..RETURNJumps to a subroutine at the line just after label. The program
Revision 5.0
GOTOJumps to the line containing the label.
execution returns to the next instruction after a “RETURN” on
page 157 is given.
3.1.10 System commands and functions
/i
NameDescription
$ (HEXADECIMAL
INPUT)
AXISSets the axis for a command, axis parameter read, or assign-
BASICERRORIs used to run a specific routine when an error occurs in a
CAN_CORTConfigures the TJ1-CORT for data exchange, or returns the sta-
Assigns a hexadecimal number to a variable.
ment to a particular axis.
BASIC command.
tus of the TJ1-CORT.
PROGRAMMING MANUAL20
BASIC commands
NameDescription
CLEARClears all global variables and the local variables on the current
task.
CLEAR_BITClears the specified bit of the specified VR variable.
CLEAR_PARAMSClears all parameter sand variables stored in Flash-ROM to
their default values.
CONSTANTDeclares a constant for use in BASIC program.
DATE$Prints the current date as a string.
DAY$Prints the current day as a string
DEVICENETConfigures the TJ1-DRT (DeviceNet Slave Unit) for data
exchange, or returns the data exchange status of the TJ1-DRT.
ETHERNETReads and sets various parameters of TJ1-MC__ Ethernet port.
EXResets the controller.
FLAGSets and reads a bank of 32 bits.
FLAGSRead and sets FLAGS as a block.
FREEReturns the amount of available memory.
GLOBALDeclares a reference to one of VR variables.
HALTStops execution of all programs currently running.
INITIALISESets all axes and parameters to their default values.
INVERT_INInverts input channels 0 - 31 in the software.
INVERTER_COMMAND Reads I/O and clears alarm of the Inverter.
INVERTER_READReads parameter, alarm, speed and torque reference of the
Inverter.
INVERTER_WRITEWrites to parameter, speed and torque reference of the Inverter.
LIST_GLOBALShows all GLOBAL and CONSTANT variables.
LOCKPrevents the programs from being viewed or modified.
PROFIBUSConfigures the TJ1-PRT (PROFIBUS-DP Slave Unit) to
Revision 5.0
exchange I/O data with the master and returns the status of the
TJ1-PRT.
NameDescription
READ_BITReturns the value of the specified bit in the specified VR varia-
ble.
RESETResets all local variables on a task.
SCOPEPrograms the system to automatically store up to 4 parameters
every sample period to the TABLE variable array.
SET_BITSets the specified bit in the specified VR variable to one.
TABLEWrites and reads data to and from the TABLE variable array.
TABLEVALUESReturns list of values from the TABLE memory.
TIME$Prints the current time as a string.
TRIGGERStarts a previously set SCOPE command.
VRWrites and reads data to and from the global (VR) variables.
VRSTRINGCombines VR memory values so they can be printed as a string.
WAHolds program execution for the number of milliseconds speci-
fied.
WAIT IDLESuspends program execution until the base axis has finished
executing its current move and any buffered move.
WAIT LOADEDSuspends program execution until the base axis has no moves
buffered ahead other than the currently executing move.
WAIT UNTILRepeatedly evaluates the condition until it is TRUE.
3.1.11 System parameters
/i
NameDescription
BATTERY_LOWReturns the current status of the battery condition.
CHECKSUMContains the checksum for the programs in RAM.
COMMSERRORContains all the communications errors that have occurred since
the last time that it was initialised.
CONTROLContains the type of TJ1-MC__ in the system.
PROGRAMMING MANUAL21
BASIC commands
NameDescription
D_ZONE_MAXControls the DAC output in conjunction with the Following Error
value.
D_ZONE_MINControls the DAC output in conjunction with the Following Error
value.
DATESets or returns the current date held by the real time clock.
DAYSets or returns the current day.
DISPLAYDetermines I/O channels to be displayed on the front panel
LEDs.
ERROR_AXISContains the number of the axis which caused the motion error.
FRAMESpecifies operating frame for frame transformations.
LAST_AXISContains the number of the last axis processed by the system.
MOTION_ERRORContains an error flag for axis motion errors.
NAIOReturns the number of analogue channels connected on the
MECHATROLINK-II bus.
NEG_OFFSETApplies a negative offset to the DAC signal from the servo loop.
NIOContains the number of inputs and outputs connected to the
system.
POWER_UPDetermines whether programs should be read from Flash-ROM
on power up or reset.
POS_OFFSETApplies a positive offset to the DAC signal from the servo loop.
3.1.12 Task commands and parameters
/i
NameDescription
ERROR_LINEContains the number of the line which caused the last BASIC
program error.
PMOVEContains the status of the task buffers.
PROCLets a process parameter from a particular process to be
accessed.
PROC_STATUSReturns the status of the process specified.
PROCNUMBERContains the number of the task in which the currently selected
program is running.
RUN_ERRORContains the number of the last BASIC error that occurred on the
specified task.
TICKSContains the current count of the task clock pulses.
SCOPE_POSContains the current TABLE position at which the SCOPE com-
mand is currently storing its first parameter.
SERVO_PERIODSets the servo cycle period of the TJ1-MC__.
SYSTEM_ERRORContains the system errors since the last initialization.
TIMEReturns the current time held by the real time clock.
TSIZEReturns the size of the currently defined Table.
VERSIONReturns the version number of the controller firmware.
Revision 5.0
WDOGThe software switch that enables Servo Drivers.
PROGRAMMING MANUAL22
BASIC commands
3.2All BASIC commands
3.2.1+ (Addition)
/i
TypeMathematical function
Syntaxexpression1 + expression2
DescriptionThe operator + adds two expressions.
Arguments•expression1
Any valid BASIC expression.
•expression2
Any valid BASIC expression.
Exampleresult = 4 + 3
Assigns the value 7 to the variable result.
See alsoN/A
3.2.2- (Subtraction)
/i
TypeMathematical function
Syntaxexpression1 - expression2
DescriptionThe operator - subtracts expression2 from expression1.
Arguments•expression1
Any valid BASIC expression.
•expression2
Any valid BASIC expression.
Exampleresult = 10 - 2
Assigns the value 8 to the variable result.
See alsoN/A
3.2.3* (Multiplication)
/i
TypeMathematical function
Syntaxexpression1 * expression2
DescriptionThe operator * multiplies two expressions.
Arguments•expression1
Any valid BASIC expression.
•expression2
Any valid BASIC expression.
Exampleresult = 3 * 7
Assigns the value 21 to the variable result.
See alsoN/A
3.2.4/ (Division)
/i
TypeMathematical function
Syntaxexpression1 / expression2
DescriptionThe operator / divides expression1 by expression2.
Arguments•expression1
Any valid BASIC expression.
•expression2
Any valid BASIC expression.
Exampleresult = 11 / 4
Assigns the value 2.75 to the variable result.
See alsoN/A
Revision 5.0
PROGRAMMING MANUAL23
BASIC commands
3.2.5^ (Power)
/i
TypeMathematical function
Syntaxexpression1 ^ expression2
DescriptionThe power operator ^ raises expression1 to the power of expression2.
This operation uses floating point algorithms and may give small deviations for
integer calculations.
Arguments•expression1
Any valid BASIC expression.
•expression2
Any valid BASIC expression.
Exampleresult = 2^5
Assigns the value 32 to the variable result.
See alsoN/A
3.2.6= (Is equal to)
/i
TypeMathematical function
Syntaxexpression1 = expression2
DescriptionThe operator = returns TRUE if expression1 is equal to expression2, other-
wise it returns FALSE.
Arguments•expression1
Any valid BASIC expression.
•expression2
Any valid BASIC expression.
ExampleIF a = 10 THEN GOTO label1
If variable a contains a value equal to 10, program execution continues at
label label1. Otherwise, program execution continues with the next statement.
See alsoN/A
Revision 5.0
3.2.7= (Assignment)
/i
TypeMathematical function
Syntaxvariable = expression
DescriptionThe operator = assigns the value of the expression to the variable.
Arguments•variable
A variable name.
•expression
Any valid BASIC expression.
Examplevar = 18
Assigns the value 18 to the variable var.
See alsoN/A
3.2.8<> (Is not equal to)
/i
TypeMathematical function
Syntaxexpression1 <> expression2
DescriptionThe operator <> returns TRUE if expression1 is not equal to expression2,
otherwise it returns FALSE.
Arguments•expression1
Any valid BASIC expression.
•expression2
Any valid BASIC expression.
ExampleIF a <> 10 THEN GOTO label1
If variable a contains a value not equal to 10, program execution continues at
label label1. Otherwise, program execution continues with the next statement.
See alsoN/A
PROGRAMMING MANUAL24
Loading...
+ 284 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.