Creating a Custom Object Model

Scenario: You want to create custom object models.

 

Reference: For background information, see the reference section.

 

Workflow diagram:

 

 

Prerequisites:

  • You have the software distribution containing the Modbus TCP extension.
  • You have installed the Modbus TCP and have added it to a management station project using the System Management Console (SMC).
  • System Manager is in Engineering mode.
  • System Browser is in Management View.

 

Steps:

1 – Create a Custom Project Library
  1. Create a custom library by navigating to Project > System Settings > Libraries according to your customization levels.
  1. Navigate to the library that you created and click the Library Configurator tab.
  1. Create an object model folder in it by selecting New Object Model Folder menu option in the list that displays on clicking Add new object . Also, create an import rules folder by selecting the New Modbus Custom Import Rules menu option. For information, see Adding Blocks to a Library.
  • The library folder is created along with the Import Rules and Object Model folders.

 

2 – Import the Object Model
  • You have created a CSV file with the details of the Object Models to be imported.
  1. Select Project > System Settings > Libraries > L4-Project > [Library Folder] > [Library Object] > [Object Model].
  1. Select the Import tab.
  1. Click Browse.
  • The File Open dialog box displays.
  1. Select the CSV file and click OK.
  • The CSV file is pre-processed and validated. If the file is valid and has all the required parameters, the entries in the file are listed in the Source Items list. In case of any discrepancies, an error message displays in the Preimport File Log dialog box. You can access this dialog box by clicking the Analysis Log button This button is only enabled when the pre-processing is complete.
  1. Select the items to import from the list of items displayed in the Source Items list. If the list of items is long, you can filter the items by using the Search field. Once you have your list of filtered items, you can remove the applied filter by deleting the text.
    NOTE: If after selecting a file to import, you decide to change your selection, a message box displays and informs you that selecting another file will clear all items that are displayed in the Source Items list and confirms if you want to proceed. Click Yes if you want to continue. The Source Items list is cleared.
  1. Click No to abort the change of selection. The Source Items list is not cleared.
  1. Click to import.
  • The selected items are transferred to the Items to Import list.
    NOTE: To return the items from the Items to Import list to the Source Items list, click .
  1. (Optional) Select the Delete unselected items from the views option only if, during the import, you want to remove from the views any items that are not present in the file to import. For example, you can use this option when there is some pre-existing data in the system for that view, but you do not want to retain it.
  1. Click Import.
  • A confirmation message displays asking if you want to import the selected items.
  1. Click Yes.
  • The import procedure begins and a progress bar displays.
  • When the import completes successfully, the Import dialog box displays a summary of the import information.
  1. Click OK.
  1. (Optional) Click the Import Log button to view a log of the import process. The details display in the Import File Log dialog box. This button is only enabled when the import is complete.
  • The Modbus devices are integrated with the management platform.

NOTE:
If you change your selection in System Browser while an import is in progress, a message box informs you of the ongoing operation and asks you what to do.
- Click Yes to abort the import.
- Click No to continue with the import.
- Click Cancel to discard the selection change you made in System Browser. This means that the system rejects (does not apply) that selection.

3 – Set the Managed Type
  1. In System Browser, select the imported object model, if not already selected.
  1. Click the Models and Functions tab.
  1. In the Main expander, select the Managed type as ModbusPredefinedDevice.
  1. Click Save .

 

4 – Configure Custom Import Rules
  1. Select Project > System Settings > Libraries > L4-Project > [Library Folder] > [Library Object] > [Import Rules].
  1. Open the Objects and Properties expander.
  1. Select an object model from the Objects section.
  1. (Optional) Configure the short name of existing objects.
  1. In the Address Profiles section, specify the address profile to be associated with the object model. By default, there will only be one profile however, you can create multiple profiles.
  1. Configure the following parameters for each listed property of the selected object model:
    - Direction
    - Function Code
    - Transformation Type
    - Offset
    - Absolute Offset
    - SubIndex
    - Poll Group Name
    - Visibility: Select the Visibility check box if you want the property of the selected object model to be displayed in the Operations and Extended Operations tab. By default, this check box is selected. If you do not want to display this property, you must deselect this box.
    - Low Level Comparison: The Low Level Comparison check box is applicable only to those properties with the Direction field set to Input. By default, this check box is unchecked. If this box is selected, the driver sends the data only in case of changes.
  1. In the Message Conversion section specify the values for Min Raw, Max Raw, Min Eng, and Max Eng values. You can specify these values only to properties of type, PvssInt, PvssUint, PvssFloat, GmsInt, GmsUnit, and GmsReal.
  1. Click Save .
  1. Click OK.
  • The import rules for the selected object model are configured.

 

5 – (Optional) Re-Import the Object Model
  • When the re-import completes, the re-imported object models appear in System Browser.