Add-On Instruction guidelines

Keep these guidelines in mind when defining an add-on instruction.
  • Use the
    aoi
    keyword to declare an add-on instruction instance and definition.
  • Add-on instructions do not support inheritance.
  • Add-on instructions are allowed to have only specifically named routines. The routine names represent what the routine is for. Like the program, the AOI’s routine names define whether the routine is a logic, prescan, or enableInFalse routine. For example, to add an enableInFalse routine, add a routine called enableInFault.
  • To create an instance within a routine, you must add the instance and, at some point, provide the backing tag.
    • The backing tag is passed into the add-on instruction as the first parameter.
    • The data type comes from the add-on instruction definition and is updated when the definition changes.
      The datatype name is the add-on instruction name with
      _TYPE
      appended to it. For example, for an add-on instruction named myAOI, the data type is named myAOI_TYPE.
  • You can specify routines in add-on instructions as Inline and external routines. To define an add-on instruction as a single file, you must specify the routines as inline.
  • You can mark the parameters of an add-on instruction as visible (true or false), which determines the default visibility of the parameter. Pins are visible by default.
    Example qualifiers specific to add-on instructions
    Description
    Can be a qualifier
    Visible
    Default visibility of the parameter for the add-on instruction instances.
    Yes
    Required
    Specifies that the parameter is required, and the pin is automatically visible. If visible is set to false, a warning should appear to the user.
    Yes
This example shows the parameters listed within the () of the AOI declaration. These parameters have a visibility property.
Example: Showing a hidden output parameter.
Aoi someAOI (input dint input1, output hidden dint output1) {
tag dint localTag;
}
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.