Aerotech系列(2)Aerotech.A3200.Tasks

Icon Type Description

LoadedProgram

Represents a loaded program on the controller.

LoadedProgramCollection

Exposes programs that are in memory on the controller.

PathKind

Represents the kind of file specified by a file path.

Program

Represents a program running on a task

ProgramFilePoint

Represents a position in a source or binary program file.

QueueStatus

Represents a set of queue status

Task

Represents a task. This class exposes properties and methods to control the execution and debug programs running on the task.

TaskExecutionMode

Represents the task execution modes

TaskMode

Represents a set of task status

TasksCollection

Represents the tasks

TaskState

This value represents information about the state of this task.

TaskStatus

Contains various task status items such as task error, task warning, task mode, etc.

TaskStatus0

Represents a set of task status

TaskStatus1

Represents a set of task status

TaskStatus2

Represents a set of task status

TaskVariableContainer

The top-level class that contains all variables for a particular task.

  •  LoadedProgram
Icon Member Description

Associate(TaskId)

Associates the program with a task.

AssociatedTasks

The tasks the program is associated with.

Equals(Object)

Determines whether the specified Object is equal to the current Object.

(Inherited from Object.)

Finalize()()()()

Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

(Inherited from Object.)

GetHashCode()()()()

Serves as a hash function for a particular type. GetHashCode()()()() is suitable for use in hashing algorithms and data structures like a hash table.

(Inherited from Object.)

GetType()()()()

Gets the Type of the current instance.

(Inherited from Object.)

MemberwiseClone()()()()

Creates a shallow copy of the current Object.

(Inherited from Object.)

Name

The name of the PGM program on the controller.

ToString()()()()

Returns a String that represents the current Object.

(Inherited from Object.)

Unload()()()()

Unloads the program from the controller memory.

Examples:


    try
    {
        // Initialize the connection to the A3200
        Controller^ myController = Controller::Connect();
        // We can stop a program by name
        myController->LoadedPrograms["program.pgm"]->Unload();
        // Or stop and unload all programs
        for each (LoadedProgram^ loadedProgram in myController->LoadedPrograms)
        {
            for each (Task^ associatedTask in loadedProgram->AssociatedTasks)
            {
                associatedTask->Program->Stop();
            }
            loadedProgram->Unload();
        }
        // Disconnect from the network of controllers.
        Controller::Disconnect();
    }
    catch (Exception^ ex)
    {
        Console::WriteLine("Exception occured: {0}", ex->Message);
    }

 C#:


    try
    {
        // Initialize the connection to the A3200
        Controller myController = Controller.Connect();
        // We can stop a program by name
        myController.LoadedPrograms["program.pgm"].Unload();
        // Or stop and unload all programs
        foreach (LoadedProgram loadedProgram in myController.LoadedPrograms)
        {
            foreach (Task associatedTask in loadedProgram.AssociatedTasks)
            {
                associatedTask.Program.Stop();
            }
            loadedProgram.Unload();
        }
        // Disconnect from the network of controllers.
        Controller.Disconnect();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Exception occured: {0}", ex.Message);
    }
  • LoadedProgramCollection

省略

  • PathKind
Member Description
Object The file is an object file.
Source The file is a source file.
  • Program
Icon Member Description

Associate(String)

Associates a program loaded on the SMC to the task so that it can be executed

Associated

Returns a Boolean to denote whether or not a program is currently associated with the task

BufferedRun(String)

Executes the program in buffered mode on the task, use if program is too big for Run(String)

Debug

Provides access to advanced program control features to aid in debugging

Equals(Object)

Determines whether the specified Object is equal to the current Object.

(Inherited from Object.)

Error

Returns a ErrorInformation object which can be used to retrieve information about any errors on the task

FileName

Returns the file name of the currently executing program on the task

Finalize()()()()

Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

(Inherited from Object.)

GetHashCode()()()()

Serves as a hash function for a particular type. GetHashCode()()()() is suitable for use in hashing algorithms and data structures like a hash table.

(Inherited from Object.)

GetType()()()()

Gets the Type of the current instance.

(Inherited from Object.)

InitializeQueue()()()()

Changes the task to execute commands in queue mode

Load(String)

Compiles (if needed), loads, and associates the loaded file with the task

MemberwiseClone()()()()

Creates a shallow copy of the current Object.

(Inherited from Object.)

Run(String)

