Option 4.3.4. Use Address Adjustment Expressions

Address adjustment expressions provide a powerful tool that automates applying addresses to devices at the object level.

Address adjustment expressions are based on the ADDRESS_ADJ expression target. This function is most useful when a final address is provided for the object by adding the offset number to the value in the object's Address attribute.

  1. Make sure your PLC stores data in contiguous blocks (or in blocks that are equally spaced apart).

Example

You have two tanks with data mapped in two contiguous blocks.

  1. Use class attributes to enable the object designer to enter the base address for each block as follows:

  1. Use the CIMPLICITY $ADDRESS attribute for the first block.

  2. Create class attributes for the second and any additional blocks.

Example

An attribute that will be used in address adjustment is named OUTPUT_ADDR.

  1. (Optional) Enter a base address in the Attribute dialog box.

Note: All address adjustment attributes appear as fields in the Object dialog box. When an object designer creates an object, base addresses can be entered for that object. If you enter a base address, that address appears as the default in the Object dialog box..

  1. Determine the offset for addresses that are above the base address using the formula.

Offset = PLC Address - Base Address.

Example

5=%R105-%R100

  1. Create an address adjustment expression as follows:

  1. Select the Expressions tab in the Data item dialog box.

  2. Click New.

The New Expression dialog box opens.

  1. Select $ADDRESS_ADJ from the drop-down list.

  1. Click OK.

The Expression dialog box displays.

  1. Check Number and enter the address-offset in the Number field, e.g. 1.

  1. Click OK.

  1. Create an additional address adjustment expression as follows:

  1. Select the Device tab in the Data Item dialog box.

  2. Enter the name of the custom (address adjustment) attribute in brackets in the Address field, e.g. {OUTPUT_ADDR}.

This is necessary to ensure that the custom attribute OUTPUT_ADDR is used for the base address instead of defaulting to the CIMPLICITY attribute, $ADDRESS.

  1. Select the Expressions tab.

  2. Click New.

A New Expression dialog box opens.

  1. Select $ADDRESS_ADJ from the drop-down list.

  2. Click OK.

The Expressions dialog box opens.

  1. Check Number and enter the address-offset in the Number field; e.g. 1.

  2. Click OK.

Result: CIMPLICITY will automatically assign device points with addresses when an object designer enters the base address for the one or more configured blocks in the Object dialog box. The addresses will be calculated based on the adjustments you specified in the Expression dialog box.

More information

Step 4.3. Take advantage of data item class features.