Develop a solution for importing objects

This design-time script creates objects in the project based on the data from a CSV file.

Tip: You can download a sample project from: ObjectsFromCSV.zip

Prerequisites

Create a project.

In the following example, the CSV file contains information about alarms and model variables used by these alarms.
variable,var1,boolean
variable,var2,uint32
alarm,alarm1,digital,var
alarm,alarm2,analog,var2
Table 1. CSV columns description

#1 column

#2 column

#3 column

#4 column

Indicates whether you need to create a project variable (keyword variable) or an alarm (keyword alarm).

Indicates the name of the node to be created.

Indicates the datatype to use to create the variable:
  • Digital (keyword digital)

  • Limit (keyword analog)

Indicates the variable to point the alarm to.

Tip: The CSV file is a part of the sample project. You can also download the CSV file individually from: ../../../common-content/../downloads/alarms.csv
To develop the project
  1. Create the AlarmImporter NetLogic.
  2. Configure the AlarmImporter NetLogic.
  3. Save the project.

Create objects from a CSV file.