Compiles (if needed), loads, associates, and executes the loaded file on the task

Start()()()()

Starts execution of the program currently loaded on the task

Stop()()()()

Stops execution of the currently loaded program.

Stop(Int32)

Stops execution of the currently loaded program.

ToString()()()()

Returns a String that represents the current Object.

(Inherited from Object.)

 Examples:

C++


    try
    {
        // Initialize the connection to the A3200.
        Controller^ myController = Controller::Connect();
        // Put task into Queue mode.
        myController->Tasks[TaskId::T01]->Program->InitializeQueue();
        // Put controller into incremental mode, to guarantee each motion command is executed.
        myController->Commands->Motion->Setup->Incremental();
        // Enable the axis.
        myController->Commands[TaskId::T01]->Motion->Enable("X");
        // Load Queue with a command to perform LINEAR motion.
        for (int i = 0 ; (i < 300); i++)
        {
            while (true)
            {
                try
                {
                    // Load Queue with commands.
                    myController->Commands[TaskId::T01]->Motion->Linear("X", 5, 25);
                    break;
                }
                catch (QueueBufferFullException)
                {
                    // Wait if the Queue is full.
                    Thread::Sleep(10);
                }
            }
        }
        // Collect QueueLineCount to see if there are still commands to execute.
        while (!myController->Tasks[TaskId::T01]->Status->QueueStatus->QueueBufferEmpty)
        {
            // If there are still commands to execute, sleep and then check again on how many commands are left.
            Thread::Sleep(10);
        }
        // Stop using Queue mode.
        myController->Tasks[TaskId::T01]->Program->Stop();
        Controller::Disconnect();
    }
    catch (Exception^ ex)
    {
        Console::WriteLine("Exception occurred: {0}", ex->Message);
    }

C#


    try
    {
        // Initialize the connection to the A3200.
        Controller myController = Controller.Connect();
        // Put task into Queue mode.
        myController.Tasks[TaskId.T01].Program.InitializeQueue();
        // Put controller into incremental mode, to guarantee each motion command is executed.
        myController.Commands.Motion.Setup.Incremental();
        // Enable the axis.
        myController.Commands[TaskId.T01].Motion.Enable("X");
        // Load Queue with a command to perform LINEAR motion.
        for (int i = 0; i < 300; i++)
        {
            while (true)
            {
                try
                {
                    // Load Queue with commands.
                    myController.Commands[TaskId.T01].Motion.Linear("X", 5, 25);
                    break;
                }
                catch (QueueBufferFullException)
                {
                    // Wait if the Queue is full.
                    Thread.Sleep(10);
                }
            }
        }
        // Collect QueueLineCount to see if there are still commands to execute.
        while (!myController.Tasks[TaskId.T01].Status.QueueStatus.QueueBufferEmpty)
        {
            // If there are still commands to execute, sleep and then check again on how many commands are left.
            Thread.Sleep(10);
        }
        // Stop using Queue mode.
        myController.Tasks[TaskId.T01].Program.Stop();
        Controller.Disconnect();
    }
    catch (Exception ex)
    {
        Console.WriteLine("Exception occurred: {0}", ex.Message);
    }
  • ProgramFilePoint
Icon Member Description

ProgramFilePoint(String, Int32, PathKind)

Creates a new instance of ProgramFilePoint.

Clone()()()()

Clones the current object.

Equals(Object)

Compares the current instance of ProgramFilePoint to another instance for equality.

(Overrides FilePoint.Equals(Object).)

Finalize()()()()

Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.

(Inherited from Object.)

GetHashCode()()()()

Generates a hash code of the current instance of ProgramFilePoint.

(Overrides FilePoint.GetHashCode()()()().)

GetType()()()()

Gets the

