Working with Include Files

An Include file is a type of code file (.axi) that is included in the compiling process without having to reside in the Master Code file itself. Include files are effectively linked to the Source Code file, and must be called in the Master Source Code. You can create new Include files using the File > New > Include File option, or import existing Include files into your Project. Include files are stored in the Include folder (in the Workspace tab of the Workspace Bar). If any Include files are present in the Include System File folder when the Project is compiled (and if they are called in the source code), they are compiled as if the code that they contain was part of the Master Source Code file.

"NetLinx .axi" File

Any time you compile a NetLinx file, the file "NetLinx.axi" is accessed. This is the default NetLinx include file, and it contains various standard NetLinx system structures and variables. This file is called at every NetLinx compile operation and is included even without being specified in the program. The NetLinx.axi file is updated in step with version changes of NetLinx Studio. If there are ever any interim updates to the NetLinx.axi file, you will be notified via the AMX newsletter, and the update will be posted to the Software Center on the AMX.com website.

Adding a New Include File to a System

  1. Click to select (highlight) a System (in the Workspace tab of the Workspace Bar).
  2. Right-click on the Include folder to access the Include File Folder context menu, and select Add New Include File (FIG. 87).

FIG. 87 Include Folder Context Menu

  1. In the New Include File dialog, specify a File Name and target location for the new Include file (FIG. 88).

FIG. 88 New Include File dialog

  1. By default, the new file is named NewInclude.axi. Edit the file name and the target location for the file and click OK.
    • Note that you can enter a path for a non-existing folder in the text box and the program will create it for you.
    • Click the Browse button to locate and select the target directory in the Browse For Folder dialog.
  2. Click OK to save changes and close the dialog.
  3. A new (empty) Include file is opened in a new Editor window, and the File Properties dialog, populated with the new Include file information is presented (FIG. 89). Use the options in this dialog to view/edit the file properties as desired.

FIG. 89 NewInclude.AXI file in an Editor Window and the File Properties dialog

  1. Click OK to close the File Properties dialog.
  2. The NewInclude.axi file is opened in an Editor window for editing. Also, the new file should now appear in the Include folder under the selected System (FIG. 90).

FIG. 90 Workspace tab - Include File Added

Adding an Existing Include File to a System

  1. Click to select (highlight) a System (in the Workspace tab of the Workspace Bar).
  2. Right-click on the Include folder to access the Include File Folder context menu, and select Add Existing Include File (FIG. 91).

FIG. 91 Include Folder Context Menu - Add Existing Include File

  1. In the Add Existing Include File dialog, locate and select the Include (.AXI) file that you want to add to the selected System. Use the Recent tab to quickly access recently used files (FIG. 92).

FIG. 92 Add Existing Include File dialog

  1. Click Open to access the File Properties dialog to view/edit general file information for the selected file(s) (FIG. 93).

FIG. 93 File Properties dialog

NOTE: If you select multiple f iles to add to the System, the program will prompt you to edit the f ile properties for each f ile before adding them.

  1. Click OK to add the file to the selected System.

Note that the file now appears in the Include folder under the selected System. Double-click to open the file in an Editor window (FIG. 90).

FIG. 94 Workspace tab - Include File Added

Creating a New Include File (Outside of a System)

To create a new Include file (that is not associated with a System).

  1. Select New from the File menu to open the New dialog (FIG. 95).

FIG. 95 New dialog - Include File selected

  1. Select Include File and click OK to open the New Include File dialog (FIG. 96).

FIG. 96 New Include File dialog

  1. By default, the new file is named NewInclude.axi. Edit the file name and the target location for the file and click OK.
    • Note that you can enter a path for a non-existing folder in the text box and the program will create it for you.
    • Click the Browse button to locate and select the target directory in the Browse For Folder dialog.
  2. Click OK to save changes and close the dialog.
  3. A new (empty) Include file is opened in a new Editor window, and the File Properties dialog, populated with the new Include file information is presented (FIG. 97). Use the options in this dialog to view/edit the file properties as desired.

FIG. 97 NewInclude.AXI file in an Editor Window and the File Properties dialog

  1. Click OK to close the File Properties dialog.
  2. Edit the NewInclude.axi in the Editor window as required.

results matching ""

    No results matching ""