General Submission : Instance definition. 3.2.4

From the Power Working Group,
Section 3.2.4 - Instance

One of the fundamental issues RV-C had to address is the plethora of devices in an RV that have multiple installations. An RV may have seven or more awnings, four climate control zones, two or more inverters, and dozens of lights, keypads, and the ilk. This factor had to be addressed in a simple, direct manner. The means the committee devised is called "Instancing".

Devices in RV-C are defined as either single-instance or multiple-instance. There are very few of the former items - generator, GPS and chassis being examples. Data packets for these devices have no special provisions for identifying the source or target of the packet. But data packets involving multiple-instance devices always have as the first data byte the "Instance" for the source or target device. The Instance is a tag that identifies which specific physical device of a particular type within the RV is referenced in the DGN. For example, Awning Instance 1 refers to the main patio awning, whereas Awning Instance 2 refers to a different awning on the same RV.

Instances are always in reference to a device type, so instance numbers can be duplicated across devices. There may be an Awning Instance 1, a Thermostat Instance 1, and a DC Load Instance 1, all coexisting on the network. Every instanced DGN is specific to a particular device type, and are organized accordingly in the RV-C protocol document.

The Instance is completely distinct from the Source Address. The Source Address identifies the CAN node - that is, the microprocessor that is sending and receiving data. The Instance identifies the physical device - awning, inverter, tank, etc.. - being described or commanded in the message. The Instance is always a single data byte, usually with a value from 1 to 250. (Some devices have limitations on the range of values, and some devices have more complicated schemes.) In most cases the value is arbitrary, though for some devices RV-C assigns a specific meaning to certain numbers. In almost all cases, zero is not a valid Instance.

For example, for an Awning Instance 1 is defined as the Main Patio Awning. A large RV may have several smaller awnings assigned Instances 2 and higher. Any command to the patio awning would have a first data byte of 1, and any status information about that awning would also have the same first data byte. The same would be true for the other awnings, with the appropriate Instance put in the first data byte.

The Instances always refer to the physical device rather than the microprocessor that is processing the message. A single microprocessor often handles several device Instances. For example, a wall thermostat may handle several climate control zones. The microprocessor in that thermostat would send and parse messages for each climate control zone Instance independently. It is even possible (though rare) for one device Instance to be spread over multiple microprocessors. Each processor would have different Source Address, but use the same Instance.

RV-C does not specify how the Instance is assigned to a device. A general PGN is provided, but manufacturers may also use dip switches, jumpers, or even hard-coding to establish which physical device is assigned each Instance.