Skip to main content

OpCode

Enum OpCode 

Source
#[repr(u8)]
pub enum OpCode {
Show 142 variants GeneralAck = 0, GeneralNack = 1, BusHalt = 2, BusResume = 3, DccTrackPoweredOff = 4, DccTrackPoweredOn = 5, DccEmergencyStopEngaged = 6, RestartAllNodes = 7, DccTrackPowerOff = 8, DccTrackPowerOn = 9, DccEmergencyStop = 10, DccQueryCommandStationStatus = 12, QueryNodeInfo = 13, QueryNodeParameters = 16, QueryModuleName = 17, DccReleaseSession = 33, DccQueryLocoStatus = 34, DccSessionKeepAlive = 35, DebugMsg1 = 48, ExtOpCode = 63, DccRequestNewSession = 64, DccQueryConsist = 65, SetNodeNumber = 66, DccAllocateLocoToActivity = 67, DccSetThrottleMode = 68, DccConsistAddLoco = 69, DccConsistRemoveLoco = 70, DccSetLocoThrottle = 71, DccSetLocoFlags = 72, DccLocoFunctionOn = 73, DccLocoFunctionOff = 74, DccServiceModeStatus = 76, ResetModuleToFactory = 79, RequestNewNodeNumber = 80, NodeNumberReleased = 81, NodeNumberAck = 82, PutNodeIntoLearnMode = 83, ReleaseNodeFromLearnMode = 84, ForgetAllLearnedEvents = 85, QueryAvailableEventSlots = 86, QueryAllLearnedEvents = 87, QueryLearnedEventCount = 88, WriteAck = 89, QueryNodeData = 90, RequestDeviceDataShortMode = 91, RebootIntoBootloader = 92, ForceCanEnumeration = 93, RestartNode = 94, ExtOpCode1 = 95, DccSetLocoFunctions = 96, DccQueryLocoSession = 97, DccCommandStationError = 99, NodeConfigurationError = 111, AvailableEventSlots = 112, QueryNodeVariable = 113, QueryLearnedEventByIndex = 114, QueryNodeParameterByIndex = 115, LearnedEventCount = 116, SetNodeCanId = 117, PutNodeIntoMode = 118, ServiceDiscoveryQuery = 120, ExtOpCode2 = 127, DccSendRawPacket3 = 128, DccWriteCvByteInOpsMode = 130, DcWriteCvBitInOpsMode = 131, DccReadCv = 132, DccCvValue = 133, QueryDiagnosticData = 135, SetNodeVariable = 142, LongEventAccessoryOn = 144, LongEventAccessoryOff = 145, QueryLongEventAccessoryState = 146, LongEventAccessoryStateOn = 147, LongEventAccessoryStateOff = 148, ForgetLearnedEvent = 149, LegacySetNodeVariable = 150, NodeVariableValue = 151, ShortEventAccessoryOn = 152, ShortEventAccessoryOff = 153, QueryShortEventAccessoryState = 154, NodeParameterValue = 155, QueryEventVariable = 156, ShortEventAccessoryStateOn = 157, ShortEventAccessoryStateOff = 158, ExtOpCode3 = 159, DccSendRawPacket4 = 160, DccWriteCvInServiceMode = 162, Heartbeat = 171, ServiceDiscoveryResponse = 172, GenericResponse = 175, LongEventAccessoryOn1 = 176, LongEventAccessoryOff1 = 177, QueryEventVariableInLearnMode = 178, LongEventAccessoryStateOn1 = 179, LongEventAccessoryStateOff1 = 180, EventVariableValue = 181, NodeInfo = 182, ShortEventAccessoryOn1 = 184, ShortEventAccessoryOff1 = 185, ShortEventAccessoryStateOn1 = 189, ShortEventAccessoryStateOff1 = 190, ExtOpCode4 = 191, DccSendRawPacket5 = 192, DccWriteCvByteInOpsModeByAddress = 193, DccSendDataToCab = 194, DiagnosticData = 199, FastClock = 207, LongEventAccessoryOn2 = 208, LongEventAccessoryOff2 = 209, TeachEvent = 210, EventVariableValueInLearnMode = 211, LongEventAccessoryStateOn2 = 212, LongEventAccessoryStateOff2 = 213, ShortEventAccessoryOn2 = 216, ShortEventAccessoryOff2 = 217, ShortEventAccessoryStateOn2 = 221, ShortEventAccessoryStateOff2 = 222, ExtOpCode5 = 223, DccSendRawPacket6 = 224, DccLocoReport = 225, ModuleName = 226, DccCommandStationStatus = 227, EventAck = 230, ExtendedServiceDiscoveryResponse = 231, StreamPacket = 233, NodeParametersReport = 239, LongEventAccessoryOn3 = 240, LongEventAccessoryOff3 = 241, LearnedEventResponse = 242, LongEventAccessoryStateOn3 = 243, LongEventAccessoryStateOff3 = 244, TeachEventByIndex = 245, DataEventAccessory = 246, NodeDataEventResponse = 247, ShortEventAccessoryOn3 = 248, ShortEventAccessoryOff3 = 249, DeviceDataEventShortMode = 250, DeviceDataResponseShortMode = 251, WriteData = 252, ShortEventAccessoryStateOn3 = 253, ShortEventAccessoryStateOff3 = 254, ExtOpCode6 = 255,
}
Expand description

VLCB opcodes

Variants§

§

GeneralAck = 0

General Acknowledgement.

Positive response to query/ request performed or report of availability on-line.

§Opcode: ACK

§Priority: Normal

§Services:

§Parameters:

§Conditions:

§Direction:

§States / Modes: Normal, Learn, NOHEARTB

§Result:

§

GeneralNack = 1

General No Ack.

Negative response to query/ request denied.

§Opcode: NAK

§Priority: Normal

§Services:

§Parameters:

§Conditions:

§Direction:

§States / Modes:

§Result:

§

BusHalt = 2

Bus Halt.

Commonly broadcasted to all nodes to indicate CBUS is not available and no further packets should be sent until a BON or ARST is received.

§Opcode: HLT

§Priority: High

§Services:

§Parameters:

§Conditions: Opcode is supported

§Direction: Both

§States / Modes:

§Result: If conditions are met then disable transmission of all messages on all interfaces otherwise ignore the request.

§

BusResume = 3

Bus ON

Commonly broadcasted to all nodes to indicate CBUS is available after a HLT message was transmitted.

§Opcode: BON

§Priority: Above Normal.

§Services:

§Parameters:

§Conditions: Opcode is supported

§Direction: Both

§States / Modes:

§Result: If conditions are met then enable transmission of all messages on all interfaces otherwise ignore the request.

§

DccTrackPoweredOff = 4

DCC track off.

Commonly broadcasted to all nodes by a command station to indicate track power is off and no further command packets should be sent, except inquiries.

§Opcode: TOF

§Priority: Above Normal

§Services: DCC_CAB or DCC_CMD

§Parameters:

§Conditions:

§Direction: From command station

§States / Modes:

§Result:

§

DccTrackPoweredOn = 5

DCC track on.

Commonly broadcasted to all nodes by a command station to indicate track power is on.

§Opcode: TON

§Priority: Above Normal

§Services: DCC_CAB or DCC_CMD

§Parameters:

§Conditions:

§Direction: From command station

§States / Modes:

§Result:

§

DccEmergencyStopEngaged = 6

DCC emergency stop.

Commonly broadcast to all nodes by a command station to indicate all engines have been emergency stopped.

§Opcode: ESTOP

§Priority: Above Normal

§Services: DCC_CAB or DCC_CMD

§Parameters:

§Conditions:

§Direction: From command station

§States / Modes:

§Result:

§

RestartAllNodes = 7

Perform reboot on all nodes.

Commonly broadcasted to all nodes to indicate a full system restart. Similar to NNRST which directs a single node to be restarted.

§Opcode: ARST

§Priority: High

§Services:

§Parameters:

§Conditions: Opcode is supported

§Direction:

§States / Modes:

§Result: If conditions are met then perform a module reset as if power on has just been performed otherwise ignore request.

§

DccTrackPowerOff = 8

DCC request track off.

Sent to request change of track power state to “off”.

§Opcode: RTOF

§Priority: Above Normal

§Services: DCC_CAB or DCC_CMD

§Parameters:

§Conditions:

§Direction: Cab to command station

§States / Modes:

§Result:

§

DccTrackPowerOn = 9

DCC request track on.

Sent to request change of track power state to “on”.

§Opcode: RTON

§Priority: Above Normal

§Services: DCC_CAB or DCC_CMD

§Parameters:

§Conditions:

§Direction: Cab to command station

§States / Modes:

§Result:

§

DccEmergencyStop = 10

DCC request emergency stop.

Sent to request an emergency stop to all trains. Does not affect accessory control.

§Opcode: RESTP

§Priority: High

§Services: DCC_CAB or DCC_CMD

§Parameters:

§Conditions:

§Direction: Cab to command station

§States / Modes:

