Equipment Model Bulk Load Tool - Reference

REFERENCE

Supported Types

Type SupportedExampleDescription
BooleanTrueIs either True or False.
Signed Byte-108 bits integer.
Byte108 bits positive integer.
Short-1016 bits integer
Integer10032 bits integer
Long1234567890123456789064 bits integer
Float3.1432 bits floating point number
Double3.14159265358964 bits floating point number
DateTime00:00:011 second. Follow Standard TimeSpan formatNotice: Make sure cell type is string.
Stringhello
TimeSpan00:00:40

Prefixing "Unsigned " to Short, Integer or Long define type as positive numbers. For array types, just append Array e.g. "Integer Array", then elements are listed in curly bracket e.g. {-2, -1, 0, 1, 2}.

Class Table

Class signature is Class : <class name> : <base class> . This will define a new class table which inherents all properties of <base class>. Inheretant is optional. Instead of Class, user can define AbstractClass, which is a Class with Abstract attribute set to true. AbstractClass can not be instantiated.

After the signature Class-table can virtually have any EquipmentPropertyInfo properties, e.g. ValueMin, ValueMax, DefaultValue, Attributes, TargetHistory, CompressionMethod, etc. Notice these headers are case sensitive.

TODO: Tell which properties will be generated automatically.

Instance Table

Instance table contain a list of instance of a class-table. All instance-table have following columns Parent, Name and class properties. Historized properties have extra columns to define their location over the network, such as Protocol, Server location, and Port. Supported Protocol are opc.tcp , opcda, and modbus. Following table describe which columns each protocol utilizes to define access path:

ProtocolColumnsDescription
opcdaProtocol, Server location, ProgId, ClsId, <historized property>

Access Path:
<Protocol>://<Server location>/<ProgId>/<ClsId>/<historized property>

Some columns can be empty, e.g. Server location, ClsId

opc.tcpProtocol, Server location, Port, <historized property>, UaNamespace, UaIdTypeAccess Path:
<Protocol>://<Server location>:<Port>///<historized property>;UaNamespace=<UaNamespace>;UaIdType=<UaIdType>
modbusProtocol, Server location, Port, <historized property>Access Path:
<Protocol>://<Server location>/<Port>/<historized property>

Parsing tool, ExcelPopulateEquipment.exe

ExcelPopulateEquipment.exe can generate a json file from a supported file, then the json file can be imported to a database.

ExcelPopulateEquipment.exe <supported file>
# supported file    xlsx and xlsm works. CSV might work.

Importing tool, VtrinCmd

VtrinCmd can import json file to database locally and remotely.

The syntax for import is:

VtrinCmd.exe -c <database location> -i <json file> [-u <user name>] [--dryrun] [--confirm] [--verbose] [-h]

#-c,  --connectionstring    Connection string for the driver.
#-u,  --user                User for the connection. (When using vault name prefix with *).
#-i,  --importjson          Import JSON data from a file(s). Multiple files separated with |
#-f,  --force               Forcefully remove conflicting instances
#     --noreplace           Do NOT replace/merge into existing class instances.
#     --continueonerror     Continue operation when an error occurs.
#     --dryrun              Perform a dry run - report changes but do not commit.
#     --report              Experimental (with --importjson option) Display detailed report.
#     --confirm             Same as dryrun + report with  commit confirmed by the user.
#     --verbose             More console outputs.
#-h,  --help                Display help for using this tool.

# Example1: VtrinCmd.exe --confirm -c G:\rtdbdata -i G:\my.output.json
# Example2: VtrinCmd.exe --confirm -c wss://127.0.0.1/history -i G:\my.output.json -u <username>

If report is enabled, user can see changes in the console:
+ means new.
* means modified.
in parantheses mean unmodified

Importing data from 'G:\WaterPumpSystem.xlsx.output.json'
#....
#....
Class: EquipmentPropertyInfo
  (Manufacturer)
  (Voltage)
 + Limit
      Id:          5742d5e2-df28-4181-b07b-c943eb2d04f3
      DisplayName: Limit
      Equipment:   Electrical device
      Description: Voltage Limit
  (Diameter)
 * FlowFOOO
      DisplayName: Flow -> FlowFOOO
  (Level)
 * VolumeFOO
      DisplayName: Volume -> VolumeFOO
  (Current power)
#......
#......
  (Power state)
Class: DataAccessSource
  ({0, 0, /Path[Level]/ec36a8cf-d182-4301-bb09-2619813ee8ca|Example site.Water transfer system.Tank area.Source tank})
  ({0, 0, /Path[Level]/6d3c8426-85fa-4494-a96e-234bbbaf7275|Example site.Water transfer system.Tank area.Target tank})
Class: Path_Pipe
  (Example site.Water transfer system.Flowback pipe)
  (Example site.Water transfer system.Pipe)
#.......
#.......
Equipment               2 modified
EquipmentPropertyInfo   1 new   2 modified
--------------------------------------------------------------------------------
Total                   1 new   4 modified (21 unchanged)
2020-06-17 23:19:56.1616402+03:00 (1) ABB.Vtrin.Util.JSON.Import: Total 0 instances imported
Commit changes (y/n)?

Notice: It is possible to define access path under historized property by writing access path directly. E.g. under Level, a historized property of Tank has "opcda://custom_specs", then this value will be copied to access path.

Hints

Performance

Removing hyperlinks (as format) from cells improve processing time.