IS OCO

From LFS Manual
Jump to navigationJump to search

Introduction

The Object COntrol packet is used to control start lights, either the track's main start lights or layout objects such as AXO_START_LIGHTS1.

IS_OCO packet properties
Type Name Description
byte Size 8
byte Type ISP_OCO
byte ReqI 0
byte Zero
byte OCOAction see below
byte Index see below
byte Identifier identify particular start lights objects (0 to 63 or 255 = all)
byte Data see below

Packet Details

Size

The size of the packet is always 8 bytes.

Type

The packet type from the ISP_ enumeration, always ISP_OCO.

ReqI

ReqI is always equal to zero.

OCOAction

A value from the OCO_ enumeration:

  • OCO_LIGHTS_RESET: Give up control of all lights
  • OCO_LIGHTS_SET: Use the Data byte to set the lights
  • OCO_LIGHTS_UNSET: Give up control of the specified lights

Index

Specifies which object to control. The currently supported values are:

  • AXO_START_LIGHTS1 (149): Layout object
  • AXO_START_LIGHTS2 (150): Layout object
  • AXO_START_LIGHTS3 (151): Layout object
  • OCO_INDEX_MAIN (240): Main start lights

Identifier

This byte can be used to override a specific group of layout start lights, as set in the layout editor. All objects sharing the same Identifier are controlled simultaneously.

Data

Specifies which lights to turn on or off, depending on the controlled object Index:

Data byte details
Index Bit 0 (1) Bit 1 (2) Bit 2 (4) Bit 3 (8)
OCO_INDEX_MAIN red1 red2 red3 green
AXO_START_LIGHTS1 red amber - green
AXO_START_LIGHTS2 red amber - green
AXO_START_LIGHTS3 red - - green