CSV File Editing

Do you need to do any editing?

Note the Y or N under the Enable column. If "Y", this object will be included. If "N", this object will be excluded. Certain things found in a LonWorks device are not suitable for mapping to a BACnet object, such as nvoFileDirectory commonly found in most devices (it is a pointer to LonWorks configuration properties, and these are not accessible from BACnet.)

If you do not need the network variable listed, replace Y with N. If you believe you want a variable that defaulted to N, determine whether you can appropriately interpret that value as a BACnet object before changing it to Y. DO NOT change NVindex or Direction. A mismatch here will cause unpredictable results, including failure to communicate.

All scalar network variable types will have their conversion recognized automatically by Babel Buster 485XL. The term "scalar" means it is a single data element, such as integer, floating point, enumeration, etc. Some network variables are structures, meaning a single "network variable" contains several data elements. These structures are mapped to multiple BACnet objects and require explicit interpretation using the fields in the 7 columns following the SNVTindex (which is set to 0 for a structure). More detail about this follows below.

The NV name is taken from the XIF file, and this will be shown as the BACnet object reference string in the Babel Buster 485XL. You may change this to any name that is meaningful to you, and it may be up to 40 characters in length.

The CSV file for a typical device is shown below. In this case, we are using the Control Solutions AddMe II as an example. In this instance, all of the I/O points are mapped and none of the special variables are mapped. It turns out no editing whatsoever is needed to map this device to BACnet. Simply proceed to XML conversion.
Line 1: Program ID for this device. There can be only one SPID in the CSV file and it must be on line 1. If you intend to map multiple devices in a single gateway, create one XML per device. Column 2 determines which position in the LonWorks device table this SPID will be placed. Change the default "1" to 2..20 for additional devices. Once all devices have been converted to XML files, load multiple files by clicking Cancel, when asked whether to clear configuration tables first, while reading the XML file into XLConfig.

Line 2: Comment lines are skipped if they don't start with AI, BI, AV, or BV.

Lines 3-N: One or more lines per network variable mapping the variables to BACnet objects. Each line represents one BACnet object whose type is shown in the first column.

Column 1 (Type): Must be one of AI, AV, BI, BV.

Column 2 (Enable): Will be included in the XML file if Y, excluded if N or other than Y.

Column 3 (Device): Use the Edit->Fill Down feature to change all numbers in this column to 2..20 if this file is not for the first or only device you will load into the gateway. The device number here refers to the LonWorks device. This is where the gateway will look to find the node's network address for this LonWorks network variable.

Column 4 (NV index): This is the network variable index as defined by LonWorks protocol, and will be found in the XIF file or manufacturer's documentation. You will have no need to edit this column unless creating a device manually.

Column 5 (Direction): The direction here refers to direction as defined at the remote LonWorks node. NVO is network variable output, meaning we can read this data. NVI is network variable input, meaning we can write this data. Direction will be found in the XIF file and MUST NOT be changed. Communication failure will result if direction is incorrect.

Column 6 (SNVT index): This is the Standard Network Variable Type as published in LonWorks standards. Manufacturer defined network variables will translate to SNVT index zero and must be interpreted as raw data. If a Manufacturer defined NV type is really a renamed standard type, you can enter the standard type code here. Manufacturer defined types are typically disabled with N in column 2. If you enter valid type or scaling information, you should also change N to Y in column 2. (Note: You can download a pdf file containing a complete definition of all network variable types at www.lonmark.org. You WILL need this document to do anything more than the default mapping created for you by xif2csv.exe. Due to copyright restrictions, we cannot provide it for you.)

Column 7 (Raw type): When parsing a structured variable into multiple BACnet objects, this field specifies the raw data type found in the respective field of the structure. These are the enumerated NVT_CAT types (found in the enumeration section of the pdf document mentioned above).

Column 8 (Offset): Structured variables are multiple bytes in length. This column provides the byte offset from the first byte of the structure where this field or object is found.

Column 9 (Bit offset): Some structured variables treat individual bits as data elements, and often there is a set of multiple bits in such a structure. The Offset column is used to access the correct byte. The Bit offset is used to specify which bit this object refers to. Bit offsets are 0..7 bit positions from the left (MSB of byte). To reiterate, a bit offset of 0 will result in a byte mask of 0x80. Keep in mind that LonWorks SNVT bit structure definitions identify "bit 1" as the left most bit.

Columns 10, 11, 12 (Scale): These are the scale factors A, B, and C whose usage is as defined for standard network variable types (see note about pdf file available above).

Column 13 (Group): This column flags the respective line as being a member of a "group" or structured network variable. When the group flag is set, the gateway sees that it needs to process multiple maps to arrive at a complete network variable for transmission on the LonWorks network. This is especially important when writing a network variable to a LonWorks device - all fields must be transmitted together.

Column 14 (Lock): This flag is only used in conjunction with the Group flag. When multiple BACnet objects are mapped to a single network variable that will be written to the LonWorks device, you have the option of that variable being updated when any member of the structure is written from BACnet (default). You also have the option of causing the entire structure to be updated ONLY when a certain member of the structure is updated. Set the Lock field to 1 to indicate which member of a group is the Lock field. The structure will only be written when this single Lock field is updated. This allows all BACnet objects to be updated before the Lock object to result in a completely synchronous update. Do not set more than one Lock field per group as this will defeat the purpose.

Column 15 (NV name): Originally taken from the XIF file, this can be edited to your liking, and shows up as the BACnet object reference string stored in the gateway. This documentation field may be subsequently read by any BACnet client on the network.