Aliases device

An Aliases device is a logical device that references other device variables. The Aliases device type includes the option to:

  • Reference multiple device variables that reside in other, multiple, devices defined on the same node.
    When defining the device variables in the Aliases device, you can define variable names that are different from the actual referenced device variables.
    This is both a level of indirection and an aggregation feature.
  • Reference a single device, defined on the same node, which then gives access to all of the device variables defined in that referenced device.
    This is a level of indirection feature for the Aliases device.

The following illustrates the concept of indirection of a single device variable:

In this example, the trigger references the Aliases device variable name and not the PLC address 1. Should the application change and the referenced data moves to PLC address 2, the trigger does not have to be modified. You simply re-map the Aliases device variable to the new PLC device variable.

Here are other advantages for using an Aliases device:

  • If the actual device variable is referenced by many (perhaps tens or hundreds of triggers) and that device variable changes its name or location, the Aliases device variable only has to be re-mapped in a single location, and not hundreds of triggers.
    This reduces application maintenance cost.
  • An Aliases device can define variables that reference multiple actual devices. In other words, the triggers have a logical view of one device (the Aliases device), while underneath there may be multiple actual devices. Instead of applying security policies to multiple physical devices, you can just apply a security policy to the one Aliases device.
    This simplifies the security access control policy definition and allows a straightforward way to provide different users different levels of access to device variables, if required.

Defining an Aliases device using the Variable Aliasing Mode

To define an Aliases device using the Variable Aliasing Mode, follow these steps:

  1. From the Workbench left pane, expand the node where you want to define the Aliases device.
  2. Select the Devices icon to display the Devices panel, right-click the Devices icon to display its pop-up menu, and then select New. You also can select the New button at the bottom of the Devices panel.
  3. Name the device. The device name can be up to 64 characters and include letters, numbers, and the underscore character. Spaces are allowed.
  4. Use the Type down-arrow, locate the System category, and then select Aliases.
  5. The Device window changes to accommodate an Aliases device. In the Configuration section, select Variable for the Aliasing Mode parameter.
  6. In the Configuration section, next to Variables, select Configure.
  7. A Variables window appears.
  8. Select Add. The New Variable window appears.
  9. In the Name box, type a name for the Aliases device variable.
  10. Use the Type down-arrow to select the type of data the variable will represent. For this example, INT4 is selected.
    The X, Y, and Z values represent the dimensions of an array variable:
    X is the first dimension
    Y is the second dimension
    Z is the third dimension
  11. If the variable type is INT1 or UINT1 and the alias type is STRING, you may choose "Cast values to characters" to cast the integer to a character. For example, an integer value of 65 would be be mapped to the string as "A" when this checked and "65" when it is not. INT1 negative values will be treated as the positive UINT1 byte equivalent for character representation.
  12. Type an optional Description for the variable.
  13. Use the Variable down-arrow to display a list of currently started devices.
  14. Select the desired device variable. For example, Local CPU 1.D[0].
  15. Select Add to finish.
  16. Repeat the steps for additional variables.
  17. Select OK to return to the Device window.
  18. Select the option for the Per Variable Security parameter:
    False to disable
    True to enable (see Setting up Read Write per device variable)
  19. Select Save to save the device definition.
  20. You can now control and use the device in your solutions.

Defining an Aliases device using the Variable Aliasing Mode

