How to import a Schneider Electric Unity configuration

The Smart Generator for Unity allows you to import a Unity project file to generate I/O variables including mapping onto an OFS OPC Server.

The Smart Generator for Schneider Unity is compatible with Unity Pro version 7.0.

Supported data types

Unity variables are converted to PcVue variables as follows:

Unity data type PcVue variable type Min value Max value

Dword

Register

0

4294967295

Bool

Bit

0

1

Byte

Register

0

255

Date

Register

-2147483648

2147483648

Dt

Text

N/A

N/A

Dint

Register

-2147483648

2147483648

Ebool

Bit

0

1

Int

Register

-32768

32768

Real

Register

-3.402824E+38

3.402824E+38

String

Text

N/A

N/A

Time

Register

0

4294967295

Tod

Register

0

4294967295

Udint

Register

0

4294967295

Uint

Register

0

65535

Word Register

0

65535

Structured Unity variables are imported as a branch and variables in PcVue.

For example, if the structure DDT has three elements F1, F2, and F3. The instance, DDT1, will generate three variables in PcVue: DDT1.F1, DDT1.F2, and DDT1.F3.

Tables of variables and variable tables which are imported as a branch and variables in PcVue:

  • A table of variables is a table of Elementary Data Types.

  • A variable table is an instance of a DDT type array (DDT may be an array or structure).

For example, the integer table MyIntegerTab[0..4 ] will generate five register variables in PcVue: MYINTEGERTAB.MYINTEGERTAB_0, MYINTEGERTAB.MYINTEGERTAB_1, MYINTEGERTAB.MYINTEGERTAB_2, MYINTEGERTAB.MYINTEGERTAB_3, and MYINTEGERTAB.MYINTEGERTAB_4.

Prerequisites

  • You have configured an OPC connection to OFS in PcVue.

  • You have configured one or more OPC groups.

  • You have configured OFS, in particular the link with the Unity PLC and its symbol tables file (STU).

For the smart generator to access the Symbol Table File (STU), PcVue must be run as administrator.

Refer to the overview topic Smart Generators overview to learn more.

Selecting the source data

Before you start the import process, we recommend that you back up the PcVue variables configuration in case of any problems occurring during the import process. The variable configuration is stored in the file VAREXP.DAT in the project's C folder.

Make sure that PcVue is shut down before copying the file.

  1. Go to Configure then Smart Generators and click New Unity import. The Smart Generator for Unity dialog opens with the Import name field specified. You can change this name. ClosedShow picture

  2. Select the Unity project filename. The file can be located on the local PC or any network location visible to the smart generator.

  3. (Optional) Enter a Custom string. This property pre-filters the import by matching the supplied string against the contents of the variable's comment field in the Unity project database. Only variables with comments containing the supplied string pass the pre-filter. For example, if you enter {hmi} in the Custom string field, the smart generator will only makes available items whose comment field contains {hmi}. This custom string does not support wildcards.

    The use of a custom string is highly recommended as the STU file may contain a large number of variables, many of which may not be relevant to the smart generator.
  4. Select the Unity server location. The Unity server can be located on the local PC or any other PC visible to it. If this field is left blank, it is assumed that it is on the local PC.

    If you select the Open with profile option, you are prompted to enter a Login name and password when the smart generator connects to the Unity server. This protected mode of operation must be first activated within Unity Pro before it can be used.

  5. From the drop-down menus, select the OFS server alias and the OPC group in the Communication section. These are used when generating the configuration of PcVue variables. The list of available server aliases is read from PcVue.

  6. Select the Device alias. This is used when generating the configuration of PcVue variables. The list of available device aliases is read from the OFS configuration. The symbol table file for the Device alias (in the OFS configuration) should be the same as the Unity project filename.

Defining branches and selecting variables