§Result:

§

DccQueryCommandStationStatus = 12

Request Command Station Status.

Sent to query the status of the command station. See description of (STAT) for the response from the command station.

§Opcode: RSTAT

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters:

§Conditions:

§Direction: Cab to command station

§States / Modes:

§Result:

§

QueryNodeInfo = 13

Query node number.

Requests a PNN reply from each node on the bus.

§Opcode: QNN

§Priority: Low

§Services: MNS

§Parameters:

§Conditions:

§Direction: To module

§States / Modes:

§Result:

§

QueryNodeParameters = 16

Request node parameters.

Sent to a node while in Setup mode to read its parameter set. Used when initially configuring a node.

§Opcode: RQNP

§Priority: Low

§Services: MNS

§Parameters:

§Conditions: If the module is not in setup mode then ignore the message.

§Direction: To module

§States / Modes:

§Result:

§

QueryModuleName = 17

Request module name.

Sent by a node to request the name of the type of module that is in setup mode or Learn mode. The module in setup mode or learn mode will reply with opcode NAME.

§Opcode: RQMN

§Priority: Normal

§Services: MNS

§Parameters:

§Conditions: If the module is not in Setup mode or Learn mode then the message is ignored.

§Direction: To module

§States / Modes:

§Result:

§

DccReleaseSession = 33

Release Engine.

Sent by a CAB to the Command Station. The engine with that Session number is removed from the active engine list.

§Opcode: KLOC

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes)

§Conditions: If the module is not a DCC command station then the message is ignored. If the module does not have an active session with the specified session identifier then an ERR message is sent.

§Direction: Cab to command station

§States / Modes:

§Result: If conditions are met then the loco for that session is removed from the active engine list.

§

DccQueryLocoStatus = 34

Query engine.

Used to determine if the command station session is valid and to obtain information about the status of the locomotive.

§Opcode: QLOC

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes)

§Conditions: If the module is not a DCC command station then the message is ignored. If the module does not have an active session with the specified session identifier then an ERR message is sent.

§Direction: Cab to command station

§States / Modes:

§Result:

§

DccSessionKeepAlive = 35

Session keep alive.

The cab sends a keep alive at regular intervals for the active session. The interval between keep alive messages must be less than the session timeout implemented by the command station.

§Opcode: DKEEP

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes)

§Conditions: If the module is not a DCC command station then the message is ignored.

§Direction: Cab to command station

§States / Modes:

§Result: If conditions are met then Reset the session’s keep alive timer.

§

DebugMsg1 = 48

Debug message with one data byte.

Freeform status byte for debugging during CBUS module development. Not used during normal operation.

§Opcode: DBG1

§Priority: Normal

§Services:

§Parameters: Status (1 bytes)

§Conditions:

§Direction:

§States / Modes:

§Result:

§

ExtOpCode = 63

Extended opcode with zero additional bytes. Reserved to allow the 0 additional bytes range to be extended by a further 256 opcodes.

§Opcode: EXTC

§Priority: Low

§Services:

§Parameters: Ext_OPC (1 bytes) Extended opcode,

§Conditions:

§Direction:

§States / Modes:

§Result:

§

DccRequestNewSession = 64

Request engine session.

This command is typically sent by a cab to the command station following a change of the controlled decoder address. RLOC is exactly equivalent to GLOC with all flag bits set to zero, but command stations

§Opcode: RLOC

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Dat1 (1 bytes) AddrH of the decoder, Dat2 (1 bytes) AddrL of the decoder

§Conditions: (Loco stack full) message is sent. If the loco is currently assigned to another session then an ERR (Loco

§Direction: Cab to command station

§States / Modes:

§Result: If conditions are met then associate loco address to the specified session and send a PLOC message.

§

DccQueryConsist = 65

Query Consist.

Allows enumeration of a consist. Command station responds with PLOC if an engine exists at the specified index, otherwise responds

§Opcode: QCON

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: ConID (1 byte) Consist ID Index (1 byte)

§Conditions: session) message.

§Direction: To command station

§States / Modes:

§Result:

§

SetNodeNumber = 66

Set Node Number.

Sent by a configuration tool to assign a node number to a requesting node in response to a RQNN message. The target node must be in

§Opcode: SNN

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) the new node number

§Conditions: Module must be in setup mode otherwise the SNN message is ignored.

§Direction: To module

§States / Modes:

§Result: If conditions are met then the specified node number is saved in persistent storage for use in future communications. The module shall send a NNACK message in response.

§

DccAllocateLocoToActivity = 67

Allocate loco to activity.

§Opcode: ALOC

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session ID (1 byte) the Session ID. Allocation code (1 byte) application specific allocation code.

§Conditions: If the module is not a DCC command station then ignore the request. If the module does not have an active session with the specified session identifier then send an ERR (No session) message.

§Direction: To command station

§States / Modes:

§Result: If conditions are met then assign the activity code to the session otherwise.

§

DccSetThrottleMode = 68

Set CAB session mode.

Bits 0–1: speed mode

  • 00 =128 speed steps
  • 01 =14 speed steps
  • 10 =28 speed steps with interleave steps
  • 11 =28 speed steps

Bit 2: service mode Bit 3:sound control mode

§Opcode: STMOD

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), mode (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the request. If the module does not have an active session with the specified session identifier then send an ERR (No session) message.

§Direction: Cab to command station

§States / Modes:

§Result: If conditions are met then update the session information for number of speed steps, service mode and sound control mode.

§

DccConsistAddLoco = 69

Consist Engine.

Adds a decoder specified by Session to a consist. Consist# has bit 7 set if consist direction is reversed.

§Opcode: PCON

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), Consist# (1 bytes)

§Conditions:

§Direction: Cab to command station

§States / Modes:

§Result: If the module does not already have a consist with the specified id then the consist is created. The session is added to the specified consist.

§

DccConsistRemoveLoco = 70

Removes a loco from a consist.

§Opcode: KCON

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), Consist# (1 bytes)

§Conditions: If the module does not have a consist with the specified Consist# id then ignore the message.

§Direction: To module

§States / Modes:

§Result: If conditions are met then remove the specified session from the specified consist.

§

DccSetLocoThrottle = 71

Set Engine Speed/Dir.

Speed/dir value, where the most significant bit is direction and the 7ls bits are the unsigned speed value. Sent by a CAB or equivalent to request an engine speed/dir change.

§Opcode: DSPD

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), Speed/Dir (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the message. If the module does not have an active session with the specified session identifier then send ERR (No session).

§Direction: Cab to command station

§States / Modes:

§Result: If conditions are met then set the speed and direction of the loco specified by the session.

§

DccSetLocoFlags = 72

Set Engine Flags.

Sent by a cab to notify the command station of a change in engine flags.

Bits 0-1: Speed Mode (00 =128 speed steps, 01 =14 speed steps,10 =28 speed steps with interleave steps, 11 =28 speed steps) Bit 2:Lights On/OFF Bit 3:Engine relative direction Bits 4-5: Engine state (active =0 , consisted =1, consist master=2, inactive=3) Bits 6-7: Reserved.

§Opcode: DFLG

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), SpeedMode (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the message. If the module does not have an active session with the specified session identifier then send an ERR (No session) message.

§Direction: Cab to command station

§States / Modes:

§Result: If conditions are met then set the specified session flags.

§

DccLocoFunctionOn = 73

Set Engine function on.

Sent by a cab to turn on a specific loco function. This provides an alternative method to DFUN for controlling loco functions. A command

§Opcode: DFNON

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), Fnum (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the message. If the module does not have an active session with the specified session identifier then send an ERR (No session) message.

§Direction: To module

§States / Modes:

§Result: If conditions are met then turn on the loco function on the specified session.

§

DccLocoFunctionOff = 74

Set Engine function off.

Sent by a cab to turn off a specific loco function. This provides an alternative method to DFUN for controlling loco functions. A command

§Opcode: DFNOF

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), Fnum (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the message. If the module does not have an active session with the specified session identifier then send an ERR (No session) message.

§Direction: To module

§States / Modes:

§Result: If conditions are met then turn off the loco function on the specified session.

§

DccServiceModeStatus = 76

Service mode status.

Status returned by command station/programmer at the end of a programming operation that does not return data. Response to QCVS to indicate no data.

§Opcode: SSTAT

§Priority: Low

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), Status (1 bytes)

§Conditions:

§Direction: From command station

§States / Modes:

§Result:

§

ResetModuleToFactory = 79

Reset to manufacturer settings. Reset a module back to manufacturer settings.

§Opcode: NNRSM

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number

§Conditions: If the NN does not match the module’s node number then ignore the message.

§Direction: To module

§States / Modes:

§Result: then clear all configuration and revert to a state at time of initial programming, including Uninitialised mode i.e. NN=0, manufacturer’s

§

RequestNewNodeNumber = 80

Request node number.

The module is requesting that it is provided with a new node number. A configuration tool should respond with SNN to provide the requesting

§Opcode: RQNN

