Structures

Logic Sorter

Updated 3/8/2026

Logic Sorter

Deconstruction Steps

StepToolRecovered Item
1Hand DrillKit (Sorter)

Not to be confused with Sorter.

Description

"Contains an Internal Memory which is assessed to check whether something should be sorted. When an item is in the Import slot Slot, the stack is checked and if result is true the thing is moved to the Export2 slot slot, otherwise it is moved to the Export slot slot. The Mode is used in how the stack is assessed, by default the mode is ALL, so every instruction in the stack would need to return true." — Stationpedia

Logic sorter is similar in almost every way to the previous sorter but has a internal memory that can be configured with logic and bit shifting to sort items passing through. When an item enters the import slot, it is checked against the filters in memory. If the Mode is 0(All) then every filter must return true for the item to be sent to the export 2 slot. If the mode is 1(Any) then as long as one of the filters returns true, the item matches and will be sent to the export 2 slot.

Filter Instructions

Check the in game Stationpedia [F1 on your keyboard] for formatting and instruction sizes to determine how to populate the memory. Be warned that the stationpedia fails to document the endianness (bit 0 is the least significant bit). While the stationpedia does document that the Logic Sorter has 256 bytes of memory, it is addressed as 32 x 8-byte (64-bit) numbers.

If you wish your sorter to send Steel Ingots to the second output you should place the value 0xd8f8af8d_01 ( = 931885190401 decimal ) into memory 0. More complicated programs will have to consider whether they want to use Mode 0 (match All), Mode 1 (match Any), or Mode 2 (match None).

It is more readable to calculate the instructions using IC10 like this:

alias sorter d0
define steel HASH("ItemSteelIngot")
s sorter Mode 1 # Any
clr sorter # erase any stale instructions in RAM
sll r0 steel 8
or r0 r0 SorterInstruction.FilterPrefabHashEquals
put sorter 0 r0
Sorter InstructionOP CodeDescription
FilterPrefabHashEquals1Compares Hash of item in import slot to the set hash and returns true if equal.
FilterPrefabHashNotEquals2Compares Hash of item in import slot to the set hash and returns true if not equal.
FilterSortingClassCompare3Compares the sorting class of an object in input slot. Example would be all ores.
FilterSlotTypeCompare4Compares the item type of an object in the input slot. See slot type table below for item comparisons.
FilterQuantityCompare5Compares the stack size of the items in the import slot.
LimitNextExecutionByCount6Ensures the next executable instruction will only return true a specified number of times. Each time it returns true, it decrements by one.
Conditional Operation (CONDOP)ValuePre-shifted
Equals00
Greater1256
Less2512
NotEquals3768
<pre> MSB LSB 6666555555555544444444443333333333222222222211111111110000000000 3210987654321098765432109876543210987654321098765432109876543210 FilterPrefabHashEquals 1. ( PREFAB_HASH)( 1) FilterPrefabHashNotEquals 1. ( PREFAB_HASH)( 2) FilterSortingClassCompare 1. ( SORTING_CLASS)(CONDOP)( 3) FilterSlotTypeCompare 1. ( SLOT_TYPE)(CONDOP)( 4) FilterQuantityCompare 1. ( QUANTITY)(CONDOP)( 5) LimitNextExecutionByCount 1. ( COUNT)( 6) </pre>

Data Network

ParameterTypeAccessDescription
PowerBooleanReadCan be read to return if the Logic Sorter is correctly powered or not, set via the power system, return 1 if powered and 0 if not
ModeIntegerRead/WriteThe mode of the Logic Sorter.
ErrorBooleanRead1 if device is in error state, otherwise 0
LockBooleanRead/WriteDisable manual operation of the Logic Sorter.
OnBooleanRead/WriteThe current state of the Logic Sorter.
RequiredPowerIntegerReadIdle operating power quantity, does not necessarily include extra demand power
ClearMemoryIntegerRead/Writer=0
ExportCountIntegerReadHow many items exported since last ClearMemory
ImportCountIntegerReadHow many items imported since last ClearMemory
PrefabHashIntegerReadThe hash of the structure
ReferenceIdIntegerReadUnique Reference Identifier for this object
NameHashIntegerReadProvides the hash value for the name of the object as a 32 bit integer.

Data Slots

These are all parameters, that can be read with a Slots Reader. The outputs are listed in the order a Slots Reader's "VAR" setting cycles through them. | Number || Name | Description | |---|---| | 0 | Import | | 1 | Export (reject) | | 2 | Export (accept) | | 3 | Data Disk |

NameData TypeDescription
MaxQuantityIntegerReturns maximum stacksize.
DamageIntegerItem durability in percent.
ClassIntegerItem class ID for slot type comparison.
SortingClassIntegerClass group of items.
QuantityIntegerSize of item stack.
PrefabHashIntegerReturns ItemHash of item in slot.
OccupiedBooleanReturns whether the slot occupied. (0 for no, 1 for yes).
OccupantHashIntegerReturns ItemHash of item in slot.

Item Slot Classes / Types

Reading the class attribute of the input slot will give one of the following values:

Note that you can use <pre style="display: inline">SlotClass.<Item></pre> directly in IC code instead of the numeric value

  • NOTE The classes listed in this section are FilterSlotTypeCompare and NOT sorting class. eg: SortingClass.Ores vs SlotClass.Ore
+ Item values and descriptionsItemValueDescriptionItemValueDescriptionItemValueDescription
None0Helmet1Suit2
Back3GasFilter4GasCanister5
Motherboard6Circuitboard7DataDisk8
Organ9Ore10Includes reagent mixes from recycler and icesPlant11
Uniform12Entity13Battery14
Egg15Belt16Tool17
Appliance18Ingot19Torpedo20
Cartridge21AccessCard22Magazine23
Circuit24Bottle25ProgrammableChip26
Glasses27CreditCard28DirtCanister29
SensorProcessingUnit30LiquidCanister31LiquidBottle32
Wreckage33SoundCartridge34DrillHead35
ScanningHead36Flare37Blocked38
SuitMod39Crate40Portables41