To define an Aliases device using the Variable Aliasing Mode, follow these steps:

  1. From the Workbench left pane, expand the node where you want to define the Aliases device.
  2. Select the Devices icon to display the Devices panel, right-click the Devices icon to display its pop-up menu, and then select New
    You also can select the New button at the bottom of the Devices panel.
  3. Name the device. The device name can be up to 64 characters and include letters, numbers, and the underscore character. Spaces are allowed.
  4. Use the Type down-arrow, locate the System category, and then select Aliases.
  5. The Device window changes to accommodate an Aliases device.
    In the Configuration section, select Variable for the Aliasing Mode parameter.
    The Device window changes to accommodate the Variable option for the Aliasing Mode parameter.
  6. In the Configuration section, next to Variables, select Configure.
  7. A Variables window similar to the following appears.
  8. Select Add.
    The New Variable window appears.
  9. In the Name box, type a name for the Aliases device variable.
  10. Use the Type down-arrow to select the type of data the variable will represent.
    The standard data types are listed. For this example, INT4 is selected.
    The X, Y, and Z values represent the dimensions of an array variable:
    X is the first dimension
    Y is the second dimension
    Z is the third dimension
  11. If the variable type is INT1 or UINT1 and the alias type is STRING, you may choose "Cast values to characters" to cast the integer to a character. For example, an integer value of 65 would be be mapped to the string as "A" when this checked and "65" when it is not. INT1 negative values will be treated as the positive UINT1 byte equivalent for character representation.
  12. Type an optional Description for the variable.
  13. Use the Variable down-arrow to display a list of the currently started devices on this node.
  14. Expand the appropriate device's internal structure and variables, and then select the device variable you want to use as the referenced device variable. For this example, Local CPU 1.D[0] is selected.
    The value is added to the Variable box.

    The New Variable window contains a variable called AliasVar1 which is defined as an INT4.
    AliasVar1 references a device, Local CPU 1, and its variable at D[0]. This example is referencing a Mitsubishi PLC, so the D[0] variable name is using Mitsubishi PLC device variable naming concepts.
    When a trigger references the Aliases device AliasVar1 variable, it is actually referencing the 4 bytes in the Local CPU1 PLC device starting at D[0].
  15. When finished with this Aliases device variable, select Add.
    The Variables window re-appears with the parameters you specified for the first variable.

    The new variable is added to the Variables window and indicates that Local CPU 1.D[0] will be accessed as an INT4 in a trigger when the trigger references this Aliases device variable. In this example, AcmeProducts_Alias_Device. AliasVar1.
  16. Repeat the steps to configure any additional variables for this Aliases device.
    The additional variables can reference any of the devices that are started on this node.
    This feature allows you to aggregate the actual device variables from multiple devices into this one single Aliases device.
  17. When finished adding variables, select OK to return to the Device window.
  18. Select the option for the Per Variable Security parameter:
    Select False to disable the allocation of additional memory to track User to Variable access for all Variables in this Device.
    Select True to enable this feature if required. For more information, see Setting up Read Write per device variable.
  19. Select Save to save the device definition. The device will appear in the Devices window list of devices.
  20. You can now control the device (Start, Stop), access the device's variables by using the Variables window, and build solutions that use the device's resources.

The name of the Aliases variable appears in the Devices tab.

For triggers to be able to access these variables, you must start the Aliases device.
When the device is started, you will see the device and its variables in the Variables tab.

The following is a partial view of a trigger that uses the Aliases device variable just defined.

The trigger Set action assigns the value 123 to the Aliases device variable AliasVar1.
This is actually assigning the value 123 as an INT4 data type to the device variable Local CPU 1.D[0].

Defining an Aliases device using the Device Aliasing Mode

To define an Aliases device using the Device Aliasing Mode, follow these steps:

  1. From the Workbench left pane, expand the node where you want to define the Aliases device.
  2. Select the Devices icon to display the Devices panel, right-click the Devices icon to display its pop-up menu, and then select New.
    You also can select the New button at the bottom of the Devices panel.
  3. Name the device. The device name can be up to 64 characters and include letters, numbers, and the underscore character. Spaces are allowed.
  4. Use the Type down-arrow, locate the System category, and then select Aliases.
  5. The Device window changes to accommodate an Aliases device.
    In the Configuration section, select Device for the Aliasing Mode parameter.
    The Device window changes to accommodate the Device option for the Aliasing Mode parameter.
  6. In the Configuration section, in the Device Name parameter, select the device that will be the referenced device.
  7. Select the option for the Per Variable Security parameter:
    Select False to disable the allocation of additional memory to track User to Variable access for all Variables in this Device.
    Select True to enable this feature if required. For more information, see Setting up Read Write per device variable.
  8. Select Save to save the device definition. The device will appear in the Devices window list of devices.
  9. You can now control the device (Start, Stop), access the device's variables by using the Variables window, and build solutions that use the device's resources.

The Aliases device, using Device Aliasing mode, will have reference to all of the device variables in the referenced device.
When a variable is referenced in the Aliases device, it will actually be referencing the corresponding variable in the referenced device.

Editing and updating an Aliases device

One of the advantages when using Aliases device variable is that the triggers and other components that reference the Aliases device variable have a level of indirection from the actual device variable. Should the actual device variable, you only have to edit the Aliases device variable and not the triggers and other components.

The following describes the steps to edit an Aliases device and have the updates take effect.

  1. From the Devices tab, display the pop-up menu for Aliases device you want to update, and then select Stop.
    Or select the Aliases device and then select the Stop button at the bottom of the panel.
    The State column for the Aliases device changes to Stopped.

  2. Select the Aliases device, display its pop-up menu, and then select Edit.
    Or select the Edit button at the bottom of the panel.
    The Device window for the alias variable appears.

  3. From under Configuration, next to Variables, select Configure.
    A Variables window appears with the defined variables. In this example, there is the one variable we defined.

  4. Select inside the Variable column to display the list of started devices, expand the appropriate device's internal structure and variables, and then select the device variable you want to use as the referenced device variable.

  5. When changes are complete, select OK to return to the Device window, and then select Save to save the device definition
    You are returned to the Devices tab. For triggers and other components to access the updated variables, you must start the Aliases device.

What's Inside