§Priority: low

§Services: MNS

§Parameters: NN (2 bytes) Existing Node number

§Conditions: Module has been instructed to request a new node number. This may be done in a variety of ways such as holding down a push button on the module for a number of seconds. Module will not send RQNN until instructed to obtain new NN.

§Direction: From module

§States / Modes:

§Result: will return to its previous mode and reclaim its previous NN by issuing a NNACK.

§

NodeNumberReleased = 81

Node number release.

A node signals that it no longer requires a node number by sending NNREL. The module will do this upon moving from normal mode to setup mode.

§Opcode: NNREL

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number

§Conditions: Module is in the process of changing to Setup mode.

§Direction: From module

§States / Modes:

§Result: Module no longer has a node number. The node number is replaced with 0 indicating ‘no node number’.

§

NodeNumberAck = 82

Node number acknowledge.

This message is sent in response to SNN. A node signals that it will

§Opcode: NNACK

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) the new node number to be used.

§Conditions: Module will be transitioning from Setup mode to Normal mode.

§Direction: From module

§States / Modes:

§Result: Module will be in Normal mode with the new node number assigned.

§

PutNodeIntoLearnMode = 83

Set node into learn mode.

Sent by a configuration tool to put a specific node into learn mode.

§Opcode: NNLRN

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number

§Conditions: if the NN does NOT match the node number of the module and the module is in Learn mode then it must revert to Normal mode. If the NN does NOT match the node number of the module and the module is not in Learn mode then the message is ignored. If the NN matches the module’s node number and the module supports event teaching then the module enters Learn mode. If the NN matches the module’s node number and the module does not support event teaching then the message is ignored.

§Direction: To module

§States / Modes:

§Result: If conditions are met then the module enters Learn mode.

§

ReleaseNodeFromLearnMode = 84

Release node from learn mode.

Sent by a configuration tool to take the module out of learn mode and revert to normal operation.

§Opcode: NNULN

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number

§Conditions: If the module does not support event teaching then the message is ignored. If the module is in Learn mode then the module exits Learn mode and returns to Normal mode. Note: the NN does not need to match the module’s node number.

§Direction: To module

§States / Modes:

§Result: If the conditions are met the module exits Learn mode and enters Normal mode.

§

ForgetAllLearnedEvents = 85

Clear all events from a node.

Sent by a configuration tool to clear all events from a specific node. Must be in learn mode first to safeguard against accidental erasure of all events

§Opcode: NNCLR

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number

§Conditions: If the NN does not match the module’s node number then the message is ignored. If the module is not in learn mode then a CMDERR(Not Learn Mode) message and a GRSP(Not in Learn Mode) is returned. If the module does not support event teaching then the message is ignored.

§Direction: To module

§States / Modes:

§Result: message.

§

QueryAvailableEventSlots = 86

Read the number of event slots available in a node.

Sent by a configuration tool to read the number of available event slots in a node.

§Opcode: NNEVN

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number

§Conditions: If the NN does not match the module’s node number then ignore the message.

§Direction: To module

§States / Modes:

§Result: available slots in event table.

§

QueryAllLearnedEvents = 87

Read back all stored events in a node.

There MUST be no hidden events. Sent by a configuration tool to read all the stored events in a node.

§Opcode: NERD

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number

§Conditions: If the NN does not match the module’s node number then ignore the message.

§Direction: To module

§States / Modes:

§Result: event.

§

QueryLearnedEventCount = 88

Request to read number of stored events.

Sent by a configuration tool to read the number of stored events in a node.

§Opcode: RQEVN

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number

§Conditions: If the NN does not match the module’s node number then ignore the message.

§Direction: To module

§States / Modes:

§Result: number of stored events.

§

WriteAck = 89

Write acknowledge.

Sent by a node to indicate the completion of a write to memory operation. All nodes must issue WRACK when a write operation to node variables, events or event variables has completed. This allows for teaching nodes where the processing time may be slow.

§Opcode: WRACK

§Priority: Low

§Services: Teach, NV

§Parameters: NN (2 bytes) Node number

§Conditions: The module has completed writing to non-volatile memory and is ready to accept more commands.

§Direction: From module

§States / Modes:

§Result:

§

QueryNodeData = 90

Request node data event.

Sent by one node to read the data event from another node.(eg: RFID data).

§Opcode: RQDAT

§Priority: Low

§Services:

§Parameters: NN (2 bytes) Node number

§Conditions: If the NN does not match the module’s node number then ignore the message. If the module does not support RQDAT then ignore the message.

§Direction: Both

§States / Modes:

§Result: application specific data.

§

RequestDeviceDataShortMode = 91

Request device data –short mode.

To request a ‘data set’ from a device using the short event method where DN is the device number.

§Opcode: RQDDS

§Priority: Low

§Services:

§Parameters: DN (2 bytes) Device number

§Conditions: If DN is not recognised by the module then ignore the message.

§Direction: To module

§States / Modes:

§Result:

§

RebootIntoBootloader = 92

Put node into bootloading mode. For modules with no NN then the NN of the command must be zero. For nodes in Normal mode the command must contain the NN of the target node. Sent by a configuration tool to prepare for loading a new program.

§Opcode: BOOTM

§Priority: Low

§Services: Boot

§Parameters: NN (2 bytes) Node number

§Conditions: If NN does not match the module’s node number then ignore the message.

§Direction: To module

§States / Modes:

§Result: If conditions are met then enter BOOT mode. If using the standard PIC bootloader then write a 0x01 to the top EEPROM location and reset the processor. The module’s PIC bootloader will be activated before the application code. Once the bootloading is complete it will pass control by to the application at the Load Address in the parameter block.

§

ForceCanEnumeration = 93

Force a self enumeration cycle for use with CAN.

For nodes in Normal mode using CAN as a transport. This message will force a self-enumeration cycle for the specified node. A new CAN_ID will be allocated if needed.

§Opcode: ENUM

§Priority: Low

§Services: CAN

§Parameters: NN (2 bytes) Node number

§Conditions: If the NN does not match the module’s node number then the message will be ignored.

§Direction: To module

§States / Modes:

§Result: If conditions are met then start to perform self enumeration. A RTR CAN frame is sent. The module must wait 100ms for other modules to respond with a zero length data frame containing their CANID. After 100ms the module shall select an unused CANID in the range 1..127. If no CANIDs are available then send CMDERR(7).

§

RestartNode = 94

Reset module’s CPU.

Reset a module’s microprocessor.

§Opcode: NNRST

§Priority: Low

§Services:

§Parameters: NN (2 bytes) Node number

§Conditions: If the NN does not match the module’s node number then ignore the request.

§Direction: To module

§States / Modes:

§Result: If conditions are met then perform a reset of the microprocessor.

§

ExtOpCode1 = 95

Extended opcode with 1 additional byte.

Reserved to allow the 1 additional bytes range to be extended by a further 256 opcodes.

§Opcode: EXTC1

§Priority: Low

§Services:

§Parameters: Ext_OPC (1 bytes) Extended opcode, Data1 (1 bytes)

§Conditions:

§Direction:

§States / Modes:

§Result:

§

DccSetLocoFunctions = 96

Set Engine functions.

is the function range 1 is F0(FL) to F4, 2 is F5 to F8, 3 is F9 to F12, 4 is F13 to F20, 5 is F21to F28) is the NMRA DCC format function byte for that range in corresponding bits. A bit set to 1 turns function “on” and a cleared bit sets function “off”. Sent by a CAB or equivalent to request an engine Fn state change.