After you have selected the source data and configured the networking lists and options of the import via the Select project dialog, the next step is to define the branches and select the variables you want to generate.

  1. Click Next, the variable import process is initialized and the Select import type dialog opens. Select the type of import you need:

    • Custom import if you want to access the Select variables dialog in which you can filter and manually select the list of variables to import.
    • Full import if you want to generate variables for all source data.
  2. (Custom import option) Adjust the filters to find the variables to import. The Name field allows to filter the list of variables according to the name in the source data. You can use wildcards, the asterisk (matches any number of characters) and the question mark (matches a single character).

    For example:
    'Pump1' would only match a source data named 'Pump1'.
    'Pump?' would match 'Pump1' or 'Pump2' etc. but not 'Pump10'.
    'Pump*' would match 'Pump1', 'Pump2' and 'Pump10' but also 'Pumpkin'.

    The variables that match the filter appear in the Available Items pane.

  3. (Custom import option) Select the variables filtered in the Available items pane for import and click the right-arrow -> button. The variables in the Selected items pane are to be imported and generated.

  4. ClosedShow picture

  5. Click Next, the Branch Management dialog opens. This step allows you to control how branches and variable names are derived from source data names so that the generated variables fit in the branching and naming logic of your project. First, you can enter a global branch if you want to prefix the name of all generated variables with a particular branch segment. You can also select branch separator options to control how source data names will be split into branch segments:

    • Use numeric characters as branch separator - If selected, a branch separator will be added after each numeric character. For example, a source data named MOT1DEFAULT1 will generate a variable named MOT1.DEFAULT1.

    • Use specific sequence character as branch separator - If selected, the sequence of characters you select will be replaced by a branch separator. For example, if you select the underscore ('_') as sequence character, a source data named CONTROLROOM_COMMAND will generate a variable named CONTROLROOM.COMMAND.

    A branch separator is not added when a numeric character is at the end of the name.

Renaming and generating variables

After you have defined the branch and selected variables to generate via the Select variables dialog, the next step offers the possibility to edit the variables you have selected and prepare them for generation.

If a variable is displayed in red, it means that it is invalid for use in PcVue and will not be generated. Use the Rename variables dialog to ensure variable name compliance:

  • The max length of a variable name is 255 characters.
  • The max number of branch elements in a variable name is 12.
  • The name of a branch element or the name of the leaf element cannot be empty (length =0) or exceed 255 characters.
  • The name of a variable can only include letters, digits, or the underscore.
  • Variable names shall be unique. Two variables cannot have the same name.
  1. Click Next. The Generate variables dialog opens, listing all variables selected for generation. To rename variables, either select variables and click Rename selected, or use the Rename invalid button. The Rename variables dialog displays variables in a grid and offers several actions.

    ClosedShow picture

  2. The Rename variables dialog is designed to make it easy to give a final polish to variable names and fix invalid ones, and also to bulk modify variable properties, to set the Command level or Alarm property for example.

    The following operations are available:

    • To modify a single variable, double click it, or select it and click Properties. You can edit its name in the General tab. Click OK to validate.
    • You can edit the variable properties in the Details tab. These properties can be its type, domain, nature etc.

    • To add a leaf to one or more variables (to add a .Cmd or .AlarmTmpHigh for example), select them, then click Suffix and enter the suffix to be added. Click OK to validate.
    • To replace characters in the name of one or more variables, select them, then click Replace to open the Replace dialog. Enter the strings to search and replace, then click OK.
    • To replace branch segments, select the variables, then select the branch segments to be replaced by clicking on the column header and click Replace to open the Replace dialog. Enter the strings to search and replace, then click OK.
    • To delete a branch segment, select the variables, then the branch segments to be removed by clicking on the column header and click Delete. The selected branch segments are then removed from the selected variables.
    • To merge branches, select the variables, then the branch segments to be merged by clicking on the column header and click Merge. The selected branch segments are then deleted for the selected variables. You can only merge consecutive branch segments.

    You can use Shift+click to select a group of adjacent variables and branches or Ctrl+click to select several individual variables.

    Once you are done editing the variables click OK to close the dialog.

  3. Click Finish and Yes in the Generation dialog to start the generation of variables in PcVue. A dialog is displayed indicating the progress. Any variables in the smart generator that already exist in PcVue are discarded. The corresponding variables in PcVue are not overwritten or updated in any way.

    Any variables appearing in red are invalid and will not be generated when clicking Finish.

Synchronizing an existing import

When you synchronize an import, the smart generator compares the configuration elements available in the import file with those that have been imported previously to PcVue.

The synchronizing process takes into account any filter that you may have used previously with the import. For example if there are 400 variables in the import file and the previous use of the import was with a filter and created 100 variables in PcVue, synchronization will inform you that there are 300 new variables available for import.

  1. Select the import to synchronize in the right pane of the Smart Generators dialog. A list with actions appears under the Import references pane. ClosedShow picture

  2. Click Synchronize. This will open the smart generator dialog in which you can reconfigure the import. If variables have been added to the import file since the last import, the smart generator will display the Import new variables dialog, inviting you to make either a full or a custom import of the remaining variables.

    • If you select full import, all variables not already in PcVue are imported.

    • If you select custom import, you can filter the variables using the Select variables dialog.

If the smart generator finds variables in PcVue that no longer exist in the import file, a list of the variables is displayed. Using this list, you can choose to remove some or all of the variables from PcVue.

You can choose to only remove imported configuration elements of a smart generator without removing the smart generator import itself. This can be done by right-clicking the import generated and selecting Remove all imported objects.