Eli5 How do the controls in DCC train models know what to do


I understand that they are based on changing the frequency but how do you control which one moves the speed, which one plays a sound and how do they communicate between control and train?

In: 4

The control station does add data to the rail voltage. The data contains an address and an instruction, with the address specifically targeting one particular device in the model (train A, track switch x or whatever) and the instruction telling the decoder in that particular device what to do (speed up, turn lights on, play sound, …).

Each decoder in the system will only react if it sees a data packet addressed to it. The data is encoded onto the tracks, as you mentioned, by having pulses of different duration for ones and zeroes.