<think>嗯,用户需要查找Aerotech A3200控制器的ROTATION指令使用方法。从引用内容看,用户提供的资料主要集中在A3200平台架构、基础API操作和开发环境配置,没有直接提及ROTATION指令。不过有几个关键线索值得注意: 用户引用的代码片段[3]里出现了Task和LoadedProgram对象,说明ROTATION很可能作为G代码指令在任务程序中运行。因为运动控制平台的旋转功能通常通过G代码或类似指令实现。引用[4]提到的TasksCollection也佐证了多任务编程环境的存在。 旋转功能在运动控制中主要有两种应用:一是旋转轴的角度定位(如转台),二是坐标系旋转(如倾斜平面加工)。A3200作为高端平台应该都支持。考虑到用户没有指定硬件配置,需要同时覆盖这两种场景。 比较麻烦的是用户提供的资料里没有直接示例。不过引用[5]的工程配置显示开发需要SDK,建议用户查阅官方文档是最稳妥的方案。另外代码片段[2]中AxisStatus的枚举用法值得参考,旋转指令执行时应该可以类似监控Moving状态。 用户应该是工程师而非初学者,因为能精准提出ROTATION指令这种专业术语。但要注意避免假设对方的熟悉程度,比如坐标系旋转的数学原理部分需要解释清楚旋转中心点的重要性。 </think>在Aerotech A3200运动控制系统中,`ROTATION` 指令用于实现坐标系旋转功能,常用于倾斜平面加工、角度补偿或旋转轴同步等场景。结合官方文档和典型用法,其核心要点如下: --- ### **`ROTATION` 指令功能** 1. **坐标系旋转** - 将当前笛卡尔坐标系(X, Y, Z)绕指定轴旋转一定角度,创建新的工件坐标系。 - 语法:`ROTATION <角度> [, AXIS=<旋转轴>] [, POINT=<旋转中心>]` - `<角度>`:旋转角度(单位:度),正值为逆时针旋转。 - `<旋转轴>`:可选参数,默认为Z轴(`AXIS=Z`),支持X/Y/Z轴或自定义旋转轴。 - `<旋转中心>`:可选参数,指定旋转中心的坐标(如 `POINT=X0Y0`)。 2. **应用场景** - 在斜面或曲面上执行加工时,将刀具路径投影到旋转后的新坐标系。 - 校正工件装夹倾斜误差(如夹具角度偏差补偿)。 - 配合旋转轴(如转台)实现多角度加工。 --- ### **典型代码示例** ```gcode ; 示例1:绕Z轴旋转30度(原点为旋转中心) ROTATION 30 ; 示例2:绕Y轴旋转45度,指定旋转中心为(10,20) ROTATION 45, AXIS=Y, POINT=X10Y20 ; 执行加工指令(在新坐标系下移动) LINEAR X50 Y30 F1000 ; 取消旋转(恢复原始坐标系) ROTATION OFF ``` --- ### **关键注意事项** 1. **层级叠加** - 多次调用 `ROTATION` 会叠加效果,可通过 `ROTATION OFF` 逐层取消。 2. **与运动指令协同** - 旋转指令需在运动(如 `LINEAR`, `CIRCLE`)前声明,仅影响后续路径。 3. **旋转轴同步** - 若需物理旋转轴(如转台)同步运动,需在 `TASK` 中配置轴映射: ```csharp // C# 示例:定义旋转轴为A轴 myTask.AxisMap.SetAxisMap(AxisComponent.A, "Motor1"); // 映射电机 ``` 4. **动态修改** - 旋转角度可通过变量实时调整: ```gcode #angle = 15 ; 定义变量 ROTATION #angle, AXIS=Z ; 动态应用 ``` --- ### **常见问题排查** - **路径偏移异常**:检查旋转中心点 `POINT` 是否与工件基准一致。 - **旋转方向错误**:确认角度正负值(右手法则:拇指指向旋转轴正向,四指弯曲方向为旋转正值)。 - **性能影响**:高频率的动态旋转可能增加控制器计算负载,建议在程序初始化时预设角度。 > 💡 **操作建议** > 1.Aerotech **Automation Studio** 中模拟旋转路径(引用[^5]的工程配置支持仿真)。 > 2. 通过 `TASK.Variables` 监控旋转状态(引用[^4]的变量容器)。 > 3. 详细参数参考官方手册:*A3200 Command Reference > Coordinate System Commands*。 --- ### **相关问题** 1. 如何在A3200中实现多坐标系(如`G54-G59`)切换? 2. `ROTATION`指令与`TRANSFORM`坐标变换有何区别? 3. 旋转中心点偏移对加工精度的影响如何补偿? 4. 能否通过赫优讯EtherCAT板卡(引用[^1])同步外部编码器的旋转角度? [^1]: Aerotech A3200通过CIFX50-RE板卡扩展EtherCAT通信能力 [^4]: `TasksCollection`类管理多任务变量及程序状态 [^5]: QT工程配置需链接A3200 SDK库文件(`lA3200C64`)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值