Class NceShowCabPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, AbstractMRListener, NceListener, NcePanelInterface

public class NceShowCabPanel
extends NcePanel
implements NceListener
Frame to display NCE cabs

Note, NCE bit layout MSB = bit 7, LSB = bit 0.

From Jim Scorse at NCE:

Each cab has a 256 byte "context page" in system RAM These pages start at 0x8000 in system RAM with Cab 0 at 0x8800, cab 1 at 0x8900, Cab 2 at 0x8a00, etc.

Below is a list of offsets (in decimal) into the cab context page for useful memory locations.

For example if you want to know the current speed of cab address 2's currently selected loco look at memory location 0x8a00 + 32 dec (0x20). This will be address 0x8a20.


To determine if a cab is active (plugged in at any point this session) you will need to look at the byte "FLAGS1" (offset 101)

If bit 1 of FLAGS1 = 1 then the cab has been talked to at least once by the command station.

Bits 0 and 7 indicate the type of cab being use this session at this cab address

Bit 7,0 = 0,0 Procab or other cab with an LCD display (type A) Bit 7,0 = 0,1 Cab04 other cab without an LCD (type B) Bit 7,0 = 1,0 USB or similar device (type C) Bit 7,0 = 1,1 AIU or similar device (type D)


CAB_BASE EQU 0 ; LCD_TOP_LINE EQU 0 ;16 chars (in ASCII) for top line of LCD LCD_BOT_LINE EQU 16 ;16 chars (in ASCII) for bottom line of LCD

CURR_SPEED EQU 32 ;this cab's current speed ADDR_H EQU 33 ;loco address, high byte ADDR_L EQU 34 ;loco address, low byte FLAGS EQU 35 ;bit 0 - Do not use ;bit 1 - 1=128 speed mode, 0=28 speed mode ;bit 2 - 1=forward, 0=reverse ;bit 3 - Do not use ;bit 4 - Do not use ;bit 5 - Do not use ;bit 6 - Do not use ;bit 7 - 1=rear loco of consist is active address use reverse speeds

FUNCTION_L EQU 36 ;bit 0 = function 1, 1=on, 0=off ;bit 1 = function 2, 1=on, 0=off ;bit 2 = function 3, 1=on, 0=off ;bit 3 = function 4, 1=on, 0=off ;bit 4 = headlight, 1=on, 0=off

FUNCTION_H EQU 37 ;bit 0 = function 5, 1=on, 0=off ;bit 1 = function 6, 1=on, 0=off ;bit 2 = function 7, 1=on, 0=off ;bit 3 = function 8, 1=on, 0=off ;bit 4 = function 9, 1=on, 0=off ;bit 5 = function 10, 1=on, 0=off ;bit 6 = function 11, 1=on, 0=off ;bit 7 = function 12, 1=on, 0=off

ALIAS EQU 38 ;If loco is in consist this is the consist address


FUNC13_20 EQU 82 ;bit map of current functions (bit 0=F13) FUNC21_28 EQU 83 ;bit map of current functions (bit 0=F21)

ACC_AD_H EQU 90 ;current accessory address high byte ACC_AD_L EQU 91 ;current accessory address low byte

;lower nibble bit 0 =1 if setup advanced consist in process

FLAGS2 EQU 93 ;bit 0 = \ ;bit 1 = >Number of recalls for this cab ;bit 2 = / 1-6 valid ;bit 3 = 1=refresh LCD on ProCab ;bit 4 = Do not use ;bit 5 = Do not use ;bit 6 = Do not use ;bit 7 = Do not use

FLAGS1 EQU 101 ;bit0 - 0 = type a or type C cab, 1 = type b or type d ;bit1 - 0 = cab type not determined, 1 = it has ;bit2 - 0 = Do not use ;bit3 - 0 = Do not use ;bit4 - 0 = Do not use ;bit5 - 0 = Do not use ;bit6 - 0 = Do not use ;bit7 - 0 = type a or type b cab, 1=type c or d Writing zero to FLAGS1 will remove the cab from the 'active' list

See Also:
Serialized Form