§Opcode: DFUN

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), Fn1 (1 bytes), Fn2 (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the message. If the module does not have an active session with the specified session identifier then send an ERR (No session) message.

§Direction: Cab to command station

§States / Modes:

§Result: If conditions are met then set the functions in the range given to the requested state.

§

DccQueryLocoSession = 97

Get engine session.

contains flag bits as follows: Bit 0: Set for “Steal” mode Bit 1: Set for “Share” mode. Both bits set to 0 is exactly equivalent to an RLOC request but

§Opcode: GLOC

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Addr (2 bytes), Flags (1 bytes)

§Conditions: (Invalid Request) message. If the loco with the specified address is taken and steal/share is disabled then send an ERR (Loco taken) message.

§Direction: Cab to command station

§States / Modes:

§Result:

§

DccCommandStationError = 99

Command Station Error report.

Sent in response to an error situation by a command station. See Appendix A - DCC ERR error codes for a list of error codes.

§Opcode: ERR

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: AddrH (1 bytes), AddrL (1 bytes), ErrorCode (1 bytes)

§Conditions: Sent by a command station in response to a DCC command to report an error.

§Direction: From command station to cab

§States / Modes:

§Result: See table below for the use of the Data fields.

§

NodeConfigurationError = 111

Error messages from nodes during configuration.

Sent by node if there is an error when a configuration command is sent. See Appendix C - CMDERR error codes for the list of supported codes.

§Opcode: CMDERR

§Priority: Low

§Services: MNS, Teach, NV

§Parameters: NN (2 bytes) Node number, Error (1 bytes) Error number, see CMDERR list in Appendix C

§Conditions: Sent by a module to indicate an error response to a command.

§Direction: From module

§States / Modes:

§Result:

§

AvailableEventSlots = 112

Event space left reply from node.

Spaces is a one byte value giving the number of available event spaces left in the node’s event table. This is the maximum number of additional events that can be stored by the module.

§Opcode: EVNLF

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number, Spaces(1 bytes)

§Conditions:

§Direction: From module

§States / Modes:

§Result:

§

QueryNodeVariable = 113

Request read of a node variable.

NV# is the index for the node variable value requested. Response is NVANS.

§Opcode: NVRD

§Priority: Low

§Services: NV

§Parameters: NN (2 bytes) Node number, NV# (1 bytes) Node variable index

§Conditions: (Invalid Command) message is returned. If NV# is not between 0 and the supported number of NVs then CMDERR (Invalid Node Variable Index) message is returned and a

§Direction: To module

§States / Modes:

§Result: If conditions are met and NV# is 0 then send a NVANS response for NV#0 and value of the number of NVs followed by a NVANS for each NV. If conditions are met and NV# is greater than 0 then send a single NVANS response containing the value of the requested NV.

§

QueryLearnedEventByIndex = 114

Request read of stored event by event index.

EN# is the index for the stored event requested.

§Opcode: NENRD

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number, EN# (1 bytes) Event index

§Conditions: NN matches module’s node number. EN# is a valid event index

§Direction: To module

§States / Modes:

§Result: response message otherwise send CMDERR(Invalid Event Index).

§

QueryNodeParameterByIndex = 115

Request read of a node parameter by index.

Para# is the index for the parameter requested. Reading Index 0 first returns a PARAN with the number of available

§Opcode: RQNPN

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, Para# (1 bytes)

§Conditions: (Invalid Command) message is returned. If Para# is greater than the number of supported parameters the send message CMDERR(Invalid Parameter Index) and message

§Direction: To module

§States / Modes:

§Result: message for each of the parameters else send a single PARAN

§

LearnedEventCount = 116

Number of events stored by node.

Response to request RQEVN

§Opcode: NUMEV

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number, No. of events (1 bytes) Number of events

§Conditions:

§Direction: From module

§States / Modes:

§Result:

§

SetNodeCanId = 117

Set the CAN_ID in the node.

Used to force a specified CAN_ID into a node. Value range is from 1 to 0x63 (99 decimal). This OPC must be used with care as duplicate CAN_IDs are not allowed.

§Opcode: CANID

§Priority: Low

§Services: CAN

§Parameters: NN (2 bytes) Node number, CAN_ID (1 bytes) CAN identifier

§Conditions: If NN does not match the module’s node number then ignore the message. If the message is short so that it does not include the CAN_ID then a GRSP (Invalid Command) message is returned.

§Direction: To module

§States / Modes:

§Result:

§

PutNodeIntoMode = 118

Request a change to a module’s operating mode.

Request to change the operational mode of the module.

§Opcode: MODE

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, Mode (1 bytes) Mode Command. ● Mode command = 0 is a request to transition to Setup Mode ● Mode command = 1 is a request to transition to Normal Mode. Please refer to service specific documentation for other Mode Command definitions.

§Conditions: If the module has a non zero node number and NN does not match the module’s node number then ignore the message. Note that if the module is in Setup mode or Uninitialised mode then the module’s NN should be zero. If the message is short so that it does not include the Mode Command then a GRSP (Invalid Command) message is returned.

§Direction: To module

§States / Modes:

§Result: If requested Mode Command is supported by the module’s services then send GRSP(ok). Any change to the module’s current mode is

§

ServiceDiscoveryQuery = 120

Request service discovery.

Request service data from a module. If the ServiceIndex is zero then the module responds with a SD

§Opcode: RQSD

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, ServiceIndex (1 bytes) Index into the list of services.

§Conditions: If ServiceIndex does not reference a valid service then send a GRSP(Invalid service) message.

§Direction: To module

§States / Modes:

§Result: sent followed by a SD message for each implemented service, otherwise send an ESD message for the specified service.

§

ExtOpCode2 = 127

Extended opcode with 2 additional bytes.

Reserved to allow the 2 additional bytes range to be extended by a further 256 opcodes.

§Opcode: EXTC2

§Priority: Low

§Services:

§Parameters: Ext_OPC (1 bytes) Extended opcode, Data1 (1 bytes) Data2 (1 bytes)

§Conditions:

§Direction:

§States / Modes:

§Result:

§

DccSendRawPacket3 = 128

Request 3-byte DCC Packet.

Allows a CAB or equivalent to request a 3 byte DCC packet to be sent to the track. The packet is sent times and is not refreshed on a regular basis. Note: a 3 byte DCC packet is the minimum allowed.

§Opcode: RDCC3

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Rep (1 bytes), Byte1 (1 bytes), Byte2 (1 bytes), Byte3 (1 bytes)

§Conditions: If the module is not a command station then ignore the message.

§Direction: Cab to common station

§States / Modes:

§Result: If conditions are met then the DCC command stations shall send the requested DCC packet times.

§

DccWriteCvByteInOpsMode = 130

Write CV (byte) in OPS mode.

Sent to the command station to write a DCC CV byte in OPS mode to a specific loco (on the main).

§Opcode: WCVO

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), CV (2 bytes), Value (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the message. If the command station does not have an active session with the specified session identifier then send a message ERR(No session).

§Direction: To command station

§States / Modes:

§Result: If conditions are met then the DCC command stations shall write the specified value to the specified CV.

§

DcWriteCvBitInOpsMode = 131

Write CV (bit) in OPS mode. Sent to the command station to write a DCC CV in OPS mode to specific loco (on the main). The format for Value is that specified in RP 9.2.1 for OTM bit manipulation in a DCC packet. This is ‘111CDBBB’ where C here is always 1 as only ‘writes’ are possible OTM (unless some loco ACK scheme like RailCom is used). D is the bit value, either 0 or 1 and BBB is the bit position in the CV byte. 000 to 111 for bits 0 to 7.

§Opcode: WCVB

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), CV (2 bytes), Value (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the message. If the command station does not have an active session with the specified session identifier then send a message ERR(No session).

§Direction: To command station

§States / Modes:

§Result: If conditions are met then the DCC command stations shall write the specified value to the specified CV in bit mode.

§

DccReadCv = 132

Read CV. This command is used exclusively with service mode. Sent by the cab to the command station in order to read a CV value.

§Opcode: QCVS

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), CV (2 bytes), Mode (1 bytes)

§Conditions: If the module is not a DCC command station then ignore the message. If the command station does not have an active session with the specified session identifier then send a message ERR(No session).

§Direction: Cab to command station

§States / Modes:

§Result:

§

DccCvValue = 133

Report CV.

This command is used exclusively with service mode. Sent by the command station to report a read CV in response to QCVS.

§Opcode: PCVS

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), CV (2 bytes), Value (1 bytes)

§Conditions:

§Direction: From command station

§States / Modes:

§Result:

§

QueryDiagnosticData = 135

Request diagnostic data.

Request diagnostic data from a module. If the requested diagnostic data is zero then a response for all diagnostic data is returned.

§Opcode: RDGN

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, ServiceIndex (1 bytes) Index into the list of services, DiagnosticCode (1 bytes) Diagnostic data code

§Conditions: If ServiceIndex references an unsupported service then send a GRSP(Invalid service) message. If ServiceIndex references a valid service and DiagnosticCode is zero but the service does not support diagnostics then GRSP (INVALID_DIAGNOSTIC) should be returned. If DiagnosticCode references an invalid or unsupported diagnostic number then send a GRSP(Invalid diagnostic) message.

§Direction: To module

§States / Modes:

§Result: indicating the number of DiagnosticCodes for that service followed by a DGN message for each diagnostic code. Note that DiagnosticCode in

§

SetNodeVariable = 142

Set a NV value with read back. Sets a NV value and additionally responds with the new value.nvset The new value may not be the value which was requested to be written.

§Opcode: NVSETRD

§Priority: Low

§Services: NV

§Parameters: NN (2 bytes) Node number, NV# (1 bytes) Node variable index NVvalue (1 byte) Node variable value

§Conditions: If the NN does not match the module’s node number then ignore the message. If the message is short so that it does not include the specified parameters then a GRSP (Invalid Command) message is returned.

§Direction: To module

§States / Modes:

§Result: message containing the NV value.

§

LongEventAccessoryOn = 144

Accessory ON long event.

Indicates an ‘ON’ event using the full event number of 4 bytes (long event). An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions.

§Opcode: ACON

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event then perform the actions associated with the ON event.

§

LongEventAccessoryOff = 145

Accessory OFF long event.

Indicates an ‘OFF’ event using the full event number of 4 bytes (long event). An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions.

§Opcode: ACOF

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event then perform the actions associated with the OFF event.

§

