14. CSV File Import/Export

14.1 Using CSV Files to Speed Configuration

The CSV import capability simplifies the process of creating or changing a large number of entries because you can use any standard spread sheet program to manipulate the content of the CSV file, and then import that into the VP3-TM via the configuration tool. If the VP3-TM will be reading a long list of Modbus registers, for example, you can sometimes just copy a list of registers from another source, paste into a simple text file, and import that into the spread sheet program. Then add a header line to label the content, add a handful of additional columns, and you quickly have most of a complete configuration. Very often, the only thing that changes from one line to the next is the register number. The other entries can be quickly made by entering once and using the spread sheet program's "fill down".

You can quickly create a configuration for a Modbus master that will poll a list of registers by simply providing the list of registers. Everything else will default to the most commonly used parameters. If you are using Modicon notation for the import, the minimum requirement is just a list of registers with a header label MODICON.

The alternative to Modicon notation is just a list of register numbers labeled MODREG that will default to holding registers (4X). You can also add the MODTYPE column to specify register type.

Both of the CSV files illustrated above import to the same configuration illustrated by the Object List above. Picking just one for editing, illustrated below, shows the various default settings that were made.

The minimum requirement for importing a list of Modbus registers is just one of MODREG or MODADDR or MODICON. If MODICON used, then MODTYPE cannot be used because type is implied by the Modicon number. If MODICON is not used, then MODTYPE can be used, but registers will default to holding registers if MODTYPE is not included.

The minimum requirement for importing a list of BACnet objects is BACDEV and BACOBJTYPE and BACOBJINST - all 3 required. Everything else will default.

The NUMBER, NAME, and DATATYPE columns seem like obvious requirements but are actually not included in minimum requirements for an import. Object number will be auto-assigned simply in the order found in the CSV file. Name will default to a generic "Object n" name, and data type will default to floating point.

14.2. Data Object CSV File Format

The following columns are generated by the CSV export of data objects from the Object List page in the VP3-TM configuration tool. This table references the object configuration command that would be used. Refer to the respective commands in Section 7 of this user guide for additional details about certain parameters.

When creating a CSV file for importing, it is not necessary to include all columns, and order is generally not critical. The minimum required columns would be those noted above. In addition, if creating a CSV file for a Modbus model (VP3-TM10, VP3-TM60), do not include columns pertaining to BACnet. Likewise, if creating a CSV file for a BACnet model (VP3-TM30, VP3-TM70), do not include columns pertaining to Modbus.

A simple way of starting a new CSV file is to enter a very minimal 1-object configuration in the configuration tool, and then export a CSV file from the Object List page. The entire header will be created for you. Now simply proceed to fill in additional rows. Feel free to delete unused columns.

NUMBER obj 1,xxx
Sets object number for the parameters in this line of the CSV file.
NAME obj 1,name=”Engine Temp”
Sets object name (ASCII string up to 39 characters). The name must be a quoted string.
DATATYPE obj 1,datatype=FLOAT
Sets data type for object’s data. Types are as follows:
                FLOAT=floating point
                UINT32=unsigned 32-bit integer
                INT32=signed 32-bit integer
                UINT16=unsigned 16-bit integer
                INT16=signed 16-bit integer
                BIT=Boolean on/off, 1-bit value
LINK obj 1,link=40
Sets link object (virtual link) for causing the source of data for this object to be some other object, or a virtual object in the system.
MASK obj 1,mask=0080
Sets data mask for use with virtual link. Value is expressed in hexadecimal. Applies to VP3-TM10 and VP3-TM60 only.
SCALE obj 1,scale=1.0000
Sets scale factor, this is multiplied by data value before being stored in object.
OFFSET obj 1,offset=0.0000
Offset added to data value before being stored in object.
ALARMTYPE obj 1,alarm=GT/100.0
Sets alarm type. Alarm type codes are as follows:
                GT= greater than
                GE=greater than or equal
                LT=less than
                LE=less than or equal
                *EQ=equal
                *NE=not equal.
                DV=deviates from threshold by hysteresis amount
                CB=changes by
                NO=none (used in CSV files)
