Program Automation Module
You can use the Program Automation module of the Develop workspace to do all of the operations that follow:
- Automatically run compiled AeroScript programs.
- Automatically load compiled AeroScript programs on the controller.
- Automatically load compiled AeroScript libraries on the controller.
- Automatically import compiled AeroScript libraries while you are compiling AeroScript programs.
- Automatically include AeroScript files while you are compiling AeroScript programs.
Tip: For information about how to compile an AeroScript program or library file, see Working with Compiled Programs and Libraries.
When you make AeroScript programs and library files, you can use the AeroScript Programming Language section of the help file and the AeroScript Programming Language Reference guide to help you get started.
Automatically Run a Compiled Program
You can configure a compiled program to run automatically when the controller starts or resets. Use the Compiled Programs tab to select a compiled AeroScript program (.a1exe). In the Mode column, select Run.
The Program Automation module uses only the AeroScript files that are located in the Controller File System. Thus if you click the Select Program button and cannot find your compiled programs, refer to the procedure that follows:
- In Studio, select the Configure tab.
- In the Controller category, select the Controller Files topic.
- Create the folder where you want to put your compiled programs. Then open it.
- Click the Upload Files/Folders link.
- In the Open dialog, make sure the Automation1 folder is selected. This folder is in your Documents folder. On the bottom-right part of the Open dialog, select the file type as Compiled AeroScript programs (*.a1exe). All of your compiled programs will come into view. They use the extension .a1exe.
- Select the compiled programs that you want to move into the specified folder. Then click Open. The application adds the selected programs to the folder.
- In Studio, select the Develop tab.
- Find the Program Automation module and select the Compiled Programs tab.
- Click the Select Program button.
- In the Open dialog, navigate to the folder that has your compiled programs. Open this folder. Then select the compiled program that you want to use and click Open.
- In the Mode column, select Run.
- After you configure the program to run, click Save All. The changes will be active after the controller starts or resets. To cancel all changes and go back to the configuration screen, click the Discard button.
Tip: This procedure is based on the default file path that the Programming module uses when you compile an AeroScript program. It is C:/Users/<username>/Documents/Automation1. If you saved your AeroScript program to a different location, you must recompile the program in its new location. Then use the new file path for this procedure. For information about how to compile an AeroScript program, see Working with Compiled Programs and Libraries.
You can also select the task on which the program will automatically run when the controller starts or resets. For information about how to configure two or more tasks, see Tasks Category.
Automatically Load a Compiled Program
You can configure a compiled program to load automatically when the controller starts or resets. To control the execution of the program, use the Program Control AeroScript functions.
Use the Compiled Programs tab to select a compiled AeroScript Program (.a1exe). In the Mode column, select Load.
You can also select the task on which the program will automatically load when the controller starts or resets. For information about how to configure two or more tasks, see Tasks Category.
After you configure the program to load, click Save All. The changes will be active when the controller starts or resets. To cancel all changes and go back to the configuration screen, click the Discard button.
Automatically Load a Compiled Library
You can configure a compiled library to load automatically when the controller starts or resets. You can dynamically import these libraries into your AeroScript programs so you can access their functionality from within your programs.
On the Compiled Libraries tab, click Add Library to select a compiled AeroScript Library (.a1lib).
The Program Automation module uses only the AeroScript files that are located in the Controller File System. Thus if you click the Add Library button and cannot find your compiled library files, refer to the procedure that follows:
- In Studio, select the Configure tab.
- In the Controller category, select the Controller Files topic.
- Create the folder where you want to put your compiled library files. Then open it.
- Click the Upload Files/Folders link.
- In the Open dialog, make sure the Automation1 folder is selected. This folder is in your Documents folder. On the bottom-right part of the Open dialog, select the file type as All files (*.*). All of your compiled library files will come into view. They use the extension .a1lib.
- Select the compiled library files that you want to move into the specified folder. Then click Open. The application adds the selected libraries to the folder.
- In Studio, select the Develop tab.
- Find the Program Automation module and select the Compiled Libraries tab.
- Click the Add Library button.
- In the Open dialog, navigate to the folder that has your compiled libraries. Open this folder. Then select the compiled library that you want to use and click Open.
- After you configure the library to load, click Save All. The changes will be active after the controller starts or resets. To cancel all changes and go back to the configuration screen, click the Discard button.
Tip: This procedure is based on the default file path that the Programming module uses when you compile an AeroScript library. It is C:/Users/<username>/Documents/Automation1. If you saved your AeroScript library to a different location, you must recompile the library in its new location. Then use the new file path for this procedure. For information about how to compile an AeroScript library file, see Working with Compiled Programs and Libraries.
Automatically Import a Compiled Library
You can configure a compiled library to be imported automatically when you compile an AeroScript program. The selected library will be dynamically imported during the compilation of all AeroScript programs. No explicit import statement is necessary in the AeroScript program.
On the Compiled Libraries tab, click Add Library to select a compiled AeroScript Library (.a1lib). Then set the Auto-Import toggle to On.
IMPORTANT: If you use the Auto-Import feature of the Program Automation module, you might receive compiler errors that include information about redefined functions, properties, enums, or structs. You can prevent these errors by using top-level metadata comments in your Auto-Import libraries. For more information, see Recompile Program Automation Auto-Import Libraries.
After you configure the library to import, click Save All. The changes will be active when the controller starts or resets. To cancel all changes and go back to the configuration screen, click the Discard button.
Automatically Include a File
You can configure a file to be included automatically when you compile an AeroScript program. The selected file will be included during the compilation of all AeroScript programs. No explicit #include statement is necessary in the AeroScript program.
On the Included Files tab, click Add File to select a file with the extension .ascript.
After you configure the file that you want to use, click Save All. The changes will be active when the controller starts or resets. To cancel all changes and go back to the configuration screen, click the Discard button.
Changing the Module Layout
You can change the size of the module when you click and drag the border with other modules in the workspace.
In the top-right part of the module header, click the Expand button to let the module fill all of the workspace area. While it is expanded, you can click the Restore button to let the module go back to its original size.