Configuration Variable/Indexed Configuration Variables

The NMRA DCC Standard S-9.2.2 allows for more CVs than the 1-1024 limit specified. While many of those CVs are reserved, the NMRA anticipated the need for additional CVs in the future. 
NMRA Standard S9.2.2 defined the ranges 1-256 and 512-1024 as normal CVs. CVs between 257 to 511 are treated as Paged Index CVs, with the page numbers being stored in CVs 31 and 32, the index registers, or Master CV. This allows up to 65,536 additional pages in that range. The result is a memory space which can accommodate more than a million additional configuration variables. 
Indexed CVs are used for both Multifunction and Accessory Decoders.
The NMRA Standard regarding Configuration Variables:
*Configuration Variable 31 Index High Byte 
** This is the page address
*Configuration Variable 32 Index Low Byte
** This is the secondary page address
The Indexed Address is the address of the Indexed CV page when the decoder is set up for indexed CV operation. CV#31 contains the most significant bits of the two-byte address and may have any value between 00010000 ($10) and 11111111 ($FF) inclusive. Values of 00000000 thru 00001111 ($0 to $F) are reserved by the NMRA for future use (4096 indexed pages).
When writing Indexed CVs, CV31 only needs to be changed when the high byte changes. CV32 can changed as needed to write CVs to their appropriate page location. Think of it like a book where pages are numbered in the form of Chapter – Page, i.e.: Page 6 – 4.
CV#32 contains the least significant bits of the index address and may contain any value. This gives a total of 61,440 indexed pages, each with 256 bytes of CV data available to manufacturers.
The typical format for an indexed CV is A.B.C, where:
# A is the Index High Byte, entered into CV31,
# B is the Index Low Byte, CV32, and
# C is the individual CV (257 to 512) to be altered. Sometimes referred to as the Master CV.
==Indexed Configuration Variables==
An Indexed Configuration Variable is a special version of the CV. They are used to group functions together, simplifying access when related functions have been added over time to the decoder software. Often, they are employed to configure sound effects, lighting or motor operation variables. 
Indexed CVs allow the decoder's software to organize related programming functions under a Master CV. Access to the Master CV is only available through its Indexes. A Master CV can have two Indexes.
Identified as Primary and Secondary indexes, they are expressed as decimal places in the formula used to set them. They will appear as CV100.150.140, which means the Master CV is 100, the Primary Index is value is 150, and the Secondary Index is set to 140.
The rules are confusing. They are as follows:
# The Master CV holds related functions, such as lighting effects or horn/whistle parameters.
# Only the Master CV is programmed to control a given function when using indexed CVs.
# The Primary and Secondary indexes control access to the Master CV, regardless of which Master CV is being accessed.
# Values entered into the Primary and Secondary Indexes determine the function to be set in the Master CV.
In many cases, you don't need to re-enter the Primary Index values if you want to alter a Master CV. Usually only the Secondary Index will require changes,
ESU uses a similar technique within their decoder software to permit systems which are unable to access CVs greater than 255 to set CVs above that limit. See Programming_ESU_Decoders for more. 
Soundtraxx multifunction decoders do not offer a similar workaround for this programming issue.
=== Programming an Indexed CV ===
Programming an Indexed CV takes a little more time. Software such as JMRI, or ESU's LokProgrammer can also be used.
To set an Index CV:
# Write the required value into the Primary Index (CV31)
# Write the required value into the Secondary Index (CV32)
# Enter the Master CV using your throttle
# Enter the value to be written to the Master CV.
# Make any necessary changes to the Secondary Index or Master CV as needed to write additional indexed CVs.
===Manufacturer Notes===
* QSI offered their own version of indexed CVs prior to their standardisation by the NMRA.
** QSI created a non-standard indexing system with CV49 only, or CV49 and 50 as subindexes to CVs less than 257. 
* ESU's implementation followed the NMRA's S–9.2.2 specifications;
** Zimo also followed the NMRA specification.
** ESU was the first to correctly implement the Indexed CV in their decoders. Zimo soon followed. ESU uses a value of 16 in CV31, and CV32 can have a number of possible values, depending on the decoder.
* Soundtraxx has implemented NMRA S–9.2.2 for their Econami and Tsunami2 multifunction decoders, with a slight variation. They only publish the value for CV32, with CV31 having a fixed value of 16. In their manuals they denote an indexed CV in the form of 1.155, for example. 
* Multifunction decoders by Train Control Systems (TCS) implemented indexed CVs in a more complex way, using CVs 201 – 204.
==Programming Issues==
 Some multifunction decoders may exceed specified time allotments when processing indexed CV calculations. This could result in complications in the course of decoder programming with specific brands or models of DCC systems. 
=== Digitrax ===
=== Indexed CVs and NCE ===
 
== Further Reading ==
* Programming
* Programming ESU Decoders
* NCE FAQ: Indexed CV Programming
* NCE PowerPro: Indexed Configuration Variables
== Video about Indexed CVs ==