TAM Tama – C# Real Time Programming
Triamec servo drives, I/O controllers and adapters are freely programmable for customer-specific applications. Two tasks are available for this purpose:
- Isochronous task in 10kHz
- Asynchronous Task
Development is done with Microsoft Visual Studio in C#, which translates the code into the intermediate language CIL. A virtual machine (TamaVM) is installed on the Triamec devices, which interprets this standardized language and executes it in real time.
A Tama program can be loaded into the devices at runtime and then executed. For stand-alone applications without PC connection Tama programs can be stored persistently in the devices. Tama programs have access to all registers of the executing device and to cyclically transmitted coupling data of other devices.
Features of Tama programs
- Robust runtime environment: Virtual machine inside the device ("crash-proof")
- Two tasks: One 10kHz real-time and one asynchronous task
- Hard real-time in 10kHz
- Strict type safety
- Data types: int, float, bool, enum, struct, object, array
- Access to device registers with IntelliSense function of Visual Studio
- Mathematical functions
- Interaction with PC application or Tama programs on other devices
- New programs can be loaded and executed at runtime
- Persistence allows autonomous operation without PC
Typical applications
- Homing sequences, touch detection
- Axis couplings (e.g. portals)
- Kinematics calculations (e.g. parallel kinematics of a delta robot)
- Sequence controls for simple stand-alone applications (e.g. force guided press)
- Dual Loop Control (also together with other Servo Drives)
- Parameter adaptation (for control, gain scheduling)
- Monitoring functions and other real-time machine reactions
Tama Program Development
Tama programs are developed in the C# programming language using Visual Studio®. Tama programs can be executed on all Triamec Servo Drives.
The Tama User Manual can be found in the Manuals section.
Tama Program Examples
Find a template for creating a Tama program as well as various examples on GitHub. Such repositories are tagged with the badge.
In the following section, a Tama sample program is shown to give an insight into Tama programming. The example shows a simple program in the isochronous task with the basic principles of Tama programming and access to drive registers.
Example program showing access to Registers
using Triamec.Tama.Rlid19; // required for register access
using Triamec.Tama.Vmid5; // required for interpretation of Tama task attributes
[Tama] // attribute to indicate the starting point for the Tama compiler
static class D1_MinimalTama // name of the tama program
{
/*****************************************************************
* members
*****************************************************************/
static float actualPosition;
/*****************************************************************
* isochronous main task
*****************************************************************/
[TamaTask(Task.IsochronousMain)] // attribute to indicate the entry point and the task type
static void Main() // main function, name is not relevant
{
// your code
actualPosition = (float)Register.Axes_0.Signals.PositionController.MasterPosition; // type of position is doup
Register.Application.Variables.Floats[0] = actualPosition; // use a generic register to display the position
Register.Application.Variables.Booleans[1] = Register.Application.Variables.Booleans[0]; // reflect boolean 0 to boolean 1
}
}