Here is my code
require ("radio")
dataref("TRANSPONDER_MODE","sim/cockpit/radios/transponder_mode","writable")
function transponder_test_mode()
if button((6*160) + 31) ==True then
TRANSPONDER_MODE = 3
XPLMSpeakString("Transponder set to off")
end
end
do_every_frame( "transponder_test_mode ()" )
function transponder_standby_mode()
if button((6*160) + 30) ==True then
TRANSPONDER_MODE = 1
XPLMSpeakString("Transponder set to standby")
end
end
do_every_frame( "transponder_standby_mode ()" )
function transponder_alt_mode()
if button((6*160) + 29) ==True then
TRANSPONDER_MODE = 2
XPLMSpeakString("Transponder set to active")
end
end
do_every_frame( "transponder_alt_mode ()" )
function transponder_ground_off_mode()
if button((6*160) + 28) ==True then
TRANSPONDER_MODE = 0
XPLMSpeakString("Transponder set to ground")
end
end
do_every_frame( "transponder_ground_off_mode ()" )