- 库对象模型
- 名空间列表
Namespace | Description |
---|---|
Aerotech.A3200 | The main namespace of the Aerotech A3200 .NET library |
Aerotech.A3200.Callbacks | Contains the classes that allow interacting with callbacks |
Aerotech.A3200.Commands | Contains the classes that allows the execution of AeroBasic commands on the controller |
Aerotech.A3200.Configuration | Contains the configuration related classes |
Aerotech.A3200.DataCollection | Contains the data collection classes |
Aerotech.A3200.Exceptions | Contains the exceptions that can be thrown by the Aerotech A3200 .NET library |
Aerotech.A3200.Firmware | Contains the firmware loading and other firmware related classes |
Aerotech.A3200.Information | Contains the classes that provide information about the controller and its components |
Aerotech.A3200.Parameters | Contains classes related to controller parameters |
Aerotech.A3200.Parameters.Fieldbus | Contains classes related to the configuration of fieldbus connections in a parameter file |
Aerotech.A3200.Status | Contains classes related to diagnostic information and polling |
Aerotech.A3200.Status.Custom | Contains classes related to custom diagnostic packet |
Aerotech.A3200.Tasks | Contains classes related to task operations |
Aerotech.A3200.Tasks.Debug | Contains classes related to task debugging operations |
Aerotech.A3200.Units | The namespace for unit information and conversion |
Aerotech.A3200.Variables | Contains the classes that provide access to variables |
Aerotech.A3200.Variables.Fieldbus | Contains the classes that provide access to the fieldbus variables. |
Aerotech.AeroBasic | Contains classes that allow to work with AeroBasic files. |
Aerotech.Common | Contains classes common to Aerotech products |
Aerotech.Common.Collections | Contain collection classes common to Aerotech products. |
- 注释
The libraries that need to be referenced are Aerotech.A3200.dll and Aerotech.Common.dll. There are several C/C++ libraries that also required to run the applications. All of the libraries are in the DotNET folder in the installation folder of the software.
The C/C++ libraries are not automatically copied by Visual Studio and must be manually copied from the DotNET folder to the build (or run) folder of your project using one of the following two methods:
- Set up a pre-build event to copy them.
- Add them to your project as items to be copied to the build folder.This is the method used in the samples projects shipped with the installation.
To redistribute applications that reference the A3200 .NET library, copy all the files located in the DotNET folder in the installation folder of the software.
There are several resources that are localized in the .NET library to various languages (such as error messages). To use these localized resources in applications, copy the subdirectories found in the DotNET folder. For the satellite assemblies to be loaded correctly, they must remain in the subdirectory where they are located and the subdirectory must be located in the same directory as Aerotech.A3200.dll.
This library is built using .NET 2.0 and can be used in projects built using .NET 2.0 or newer.
- 示例
The routine way to use the .NET library follows and is illustrated in these examples:
- Connect to the Controller.
- Alter the Controller as necessary.
- Disconnect from the Controller (optional).
Example 1
C# | Copy |
---|---|
Controller controller = Controller.Connect(); // connects, initializes if necessary, and gets the controller ... Controller.Disconnect(); // disconnects from the controller (optional) |
Example 2: Enable axes X and U
C# | Copy |
---|---|
Controller controller = Controller.Connect(); controller.Commands.Axes["X", "U"].Motion.Enable(); |
Example 3: Change the home offset parameter on axis #5
C# | Copy |
---|---|
Controller controller = Controller.Connect(); controller.Parameters.Axes[5].Motion.Home.HomeOffset.Value = 10000; |
Example 4: Run a program in task 1
C# | Copy |
---|---|
Controller controller = Controller.Connect(); // you can compile and run an AeroBasic program controller.Tasks[TaskId.T01].Program.Run("C:\\program.pgm"); |
Example 5: Receive events to monitor the status for the controller using the ControlCenter
C# | Copy |
---|---|
public static void Main(string[] args) { Controller controller = Controller.Connect(); // DiagPacketArrived is the method below controller.ControlCenter.Diagnostics.NewDiagPacketArrived += new EventHandler<NewDiagPacketArrivedEventArgs>(DiagPacketArrived); // wait for Enter Console.ReadLine(); } public static void DiagPacketArrived(object sender, NewDiagPacketArrivedEventArgs e) { // print out some diagnostics Console.WriteLine("Diag Packet From : " + e.Controller.Information.Name); Console.WriteLine("Axis X is Enabled : " + e.Data["X"].DriveStatus.Enabled); } |
Example 6: Enable axes X and U using Task #1
C# | Copy |
---|---|
Controller controller = Controller.Connect(); controller.Commands[TaskId.T01].Axes["X", "U"].Motion.Enable(); |
The examples of custom applications are in the Installation directory in the Samples directory.