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
- Create a custom library by navigating to Project > System Settings > Libraries according to your customization levels.
- Navigate to the library that you created and click the Library Configurator tab.
- 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.
- Select Project > System Settings > Libraries > L4-Project > [Library Folder] > [Library Object] > [Object Model].
- Select the Import tab.
- Click Browse.
- The File Open dialog box displays.
- 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.
- 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.
- Click No to abort the change of selection. The Source Items list is not cleared.
- 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 .
- (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.
- Click Import.
- A confirmation message displays asking if you want to import the selected items.
- 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.
- Click OK.
- (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.
Information
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
- In System Browser, select the imported object model, if not already selected.
- Click the Models and Functions tab.
- In the Main expander, select the Managed type as ModbusPredefinedDevice.
- Click Save .
4 – Configure Custom Import Rules
- Select Project > System Settings > Libraries > L4-Project > [Library Folder] > [Library Object] > [Import Rules].
- Open the Objects and Properties expander.
- Select an object model from the Objects section.
- (Optional) Configure the short name of existing objects.
- 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.
- 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.
- 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.
- Click Save .
- Click OK.
- The import rules for the selected object model are configured.
5 – (Optional) Re-Import the Object Model
- Repeat the steps in Import the Object Model to re-import an object model.
- When the re-import completes, the re-imported object models appear in System Browser.