QueryLongEventAccessoryState = 146

Accessory Request Event.

Indicates a ‘request’ event using the full event number of 4 bytes (long event). A request event is used to elicit a status response from a producer when it is required to know the ‘state’ of the producer without producing an ON or OFF event.

§Opcode: AREQ

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: If the module does not have the event provisioned then ignore the message.

§Direction: To module

§States / Modes:

§Result:

§

LongEventAccessoryStateOn = 147

Accessory Response Event.

Indicates an ‘ON’ response. A response is a reply to a status request (AREQ) without producing an ON or OFF event.

§Opcode: ARON

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: The module has the event defined and the current state of the event is ON.

§Direction: From module

§States / Modes:

§Result:

§

LongEventAccessoryStateOff = 148

Accessory Response Event (AROF).

Indicates an ‘OFF’ response. A response is a reply to a status request (AREQ) without producing an ON or OFF event.

§Opcode: AROF

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: The module has the event defined and the current state of the event is OFF.

§Direction: From module

§States / Modes:

§Result:

§

ForgetLearnedEvent = 149

Unlearn an event in learn mode.

Sent by a configuration tool to remove an event from a node.

§Opcode: EVULN

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: If the module does not currently have the event configured then send a CMDERR(Invalid Event) message and a GRSP(Invalid Event)

§Direction: To module

§States / Modes:

§Result:

§

LegacySetNodeVariable = 150

Set a node variable.

Sent by a configuration tool to set a node variable. NV# is the NV index number.

§Opcode: NVSET

§Priority: Low

§Services: NV

§Parameters: NN (2 bytes) Node number, NV# (1 bytes) Node variable index, NV val (1 bytes) Node variable value

§Conditions: If NV# is not between 1 (inclusive) and the number of NVs )inclusive) then send a CMDERR(Invalid Node Variable Index) message.

§Direction: To module

§States / Modes:

§Result:

§

NodeVariableValue = 151

Response to a request for a node variable value.

Sent by node in response to request NVRD or NVSETRD.

§Opcode: NVANS

§Priority: Low

§Services: NV

§Parameters: NN (2 bytes) Node number, NV# (1 bytes) Node variable index, NV val (1 bytes) Node variable value

§Conditions: NVANS is returned in response.

§Direction: From module

§States / Modes:

§Result:

§

ShortEventAccessoryOn = 152

Accessory Short ON.

Indicates an ‘ON’ event using the short event number of 2 LS bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The NN is not used to match events, the NN normally indicates the source of the event.

§Opcode: ASON

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event (ignoring the NN) then perform the actions associated with the ON event.

§

ShortEventAccessoryOff = 153

Accessory Short OFF.

Indicates an ‘OFF’ event using the short event number of 2 LS bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The NN is not used to match events, the NN normally indicates the source of the event.

§Opcode: ASOF

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state OFF then send this event. If the module has been configured to consume the event (ignoring the NN) then perform the actions associated with the OFF event.

§

QueryShortEventAccessoryState = 154

Accessory Short Request Event.

Indicates a ‘request’ event using the short event number of 2 LS bytes. A request event is used to elicit a status response from a producer when it is required to know the ‘state’ of the producer without producing an ON or OFF event.

§Opcode: ASRQ

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: If NN==0, then every module that produces this short-event should respond. If the NN does not match the module’s node number and is non zero then ignore the message. If the module does not have the event provisioned then ignore the message.

§Direction: To module

§States / Modes:

§Result:

§

NodeParameterValue = 155

Response to request for individual node parameter RQNPN.

NN is the node number of the sending node. Para# is the index of the parameter and Para val is the parameter value. Returns a parameter value. Parameter index is the parameter number and matches that in the RQNPN request.

§Opcode: PARAN

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, Para# (1 bytes) Parameter index, Para val (1 bytes) Parameter value

§Conditions: Response to RQNPN request

§Direction: From module

§States / Modes:

§Result: The PARAN message contains the requested parameter value.

§

QueryEventVariable = 156

Request for read of an event variable.

This request differs from B2 (REQEV) as it doesn’t need to be in learn

§Opcode: REVAL

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number, EN# (1 bytes) Event index, EV# (1 bytes) Event variable index

§Conditions: If the module does not have an event for the event index then send a message CMDERR(Invalid Event).

§Direction: To module

§States / Modes:

§Result: message with the EV value. If conditions are met and EV# is zero then first send NEVAL for index 0

§

ShortEventAccessoryStateOn = 157

Accessory Short Response Event.

Indicates an ‘ON’ response. A response is a reply to a status request (ASRQ) without producing an ON or OFF event.

§Opcode: ARSON

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: The module has the event defined and the current state of the event is ON.

§Direction: From module

§States / Modes:

§Result:

§

ShortEventAccessoryStateOff = 158

Accessory Short Response Event.

Indicates an ‘OFF’ response. A response is a reply to a status request (ASRQ) without producing an ON or OFF event.

§Opcode: ARSOF

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number

§Conditions: The module has the event defined and the current state of the event is OFF.

§Direction: From module

§States / Modes:

§Result:

§

ExtOpCode3 = 159

Extended opcode with 3 additional bytes. Reserved to allow the 3 additional bytes range to be extended by a further 256 opcodes.

§Opcode: EXTC3

§Priority: Low

§Services:

§Parameters: Ext_OPC (1 bytes) Extended opcode, Data1 (1 bytes) Data2 (1 bytes) Data3 (1 bytes)

§Conditions:

§Direction:

§States / Modes:

§Result:

§

DccSendRawPacket4 = 160

Request 4-byte DCC Packet. Allows a CAB or equivalent to request a 4 byte DCC packet to be sent to the track. The packet is sent times and is not refreshed on a regular basis.

§Opcode: RDCC4

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: REP (1 bytes), Byte0 (1 bytes), Byte1 (1 bytes), Byte2 (1 bytes), Byte3 (1 bytes)

§Conditions: If the NN does not match the node number of the module then ignore the message. If the module is not a DCC command station then ignore the message.

§Direction: To command station

§States / Modes:

§Result: If conditions are met then the requested DCC packet is sent times.

§

DccWriteCvInServiceMode = 162

Write CV in Service mode. Sent to the command station to write a DCC CV in service mode.

§Opcode: WCVS

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), CV (2 bytes), Mode (1 bytes), Value (1 bytes)

§Conditions: If the NN does not match the module’s node number then ignore the message. If the module is not a DCC command station then ignore the request. If the command station does not have an active session with id then send a ERR(No session) message.

§Direction: To module

§States / Modes:

§Result: If conditions are met then the DCC command station shall write the specified CV.

§

Heartbeat = 171

Heartbeat from module.

Heartbeat message from module indicating that the module is alive and communicating on the bus. Sent every 5 seconds by a module to confirm it is alive and connected to the network along with an indication of module status. Sequence is a count from 0 incrementing on each message transmitted and wrapping around to zero, It facilitates detection of missing frames. Status: This is a binary representation of the module’s diagnostic status as outlined in MNS Specification Section 8.3. 0x00 Shall always represent “normal“ operation. StatusBits: Reserved for future expansion, set to 0x00

§Opcode: HEARTB

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Source Node number, Sequence (1 bytes) The message sequence number Status (1 bytes) Diagnostic status, StatusBits (1 bytes) Reserved,

§Conditions:

§Direction: From module

§States / Modes:

§Result:

§

ServiceDiscoveryResponse = 172

Service discovery response.

The version of a service supported by a module. Sent in response to RQSD with ServiceIndex = 0. A number of SD

§Opcode: SD

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, ServiceIndex (1 bytes) Index into the list of services. Note that ServiceIndex values may not be contiguous and therefore the ServiceIndex may be greater than the number of services reported within the first response to RQSD. ServiceType (1 bytes) Service Type, Version (1 bytes) Version of the service definition, not the version of its implementation.

§Conditions:

§Direction: From module

§States / Modes:

§Result: supported by the module.

§

GenericResponse = 175

Generic Response.

Generic response for a configuration change request. Result byte indicates ok for success or an error code in case of failure. Indicates the module is ready for further configuration. The CMDERR codes are supported and in addition service specific

§Opcode: GRSP

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, opcode (1 bytes) Request opcode, ServiceType (1 bytes) Service Type, Result (1 bytes) Result

§Conditions:

§Direction: From module

§States / Modes:

§Result: Sent to indicate the result of a configuration change request. Module is ready for further configuration.

§

LongEventAccessoryOn1 = 176

Accessory ON.

Indicates an ‘ON’ event using the full event number of 4 bytes with one additional data byte. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ACON1

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data (1 bytes) Event data 1

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event then perform the actions associated with the ON event.

§

LongEventAccessoryOff1 = 177

Accessory OFF.

Indicates an ‘OFF’ event using the full event number of 4 bytes with one additional databyte. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ACOF1

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data (1 bytes) Event data 1

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state OFF then send this event. If the module has been configured to consume the event then perform the actions associated with the OFF event.

§

