Indexed CVs are a way to have more CVs than just those available in the range 1-1024 inclusive (a limit set by the DCC packet standards in S9.2.1). Many of these are already reserved for particular purposes.
However, the NMRA standards covered that need and provided for a way to allow for many more CVs. This is intended to be done by a page indexing system for CVs in the range 257-512 inclusive, allowing for in excess of 16 million CVs.
The NMRA standard S9.2.2 covering Configuration Variables
defines the following:
- CVs 1-256 (inclusive) and 513-1024 (inclusive) are to be
treated as normal CVs.
- CVs 257-512 (inclusive) are to be treated as paged index
CVs, with the page number being stored in CVs 31 and 32 (the index registers).
What this means is that there is a total of 65,536 possible
pages of CVs 257-512, so you need to set the correct values in the index
registers before accessing any CV in this range.
In JMRI the convention is "CV a.b.ccc" for these NMRA-compliant indexed CVs, where "a" is the value to load in CV31, "b" is the value to load in CV32 and "ccc" is the desired CV number (in the range 257-512) on the page specified by "a" and "b" combined.
Question: when JMRI sends a command
targeting CV2.257, does the packet structure sent reference a CV address of
257? or does it reference a CV address of 513? (ie 257+256)
In the case of SoundTraxx decoders, it sends a "write
value of 2 to CV32", followed by the "read/write value of
CV257".
CV32 is a special "secondary index CV" in the
decoder.
Question: When JMRI sends a command targeting
CV3.257, does the packet structure sent reference a CV address of 257? or does
it reference a CV address of 769? (ie 257+512)
In the case of SoundTraxx decoders, it sends a "write
value of 3 to CV32", followed by the "read/write value of
CV257".
QSI
QSI indexed CVs predate the S9.2.2 indexing specification and use CV49 alone or (CV49 & CV50) as subindexes to several other < 257 CVs.ESU
ESU implemented indexed CVs as per NMRA S9.2.2, so you will see CVs like 16.2.384 in these decoder definitions.ZIMO
ZIMO also followed the NMRA speciation.SoundTraxx
SoundTraxx has now implemented S9.2.2 style indexed CVs in its Econami and Tsunami 2 ranges. But they use a fixed value of 16 in CV31 so only quote the value in CV32. So, you will see CVs like 1.257 in these decoder definitions.TCS
TCS adopted an even more complex system using CVs 201, 202, 203 & 204.It is important to realize that indexed CVs are still just
CVs as far as your DCC system is concerned. It knows nothing about indexed CVs.
ISSUES
Several issues have arisen:
- Some DCC systems have problems with CVs > 256. For example, an issue has been discovered in the NCE Power Pro firmware that causes the wrong CV to be written in Program Track mode for any CV > 256.
- It appears that some decoder brands may have problems processing indexed CV calculations inside the decoder within the timing specifications of the NMRA standards. This can potentially cause issues with some brands/models of DCC system.
- ESU and ZIMO both provide in-decoder workaround solutions for problem (1) and JMRI has been able to use the ESU algorithm successfully in DecoderPro. (But ZIMO provided different solutions with different firmware and as yet no JMRI volunteer has found time to resolve this). Unfortunately, SoundTraxx has not provided a similar workaround for its decoders.
Thanks to Dave Heap of Australia for a lot of this information.
If you have an idea for a blog post here, let me know. If I can comment on it, I will or I'll see if someone else can and post it.