The Gun (actually a cannon) first appeared on appointments in 1833. It was first worn as a badge above the chevrons of Sergeants and above in 1856 and has remained so to this day.
Although Warrant Officer and NCOs of the Royal Artillery wore the same rank badges as the rest of the army, their function and relative appointments varied considerably.

The Warrant Officer rank, established in 1879, at first applied only to Conductors of stores and supplies. In 1881, Staff Sergeants class I, Master Gunners Class I and II, Brigade Sergeant-Majors and Quartermasters. (including Brigade Wheeler, Collarmaker and Farrier Sergeant-Majors) were raised to Warrant Rank. Although this new group adopted the Warrant Officer rank, they were not at the same level of Conductors.
As mentioned before Master Gunners Class 1 of Coast Brigades had been Warrant Officers since 1861.

Master Gunners Class I & II wear the Crown above the Gun on the right lower sleeve while the Master Gunner Class III simply wears the Gun.

Perhaps not to confuse the rank badges of Master Gunners with other WO ranks, The Brigade Sergeant-Majors and associated ranks wore four bar chevrons, points up, below the elbow. The Brigade Quartermaster had the 8 pointed star between the chevrons and the Gun.

Other appointments with this rank were, Farrier, Wheeler, Collarmaker-Majors.

One of the most impressive badges worn in the British Army was that of Assistant Instructor of Gunnery. The badge, adopted in 1864 consisted of crossed cannons above a flaming grenade, the whole surmounted by a crown. Above it was the Gun under the Crown. It was originally placed upon four bar chevrons above the elbow. In 1877 it was worn below the elbow and by 1883 it was worn on a three bar chevron above the elbow along with other instructors. This badge was worn un-revised until 1902.  

The Staff-Sergeant Riding Instructor also had a unique badge. The spur badge was worn by Rough-Riders in cavalry regiments and other corps heavily involving horses. In the Royal Artillery, discussion was based on whether the spur should have a long neck or short neck and also should it point upwards. The order came down that the neck should remain upwards and that, going forwards, the badge would be on a scarlet backing, alone among the RA trade badges.

Sergeant-Instructors of Physical training, musketry and other qualifications wore the badge above the gun and below the crown. The Battery Sergeant-Major badge dates from 1883. All Staff-Sergeants wore it also with trade appointment badges above the chevrons and below the Gun.
For Sergeants, the Gun was worn above the chevrons without Crowns. Lance-Sergeants, Corporals and Bombardiers did not wear crowns. Instruction badges were worn above the chevrons.
The Trade and qualification badges were worn on the lower left sleeve above the Good Conduct chevrons. All those shown were largely the same as in all regiments and corps entitled to wear them. The Gun Layer badge was unique to the Royal Artillery.
The most efficient gunner in each battery or Company was awarded a badge beginning in 1877.
Given in three classes, the first was crossed cannons with a shell in laurel leaves at the cross, the second was plain crossed cannons in gold bullion. The third was crossed cannons in yellow worsted.

In 1892 the badges were changed to a “G” within a wreath with the 3rd prize being worsted. The badges were altered slightly in 1894 and in 1898 with a crown and star above indicating 1st & 2nd prize respectively.
Driving skills were awarded in 1877 with crossed whips and spurs, changed in 1898 with a single whip and spur with the 1st Prize surmounted by a crown.  During the period, the design of the badge often varied slightly.
For the best Battery or Company a prize badge was awarded to every NCO and other rank in the unit. In 1892 it consisted of crossed cannons within a laurel wreath for 1st Prize with cannons in Gold bullion and worsted for 2nd and 3rd. * Please refer to the note on the individual Prize above

For the sake of modernisation, the badges were changed in 1898 to crossed guns, this time with crown and star for 1st and 2nd prize to conform with the trend in the army as a whole.
The last plate shows how the badges were worn on the tunic or jacket.