Great great grandfather William Thomas, in his handwritten autobiography of 1926, refers to his time on the railways in Wales in the early 1870s, and using the “Spagoletti speaking instrument.”
This turns out to be a form of the Single Needle Instrument developed by Charles Ernest Spagnoletti. I’ve found details of this at Sam Hallas’ page at http://www.samhallas.co.uk/railway/single_needle.htm. He gives an explanation and diagram of the code, which is a representation of morse code.
This confirms William’s recollection of the signalling code he learned as a youth.