Tag Import

<< Click to Display Table of Contents >>

Navigation:  Modbus Universal MasterOPC Server > MasterOPC Universal Modbus Server > The Design-Time Mode > Operations in the Object Tree >

Tag Import

Tag Import

mbul_mail The Map Template Editor

mbul_mail Example of Default Import

mbul_mail Example of Customized Import

The Import tags command is available in the device context menu.

Upon the command, the first dialog of the import wizard is displayed:

modbus_img56

The dialog tools are:

mbul   File – a CSV file (click modbus_img57 to open the standard file selection dialog)

mbul   Delimiter – a delimiter of columns in CSV file

mbul   Template – a map template (such a template defines correspondence between tag properties and CSV-file columns):

mbul   modbus_img58 Load a template – load a user template

mbul   modbus_img59 Edit the current template – open the current user template in the respective editor (see The Map Template Editor ; the built-in template is unavailable for user)

mbul   modbus_img60 Create a new template – open the map template editor

mbul   modbus_img61 Load the default template – load the built-in map template

mbul   Comment – this textbox displays a comment specified for a user template in the editor ("default template" is displayed for the built-in template)

mbul   Template parameters – this section displays parameters of a user template

The Map Template Editor

modbus_img62

The editor tools are:

mbul   Template – this textbox displays a pathname of the current user template (if the editor is opened upon the command modbus_img63 ):

modbus_img64

mbul   Comment – template comment

mbul   A group of tag properties (Identifier, Region, etc.):

mbul   Column of CSV file – correspondence between a tag property and a column of CSV file. In all groups except for Identifier, this parameter is available only if Use field of CSV file=TRUE.

mbul   Use constant value – a constant value for the respective tag property (that property of each imported tag will be equal to the value specified here). In all groups except for Identifier, this parameter is available only if Use field of CSV file=FALSE.

mbul   Edit conversion script – a value cell of that parameter contains the button modbus_img65 to open the script editor . The editor contains the preset function ConvertContent that may be used to modify a value read out from a CSV file (the Content argument) before that value is written to a tag property:

modbus_img66

In all groups except for Identifier, this parameter is available only if Use script for conversion=TRUE.

mbul   Save – save the edited template (the file is overwritten)

mbul   Save as – save the edited template to arbitrary *.uit file (the default folder for templates is ..\TEMPLATES\)

mbul   Cancel – close the editor (all unsaved changes are discarded)

mbul   OK – close the editor (after saving)

Example of Default Import

If such an import is used, column captions in a file must be the same as in an exported file (see Tag Export ):

Name;Region;Address;DataType;Access;ByteOrder;Comment

SubDevice1{s}Group1{g}Tag1;HOLDING_REGISTERS;6;int16;ReadOnly;10325476;Device value

Group1{g}Group11{g}Tag1;HOLDING_REGISTERS;4;int16;ReadOnly;10325476;

Group1{g}Tag1;HOLDING_REGISTERS;3;int16;ReadOnly;10325476;

Tag1;HOLDING_REGISTERS;1;int16;ReadWrite;10325476;

To import, do the follows:

mbul   In the first dialog of the import wizard, click the modbus_img67 Load the default template button (in the Template section)

mbul   Select a *.csv file, using the tool modbus_img68 of the File section

modbus_img69

mbul   Click Next; the second dialog of the import wizard is displayed (the File CSV section displays a tag table read out from the file):

modbus_img70

Note 1. If a file contains errors, their description is displayed:

modbus_img71

If this dialog is closed, an error is displayed red in the import dialog:

modbus_img72

Note 2. If a file does not contain captions required, the respective message is displayed:

modbus_img73

mbul   Select tags to be imported (the tools of this dialog are identical to tools of the dialog that is displayed upon the Export tags command – see Tag Export )

modbus_img74

Next, there are two variants.

Variant 1

If an imported structure must be created in the device itself (but not in a subdevice or a group), click the OK button. Upon this command, selected tags along with their hierarchy are imported into the device (subdevices and groups specified in relative tag names are created):

modbus_img75

Variant 2

If an imported structure must be created in a subdevice or in a group of the device, click the Next button. Upon this command, the third (final) dialog of the import wizard is displayed:

modbus_img76

Then, do the follows:

mbul   Select tags to be imported (multiple-tag selection is supported in the Tags section). To select all of tags, click the button modbus_img77 or use the Select all command of the section context menu.

mbul   Select a device/subdevice/group. Using tools of the Device section, you can modify a device structure:

mbul   modbus_img78 – add a subdevice to the highlighted device

mbul   modbus_img79 – add a group to the highlighted object

mbul   modbus_img80 – rename the highlighted object

mbul   modbus_img81 – delete the highlighted object

mbul   modbus_img82 – undo the last action

mbul   modbus_img83 – redo the action undone last

mbul   Move selected tags to the required subdevice/group. To move to the highlighted subdevice/group, click modbus_img84 . To move to arbitrary subdevice/group, drag tags to that subdevice/group:

modbus_img85

While moving, hierarchy of tree objects is traced. If hierarchy violation is detected, tags are not moved, and the respective message is displayed:

modbus_img86

mbul   Click OK

Example of Customized Import

Assume that tags must be imported from some file (custom.csv) whose captions do not match the built-in template:

1;2;3;4;5;6;7

MAX;HOLDING_REGISTERS;10;int16;ReadWrite;10325476;set point

Time;SERVER_ONLY;0;int16;ReadOnly;10325476;current time

Assume that comment must be modified as well.

In this case, the following template must be created:

modbus_img87

A comment conversion code example is shown below:

modbus_img88

In the first dialog of the import wizard, select the CSV file and the template:

modbus_img89

Next actions are the same as described in Example of Default Import .