ALARMLEVEL obj 1,alarm=GT/100.0
Sets alarm threshold, second half of alarm command from console.
SENDTO sendto=1+2+4
Indicates one or more notification group numbers 1 through 8 to send the alarm message to. Note that for groups, 1+2 means literally the string "1+2", not 3. Sendto=1+2 will give you groups 1 and 2, while 3 will give you group 3.
MINON obj 1,minon=10
Sets minimum on time for alarm in seconds.
MINOFF obj 1,minoff=0
Sets minimum off time for alarm in seconds.
HYST obj 1,hyst=5.0
Sets hysteresis value applied to alarm thresholds.
MESSAGE obj 1,message=”Send this message when alarm makes transition”
Sets the message that will be sent upon alarm transition.
ENABLEOBJ obj 1,enableby=2/30
Selects another object that will enable this alarm.
ENABLEDELAY obj 1,enableby=2/30
The second value is a delay time in seconds. If non-zero, the enable will take effect this amount of time after the given object becomes non-zero.
REQUIREACK obj 1,requireack=yes
Selects whether the alarm must be acknowledged by an SMS reply.

The yes/no selection is Y or N in the CSV file.
ACTIVEONLY obj 1,activeonly=yes
Eliminates the alarm inactive notification when “yes”.
The yes/no selection is Y or N in the CSV file.
POLL obj 1,poll=5
Sets poll timer for reading. Setting is in seconds.
WRITECOMMAND obj 1,writecommand=yes
Selects whether write on command is enabled for this object.
The yes/no selection is Y or N in the CSV file.
FAILCOUNT obj 1,defaultonfail=99.99/3
Tells the communication engine to set the object to a default value upon some number of communication failures. Syntax is defaultonfail=<value>/<count> where <value> is the default value to be set upon <count> failures. In the CSV file, this column is the <count> part.
DEFAULTVALUE obj 1,defaultonfail=99.99/3
Tells the communication engine to set the object to a default value upon some number of communication failures. Syntax is defaultonfail=<value>/<count> where <value> is the default value to be set upon <count> failures. In the CSV file, this column is the <value> part.
TIMEOUT obj 1,timeout=0.5
Sets timeout, in seconds with resolution to tenths.
REPORTDAILY obj 1,reportdaily=1+2+4
Sets the object for daily reporting to the notification groups given.
MODREG obj 1,modreg=201
Sets remote Modbus register number, indexed from 1, not Modicon.
MODTYPE obj 1,modtype=4X
Set Modbus register type – determines Modbus function code. Types are: 
                NO=none
                0X=coil (read/write)
                1X=discrete input (read only)
                3X=input register, 16-bit (read only)
                4X=holding register, 16-bit (read/write)
                0XS=single coil
                4XS=single holding register
MODDATA obj 1,moddata=UINT16
Sets Modbus remote register data format.
                NONE=undefined
                INT16=signed integer, 16-bit
                UINT16=unsigned integer, 16-bit
                INT32=signed integer, 32-bit
                UINT32=unsigned integer, 32-bit
                INT64=signed integer, 64-bit
                FLOAT=floating point, IEEE 754, 32-bit
                BIT=Boolean, single bit, applies to coil or discrete input ONLY
                MOD10-2=Schneider Electric Mod10 format, 2-register
                MOD10-3=Schneider Electric Mod10 format, 3-register
                MOD10-4=Schneider Electric Mod10 format, 4-register