QueryEventVariableInLearnMode = 178

Read event variable in learn mode.

Allows a configuration tool to read stored event variables from a node. EV# is the EV variable index. NN and EN identify the event and not the module. Reading EV#0 shall first return the number of EVs followed by a series of EVANS with the value for each EV.

§Opcode: REQEV

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number of event, EN (2 bytes) Event number, EV# (1 bytes) Event variable index

§Conditions: If the EV# is greater than the number of EVs per event then send a message CMDERR(Invalid event variable index) and GRSP(Invalid

§Direction: To module

§States / Modes:

§Result: message with the EV value. If conditions are met and EV# is zero then first send EVANS for index 0

§

LongEventAccessoryStateOn1 = 179

Accessory Response Event.

Indicates an ‘ON’ response with one additional data byte. A response is a reply to a status request (AREQ) without producing an ON or OFF

§Opcode: ARON1

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data (1 bytes) Event data 1

§Conditions: The module has the event defined and the current state of the event is ON.

§Direction: From module

§States / Modes:

§Result:

§

LongEventAccessoryStateOff1 = 180

Accessory Response Event. Indicates an ‘OFF’ response with one additional data byte. A response is a reply to a status request (AREQ) without producing an ON or OFF

§Opcode: AROF1

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data (1 bytes) Event data 1

§Conditions: The module has the event defined and the current state of the event is OFF.

§Direction: From module

§States / Modes:

§Result:

§

EventVariableValue = 181

Response to request for read of EV value.

This is the response to the request to read an EV - REVAL.

§Opcode: NEVAL

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number, EN# (1 bytes) Event index, EV# (1 bytes) Event variable index, EVval (1 bytes) Event variable value

§Conditions:

§Direction: From module

§States / Modes:

§Result: The EV value is returned in the message.

§

NodeInfo = 182

Response to Query Node - QNN.

Sent in response to a QNN request.

§Opcode: PNN

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, Manufacturer Id (1 bytes) Manufacturer identifier, Module Id (1 bytes) Module identifier, Flags (1 bytes) Module flags

§Conditions:

§Direction: From module

§States / Modes:

§Result: Returned in response to QNN. The message contains important information about the module.

§

ShortEventAccessoryOn1 = 184

Accessory Short ON.

Indicates an ‘ON’ event using the short event number of 2 LS bytes with one added data byte. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The NN is not used to match events, the NN normally indicates the source of the event. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ASON1

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data (1 bytes) Event data 1

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event (ignoring the NN) then perform the actions associated with the ON event.

§

ShortEventAccessoryOff1 = 185

Accessory Short OFF.

Indicates an ‘OFF’ event using the short event number of 2 LS bytes with one added data byte. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The NN is not used to match events, the NN normally indicates the source of the event. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ASOF1

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data (1 bytes) Event data 1

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state OFF then send this event. If the module has been configured to consume the event (ignoring the NN) then perform the actions associated with the OFF event.

§

ShortEventAccessoryStateOn1 = 189

Accessory Short Response Event. Indicates an ‘ON’ response with one added data byte. A response is a reply to a status request (ASRQ)without producing an ON or OFF

§Opcode: ARSON1

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data (1 bytes) Event data 1

§Conditions: The module has the event defined and the current state of the event is ON.

§Direction: From module

§States / Modes:

§Result:

§

ShortEventAccessoryStateOff1 = 190

Accessory Short Response Event with one data byte. Indicates an ‘OFF’ response with one added data byte. A response is a reply to a status request (ASRQ) without producing an ON or OFF event. A response event is a reply to a status request (ASRQ)without

§Opcode: ARSOF1

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data (1 bytes) Event data 1

§Conditions: The module has the event defined and the current state of the event is OFF.

§Direction: From module

§States / Modes:

§Result:

§

ExtOpCode4 = 191

Extended opcode with 4 additional bytes. Reserved to allow the 4 additional bytes range to be extended by a further 256 opcodes.

§Opcode: EXTC4

§Priority: Low

§Services:

§Parameters: Ext_OPC (1 bytes) Extended opcode, Data1 (1 bytes) Data2 (1 bytes) Data3 (1 bytes) Data4 (1 bytes)

§Conditions:

§Direction:

§States / Modes:

§Result:

§

DccSendRawPacket5 = 192

Request 5-byte DCC Packet. Allows a CAB or equivalent to request a 5 byte DCC packet to be sent to the track. The packet is sent times and is not refreshed on a regular basis.

§Opcode: RDCC5

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: REP (1 bytes), Byte 0 (1 bytes), Byte1 (1 bytes), Byte2 (1 bytes), Byte3 (1 bytes), Byte4 (1 bytes)

§Conditions: If the NN does not match the node number of the module then ignore the message. If the module is not a DCC command station then ignore the message.

§Direction: To module

§States / Modes:

§Result: If conditions are met then the requested DCC packet is sent times.

§

DccWriteCvByteInOpsModeByAddress = 193

Write CV (byte) in OPS mode by address.

Sent to the command station to write a DCC CV byte in OPS mode to specific loco (on the main). Used by computer based ops mode programmer that does not have a valid throttle handle.

§Opcode: WCVOA

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Addr (2 bytes), CV (2 bytes), Mode (1 bytes), Value (1 bytes)

§Conditions: If the NN does not match the module’s node number then ignore the message. If the module is not a DCC command station then ignore the request.

§Direction: To command station

§States / Modes:

§Result: If conditions are met then the DCC command station shall write the specified CV.

§

DccSendDataToCab = 194

Send data to the DCC CAB which is controlling a particular loco.

addrH and addrL are the loco address in the same format as RLOC and GLOC 7 bit addresses have (addrH=0). 14 bit addresses have bits 6,7 of addrH set to 1. dataCode defines the meaning of the remaining 3 bytes. The following values for dataCod have currently been defined: ● 01 - CABSIG - Transmitted by a layout control system to send signal aspects to be displayed on a cab handset as cab signalling. Parameter data1 is used for aspect1 Parameter data2 is used for aspect2 Parameter data3 is used for speed aspect1 is signalling system independent, and is defined as follows (colours in brackets correspond to UK colour light signalling, the given aspect names may be displayed differently in other signalling systems): Bits 0-1 - 2 bit aspect code 00=danger (red), 01=caution (yellow), 10=preliminary caution (double yellow), 11=proceed (green) Bit 2 - set 1 for calling on or shunt aspect (bits 0-1 would be set to 00 for danger when calling on) Bit 3 - Set 0 to indicate upper nibble is feather location, set 1 for upper nibble is theatre type route indicator Bits 4-7 - 0 - no route indicated, 1 to 6 = feather position or 1 to 16 for theatre route indication aspect1 should be set to 0xFF if no signal information is available. This can be used, for example, to indicate leaving a cab signalling area. A cab should extinguish any currently showing aspect on receipt of this code. Note that because bits 0 and 1 should be set to zero when bit 2 is set, the code 0xFF is not otherwise a valid aspect. may be used as required for specific signalling systems. The meaning will vary for each signalling system. For the UK 2003 rulebook, bit 0 set indicates a flashing aspect, applicable to caution, preliminary caution or proceed. For UK semaphore signalling, where there are multiple arms for

§Opcode: CABDAT

§Priority: Normal

§Services:

§Parameters:

§Conditions:

§Direction:

§States / Modes:

§Result:

§

DiagnosticData = 199

Diagnostic data response.

Diagnostic data value from a module. Sent in response to RDGN.

§Opcode: DGN

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, ServiceIndex (1 bytes) Index into the list of services, DiagnosticCode (1 bytes) Diagnostic data code, DiagnosticVal (2 bytes) Diagnostic data value

§Conditions:

§Direction: From module

§States / Modes:

§Result: requested diagnostic of the specified service.

§

FastClock = 207

Fast Clock.

Used to implement a fast clock for the layout.

§Opcode: FCLK

§Priority: Normal

§Services:

§Parameters: mins (1 bytes) Minutes 0-59, hrs (1 bytes) Hours 0-23, wdmon (1 bytes) Bits 0-3 define day of week (1=Sun ..7=Sat). Bits 4-7 define month (1=Jan .. 12=Dec), div (1 bytes) Divider. 0=freeze, mday (1 bytes) Day of month 1-31, temp (1 bytes) Temperature. Two’s complement -127 to +127

§Conditions:

§Direction:

§States / Modes:

§Result: If conditions are met then update a fast clock with the specified settings.

§

LongEventAccessoryOn2 = 208

Accessory ON.

Indicates an ‘ON’ event using the full event number of 4 bytes with two additional data bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ACON2

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event then perform the actions associated with the ON event.

§

LongEventAccessoryOff2 = 209

Accessory OFF.

Indicates an ‘OFF’ event using the full event number of 4 bytes with two additional data bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ACOF2

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction: Both

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state OFF then send this event. If the module has been configured to consume the event then perform the actions associated with the OFF event.

§

TeachEvent = 210

Teach an event in learn mode.

