An airhorn, is a warning device used primarily on diesel locomotives, and also on electric locomotives Airhorns are often a single horn, or a combined set of horns known as "bells" on what is called a 'mani-fold', which supports a set of horns.
Sets of horns, like the Nathan K5LA, have bells which each pay a different note of sound, and are all combined together to form a unique "warning" sound to warn people of an approaching train. They are commonly used on North American, South American, and Austrailian locomotives, while single airhorns are commonly used on Asian, African, and European locomotives; as well as also being used on various cab cars, small diesel locomotives, and railroad/railway equipment.
Some newer diesel and electric locomotives even have "horn sequencer" buttons to make sounding the horn sequences easier.
When diesel locomotives were first produced during the 1930's in the North America, they were equipped with airhorns, and had to follow a series of horn sequences for stations, crossings, and certain movements. One example, would be "long, long, short, long", which is blown at railroad grade crossings where roads and railroads meet, and consists of having two long blasts of a horn, followed by a shorter blast, and finally a longer blast to fully alert the approach of an oncoming train.
Two blasts are also used for alerts, warnings, acceleration of trains, and the stopping of trains. Whistle sequences are similar, but involve more long toots or several short toots.
Horn Sequences are still in use as of today in the North America.
Horns have been on diesel and electric locomotives during the same time as they were used in North America. They are, however, almost rarely used unless necessary. Two short blasts of the horn, or horn-set, are used for signals, crossings, stations, stops, and small movements as well as warnings.
Because of how rural most roads are in Europe, horn sequences aren't necessary due to the low amounts of crossings and traffic.
Same as Europe, only with random sequences whenever necessary. (Warnings, dangers, etc.)
Horns are mainly, and most commonly used at stations and when a train has stopped or is beginning to accelerate.
Most railroads, governments, and trains have adopted or inherited a similar law or code involving the "Long, long, short, long" horn sequence.
Horn sequences are practically a combination of every known form, and are used like how they are in other places.