MODMASK obj 1,modmask=0080
Sets data mask in Modbus map for Modbus bit masking.
MODFILL obj 1,modfill=0080
Sets data fill for use in writing packed registers, has no effect on reading.
MODSLAVE obj 1,modslave=5
Sets Modbus RTU slave address to be read/written for this map.
MODTCPDEV obj 1,modtcp=1/5
Selects the TCP device from device table, and provides TCP unit number instead of RTU slave. Syntax is tcp=<device>/<unit>. Used only in TCP version of device. Both RTU and TCP are simultaneously active in the TCP device.
MODTCPUNIT obj 1,modtcp=1/5
Selects the TCP device from device table, and provides TCP unit number instead of RTU slave. Syntax is tcp=<device>/<unit>. Used only in TCP version of device. Both RTU and TCP are simultaneously active in the TCP device.
MODBIGEND obj 1,modbigend=yes  (or no, default=no)
Sets Modbus register swap flag for this object map.
The yes/no selection is Y or N in the CSV file.
MODPACK obj 1,modpack=yes  (or no, default=no)
Set this option flag if the same register will be shared among multiple objects using bit masking. Even if a single register is to use a bit mask, this flag must still be set to cause the mask to be recognized.

The yes/no selection is Y or N in the CSV file.
BACUNITS obj 1,bacunits=95
Specifies BACnet Units property for this object.
BACDEV obj 1,bacdev=10
Sets remote device instance for BACnet client mapping.
BACOBJTYPE obj 1,bacobj=AI/1
Selects object type which the BACnet client is to read/write at remote device instance. The following object types are supported by the client:
                AI=Analog Input
                AO=Analog Output
                AV=Analog Value
                BI=Binary Input
                BO=Binary Output
                BV=Binary Value
                MI=Multi-state Input
                MO=Multi-state Output
                MV=Multi-state Value
                DEV=Device
BACOBJINST obj 1,bacobj=AI/1
Selects object instance which the BACnet client is to read/write at remote device instance.
BACMAC obj 1,bacmac=3    (hexadecimal)
obj 1,bacmac=c0:a8:0:2:0b:ac    (indicates IP address 192.168.0.2 port 47808)
If specified, this MAC address will be used by the BACnet client to attempt to reach the remote BACnet device when Who-Is fails.
BACPROP obj 1,bacprop=85
Selects object property to be read/written at remote device.
BACDATA obj 1,bacdata=BIT
Specifies data encoding to be used when writing remote device. Supported data encoding types are:
                NULL=BACnet Application Tag Null (0)
                BOOL=BACnet Application Tag Boolean (1)
                UINT=BACnet Application Tag Unsigned Int (2)
                SINT=BACnet Application Tag Signed Int (3)
                REAL=BACnet Application Tag Real (4)
                BIT=BACnet Application Tag BitString (8)
                ENUM=BACnet Application Tag Enumerated (9)
BACPRIORITY obj 1,bacpriority=10
Specifies the command priority that should be used when writing a commandable object in the remote device.Commandable objects are any Output object. Commandable Value objects are not supported.
BACINDEX obj 1,bacindex=2
Specifies an index value if reading/writing an array, or “no index” if -1. Defaults to “no index”.
BACBITNUM obj 1,bacbitnum=1
Specifies a bit number to read a single bit from a bit string.

14.3. User (Phonebook) CSV File Format

The columns in the User CSV file are as noted in the following table. Import and export of User CSV files is done from the Users page in the configuration tool.

The minimum required columns for a User CSV import are USERSMS and GROUPS. Number will be automatically assigned in the order users are found in the CSV file. Name is not used for sending messages, and therefore is not needed for anything other than reference on the screen of the configuration tool - or in other words, just not really needed.

NUMBER user 1,xxx
Sets user number for the parameters in this line of the CSV file.
USERSMS user  1,sms=17634155950
Sets phone book entry 1 to the given SMS/phone number. IMPORTANT: The country code, e.g. 1, must be included in the phone number.
USERNAME user  1,name=”John Smith”
The name is for reference only (30 char max), displayed for reference on the console.
GROUPS user  1,groups=1+2+7
Selects which groups (1..8) which this user is a member of. A user may be a member of 1 to 8 groups.
COMMAND user  1,command=yes
If this user is authorized to send commands via SMS, indicate “yes”, defaults to “no” if omitted.
The yes/no selection is Y or N in the CSV file.

Copyright © 2019 Control Solutions Minnesota, Inc.