Sent by a configuration tool to a node in learn mode to teach it an event variable. Also teaches it the associated event. This command is repeated for each EV required.

§Opcode: EVLRN

§Priority: Low

§Services: Event/Teach

§Parameters: NN (2 bytes) Event Node number, EN (2 bytes) Event number, EV# (1 bytes) Event variable index, (1-n) EV val (1 bytes) Event variable value

§Conditions: GRSP(Too many events) message.

§Direction: To module

§States / Modes:

§Result: If the NN is zero then the taught event will be considered to be a Short event. If the NN is non zero then the event will be considered to be a Long event.

§

EventVariableValueInLearnMode = 211

Response to a request for an EV value in a node in learn mode.

A node response to a request from a configuration tool for the EVs associated with an event (REQEV). For multiple EVs, there will be one

§Opcode: EVANS

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) event’s Node number, EN (2 bytes) Event number, EV# (1 bytes) Event variable index, EV val (1 bytes) Event variable value

§Conditions: If the original request was for EV# of zero then multiple EVANS will be sent, The first for EV#0 with EV val set to the number of EVs and subsequent EVANS one for each EV containing the EV value.

§Direction: From module

§States / Modes:

§Result:

§

LongEventAccessoryStateOn2 = 212

Accessory Response Event.

Indicates an ‘ON’ response event with two added data bytes. A response is a reply to a status request (AREQ) without producing an

§Opcode: ARON2

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2

§Conditions: The module has the event defined and the current state of the event is ON.

§Direction: From module

§States / Modes:

§Result:

§

LongEventAccessoryStateOff2 = 213

Accessory Response Event.

Indicates an ‘OFF’ response event with two added data bytes. A response is a reply to a status request (AREQ) without producing an

§Opcode: AROF2

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2

§Conditions: The module has the event defined and the current state of the event is OFF.

§Direction: From module

§States / Modes:

§Result:

§

ShortEventAccessoryOn2 = 216

Accessory Short ON. Indicates an ‘ON’ event using the short event number of 2 LS bytes with two added data bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The NN is not used to match events, the NN normally indicates the source of the event. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ASON2

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event (ignoring the NN) then perform the actions associated with the ON event.

§

ShortEventAccessoryOff2 = 217

Accessory Short OFF. Indicates an ‘OFF’ event using the short event number of 2 LS bytes with two added data bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The NN is not used to match events, the NN normally indicates the source of the event. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ASOF2

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state OFF then send this event. If the module has been configured to consume the event (ignoring the NN) then perform the actions associated with the OFF event.

§

ShortEventAccessoryStateOn2 = 221

Accessory Short Response Event ON with two data bytes.

Indicates an ‘ON’ response event with two added data bytes. A response is a reply to a status request (ASRQ)without producing an ON

§Opcode: ARSON2

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2

§Conditions: The module has the event defined and the current state of the event is ON.

§Direction: From module

§States / Modes:

§Result:

§

ShortEventAccessoryStateOff2 = 222

Accessory Short Response Event OFF with two data bytes.

Indicates an ‘OFF’ response event with two added data bytes. A response is a reply to a status request (ASRQ) without producing an

§Opcode: ARSOF2

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2

§Conditions: The module has the event defined and the current state of the event is OFF.

§Direction: From module

§States / Modes:

§Result:

§

ExtOpCode5 = 223

Extended opcode with 5 additional bytes.

Reserved to allow the 5 additional bytes range to be extended by a further 256 opcodes.

§Opcode: EXTC5

§Priority: Low

§Services:

§Parameters: Ext_OPC (1 bytes) Extended opcode, Data1 (1 bytes) Data2 (1 bytes) Data3 (1 bytes) Data4 (1 bytes) Data5 (1 bytes)

§Conditions:

§Direction:

§States / Modes:

§Result:

§

DccSendRawPacket6 = 224

Request 6-byte DCC Packet.

Allows a CAB or equivalent to request a 6 byte DCC packet to be sent to the track. The packet is sent times and is not refreshed on a regular basis.

§Opcode: RDCC6

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: REP (1 bytes), Byte0 (1 bytes), Byte1 (1 bytes), Byte2 (1 bytes), Byte3 (1 bytes), Byte4 (1 bytes), Byte5 (1 bytes)

§Conditions: If the NN does not match the node number of the module then ignore the message. If the module is not a DCC command station then ignore the message.

§Direction: To module

§States / Modes:

§Result: If conditions are met then the requested DCC packet is sent times.

§

DccLocoReport = 225

Engine report.

A report of an engine entry sent by the command station. Sent in response to QLOC or as an acknowledgement of acquiring an engine

§Opcode: PLOC

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: Session (1 bytes), Addr (2 bytes), Speed/Dir (1 bytes), Fn1 (1 bytes) Function byte F0-F4, Fn2 (1 bytes) Function byte F5-F8, Fn3 (1 bytes) Function byte F9-F12

§Conditions:

§Direction: From command station

§States / Modes:

§Result:

§

ModuleName = 226

Response to request for node name string.

Returns the type name for the module in response to RQMN. Any

§Opcode: NAME

§Priority: Low

§Services: MNS

§Parameters: NAME (7 bytes) Module type name in ASCII and padded on right with spaces (0x20).

§Conditions:

§Direction: From module

§States / Modes:

§Result:

§

DccCommandStationStatus = 227

Command Station status report.

Sent by the command station in response to RSTAT.

§Opcode: STAT

§Priority: Normal

§Services: DCC_CAB or DCC_CMD

§Parameters: NN (2 bytes) Node number, CSnum (1 byte) For future expansion -set to zero at present, Flags (1 byte), Major rev (1 bytes) Major revision number, Minor rev (1 bytes) Minor revision letter, Build no (1 bytes) Build number.

§Conditions:

§Direction: From command station

§States / Modes:

§Result:

§

EventAck = 230

Event Acknowledge.

Sent by a module to acknowledge the consumption of an event. Used for diagnostic purposes.

§Opcode: ENACK

§Priority: Low

§Services: ENACK and Consumer

§Parameters: NN (2 bytes) Module’s Node Number, opcode (1 bytes), The opcode of the event being acknowledged, EventNNh (1 bytes), The high byte of the event’s NN, EventNNl (1 bytes), The low byte of the event’s NN, EventENh (1 bytes), The high byte of the event’s EN, EventENl (1 bytes), The low byte of the event’s EN

§Conditions: Module must be in event acknowledge mode. Module must have the specified defined as a consumed event. Sent in response to an event.

§Direction: From module

§States / Modes:

§Result:

§

ExtendedServiceDiscoveryResponse = 231

Extended service discovery response.

Detailed information about a service supported by a module. The data supplied is service specific. Sent in response to RQSD with ServiceIndex is not zero. A single ESD

§Opcode: ESD

§Priority: Low

§Services: MNS

§Parameters: NN (2 bytes) Node number, ServiceIndex (1 bytes) Index into the list of services ServiceType (1 bytes) Service Type, Data1 (1 bytes) Service specific data, Data2 (1 bytes) Service specific data, Data3 (1 bytes) Service specific data,

§Conditions: zero.

§Direction: From module

§States / Modes:

§Result:

§

StreamPacket = 233

Streaming protocol (RFC0005).

Used to transport a relatively large block of data. StreamID is a unique layout wide identifier of a particular message stream. It is the responsibility of the layout installer/module installer to ensure that any StreamIDs are unique across the installation. StreamIDs 0~20 are reserved as CBUS system wide IDs. Users would not allocate these IDs to private streams. SequenceNum is a 0x00 to 0xFF identification of the frame sequence . 0x00 is used to denote a header frame , any number != 0x00 indicates a continuation frame. MessageLen is a 16 bit size in bytes of the transmitted message , However as only 254 continuation frames are possible the Message Len is limited to a count of 1275. However private protocols may be deployed to send larger messages and the full extent of these fields can be used. A Message length of Zero is supported, albeit rather pointless. 16 15 2 CRC16 is a standard implementation of CRC, ie P(x) = x +x +x +1. CRC fields are optional and set to 0x00 if not implemented. Continuation frames merely contain the StreamID and SequenceNum and 5 bytes of message data It is recommended that continuation frames are throttled at 1 over 20ms.

§Opcode: DTXC

§Priority: Low

§Services:

§Parameters:

§Conditions:

§Direction:

§States / Modes:

§Result:

§

NodeParametersReport = 239

Response to request for node parameters.

Returns the first 7 parameters for the module in response to RQNP.

§Opcode: PARAMS

§Priority: Low

§Services: MNS

§Parameters: PARA 1 (1 bytes) Parameter 1, PARA 2 (1 bytes) Parameter 2, PARA 3 (1 bytes) Parameter 3, PARA 4 (1 bytes) Parameter 4, PARA 5 (1 bytes) Parameter 5, PARA 6 (1 bytes) Parameter 6, PARA 7 (1 bytes) Parameter 7

§Conditions: Sent in response to RQNP.

§Direction: From module

§States / Modes:

§Result:

§

LongEventAccessoryOn3 = 240

Accessory ON.

Indicates an ‘ON’ event using the full event number of 4 bytes with three additional data bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ACON3

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2, data3 (1 bytes) Event data 3

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event then perform the actions associated with the ON event.

§

LongEventAccessoryOff3 = 241

Accessory OFF.

Indicates an ‘OFF’ event using the full event number of 4 bytes with three additional data bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ACOF3

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2, data3 (1 bytes) Event data 3

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state OFF then send this event. If the module has been configured to consume the event then perform the actions associated with the OFF event.

§

LearnedEventResponse = 242

Response to request to read node events.

This is a response to either NERD or NENRD.

§Opcode: ENRSP

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Node number, EN3 (1 bytes) Event Node number hi, EN2 (1 bytes) Event Node number lo, EN1 (1 bytes) Event number hi, EN0 (1 bytes) Event number lo, EN# (1 bytes) Event index.

§Conditions: Sent in response to a request to read events.

§Direction: From module

§States / Modes:

§Result:

§

LongEventAccessoryStateOn3 = 243

Accessory Response Event.

Indicates an ‘ON’ response event with three added data bytes. A response is a reply to a status request (AREQ) without producing an

§Opcode: ARON3

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2, data3 (1 bytes) Event data 3

§Conditions: The module has the event defined and the current state of the event is ON.

§Direction: From module

§States / Modes:

§Result:

§

LongEventAccessoryStateOff3 = 244

Accessory Response Event.

Indicates an ‘OFF’ response event with three added data bytes. A response is a reply to a status request (AREQ) without producing an

§Opcode: AROF3

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2, data3 (1 bytes) Event data 3

§Conditions: The module has the event defined and the current state of the event is OFF.

§Direction: From module

§States / Modes:

§Result:

§

TeachEventByIndex = 245

Teach an event in learn mode using event indexing.

Sent by a configuration tool to a node in learn mode to teach it an event. The event index must be known. Also teaches it the associated event variables (EVs). This command is repeated for each EV required. Parameter EN# is ignored and this request is similar to EVLRN.

§Opcode: EVLRNI

§Priority: Low

§Services: Teach

§Parameters: NN (2 bytes) Event Node number, EN (2 bytes) Event number, EN# (1 bytes) Event index, EV# (1 bytes) Event variable index, EV val (1 bytes) Event variable value

§Conditions: message. If the event variable index is greater than the number of EVs per event parameter then send a CMDERR(Invalid Event Variable Index)

§Direction: To module

§States / Modes:

§Result: If conditions are met then Save the EV and send a WRACK message.

§

DataEventAccessory = 246

Accessory node data event.

Indicates an event from this node with 5 bytes of data. For example, this can be used to send the 40 bits of an RFID tag. There is no event number in order to allow space for 5 bytes of data in the packet, so there can only be one data event per node. The meaning of the event is therefore dependent upon the type and use of the module.

§Opcode: ACDAT

§Priority: Low

§Services:

§Parameters: NN (2 bytes) Node number, data 1 (1 bytes), data 2 (1 bytes), data 3 (1 bytes), data 4 (1 bytes), data 5 (1 bytes)

§Conditions: Sent to indicate an accessory event for this module.

§Direction: From module

§States / Modes:

§Result:

§

NodeDataEventResponse = 247

Accessory node data Response.

Indicates a node data response. A response event is a reply to a status request (RQDAT) without producing a new data event.

§Opcode: ARDAT

§Priority: Low

§Services:

§Parameters: NN (2 bytes) Node number, data 1 (1 bytes), data 2 (1 bytes), data 3 (1 bytes), data 4 (1 bytes), data 5 (1 bytes)

§Conditions:

§Direction: From module

§States / Modes:

§Result: Sent in response to a RQDAT message.

§

ShortEventAccessoryOn3 = 248

Accessory Short ON.

Indicates an ‘ON’ event using the short event number of 2 LS bytes with three added data bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The NN is not used to match events, the NN normally indicates the source of the event. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ASON3

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2, data3 (1 bytes) Event data 3

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state ON then send this event. If the module has been configured to consume the event (ignoring the NN) then perform the actions associated with the ON event.

§

ShortEventAccessoryOff3 = 249

Accessory Short OFF.

Indicates an ‘OFF’ event using the short event number of 2 LS bytes with three added data bytes. An event is sent by a module when it detects a change of state. Modules may consume the event and perform actions. The NN is not used to match events, the NN normally indicates the source of the event. The meaning of the additional data is dependent upon the application and must be agreed between the producer and consumer of the event.

§Opcode: ASOF3

§Priority: Low

§Services: Producer or Consumer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2, data3 (1 bytes) Event data 3

§Conditions: If the module has not been taught the event nor has the event by default then the event message is ignored.

§Direction:

§States / Modes:

§Result: If the module has the event configured to be sent when there is a change of state and that object changes to state OFF then send this event. If the module has been configured to consume the event (ignoring the NN) then perform the actions associated with the OFF event.

§

DeviceDataEventShortMode = 250

Device data event (short mode).

Function is the same as ACDAT but uses device addressing so it can

§Opcode: DDES

§Priority: Low

§Services:

§Parameters: DN (2 bytes) Device number, data 1 (1 bytes), data 2 (1 bytes), data 3 (1 bytes), data 4 (1 bytes), data 5 (1 bytes)

§Conditions: Sent to indicate a device event for this module.

§Direction: From module

§States / Modes:

§Result:

§

DeviceDataResponseShortMode = 251

Device data response (short mode).

The response to a RQDDS request for data from a device.

§Opcode: DDRS

§Priority: Low

§Services:

§Parameters: DN (2 bytes) Device number, data 1 (1 bytes), data 2 (1 bytes), data 3 (1 bytes), data 4 (1 bytes), data 5 (1 bytes)

§Conditions: Sent in response to a RQDDS request.

§Direction: From module

§States / Modes:

§Result:

§

WriteData = 252

Write data.

Used to write data to a device such as a RFID tag. data1 ~ data5 is data to be written to the device. RC522 devices should have data1 set to 0

§Opcode: DDWS

§Priority: Low

§Services:

§Parameters: DN (2 bytes) Device number, data 1 (1 bytes) data to be written to device, data 2 (1 bytes) data to be written to device, data 3 (1 bytes) data to be written to device, data 4 (1 bytes) data to be written to device, data 5 (1 bytes) data to be written to device

§Conditions:

§Direction: To module

§States / Modes:

§Result:

§

ShortEventAccessoryStateOn3 = 253

Accessory Short Response Event.

Indicates an ‘ON’ response event with three added data bytes.A response is a reply to a status request (ASRQ)without producing an ON

§Opcode: ARSON3

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2, data3 (1 bytes) Event data 3

§Conditions: The module has the event defined and the current state of the event is ON.

§Direction: From module

§States / Modes:

§Result:

§

ShortEventAccessoryStateOff3 = 254

Accessory Short Response Event.

Indicates an ‘OFF’ response event with three added data bytes.A response is a reply to a status request (ASRQ) without producing an

§Opcode: ARSOF3

§Priority: Low

§Services: Producer

§Parameters: NN (2 bytes) Node number, EN (2 bytes) Event number, data1 (1 bytes) Event data 1, data2 (1 bytes) Event data 2, data3 (1 bytes) Event data 3

§Conditions: The module has the event defined and the current state of the event is OFF.

§Direction: From module

§States / Modes:

§Result:

§

ExtOpCode6 = 255

Extended opcode with 6 additional bytes.

Reserved to allow the 6 additional bytes range to be extended by a further 256 opcodes.

§Opcode: EXTC6

§Priority: Low

§Services:

§Parameters: Ext_OPC (1 bytes) Extended opcode, Data1 (1 bytes) Data2 (1 bytes) Data3 (1 bytes) Data4 (1 bytes) Data5 (1 bytes) Data6 (1 bytes)

§Conditions:

§Direction:

§States / Modes:

§Result:

Trait Implementations§

Source§

impl Clone for OpCode

Source§

fn clone(&self) -> OpCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OpCode

Source§

impl Debug for OpCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for OpCode

Source§

impl From<OpCode> for u8

Source§

fn from(enum_value: OpCode) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for OpCode

Source§

fn eq(&self, other: &OpCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for OpCode

Source§

impl TryFrom<u8> for OpCode

Source§

type Error = TryFromPrimitiveError<OpCode>

The type returned in the event of a conversion error.
Source§

fn try_from(number: u8) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for OpCode

Source§

impl UnsafeFromPrimitive for OpCode

Source§

type Primitive = u8

Source§

unsafe fn unchecked_transmute_from(number: Self::Primitive) -> Self

Transmutes into an enum from its primitive. Read more
Source§

unsafe fn from_unchecked(number: Self::Primitive) -> Self

👎Deprecated since 0.6.0:

Prefer to use unchecked_transmute_from, from_unchecked will be removed in a future release.

Transmutes into an enum from its primitive. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.