No announcement yet.

HRD Radio Control API

This topic is closed.
This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

  • HRD Radio Control API

    Since HRD's IP Server (not Remote Server) is a text-based protocol, its very simple to communicate with in many programming languages. You can enable the IP Server by going to [Tools > IP Server] in the main menu of HRD. You can establish a connection to the IP Server with a program like PuTTY or Telnet for testing these commands. is an advanced web front-end to the IP Server.

    Get Commands:

    'get context' used from now on to ensure we address the correct radio in HRD as HRD can be connected to more than one radio at the same time. Most requests start with [c] where c is the context of the radio.

    Example: [1] get frequency

    get id
    get version
    get context
    get logbookupdates
    [c] get frequency
    [c] get radio
    [c] get buttons
    [c] get dropdowns
    [c] get sliders
    [c] get button-select {Button}
    [c] get dropdown-list {Dropdown}
    [c] get dropdown-text {Dropdown}
    [c] get slider-range {Radio} {Slider}
    [c] get slider-pos {Radio} {Slider}
    [c] get user-active 30
    [c] get smeter-main
    [c] get smeter-main returns values (S4,65,255)
    data returned as (meter_reading,raw_value,max_value)

    Set Commands:
    Known set commands, below we explain them in full detail, here is a quick list and usage guide.
    VALUES returned by "get" commands ARE CASE-SENSITVE, make sure to have the same case as returned in the response!
    The commands themselves are not case sensitive.

    [c] set frequency-hz {freq-in-hertz}
    [c] set button-select {button} {value}
    [c] set dropdown {dropdown} {item} {key}
    [c] set slider-pos {radio} {slider} {value}
    Setting Frequency: (146525000 = 146.525Mhz)
    Frequency needs to be inputed as hertz.
    [c] set frequency-hz 146525000
    Setting Buttons: (0=off 1=on/switch)
    Blank spaces returned by "get buttons" need to be converted to ~ char before used in any set commands.
    [c] get buttons
    A / B,NB,Proc,VOX,Scan,BK,DNR,DNF,DBF,AGC,Split,Lock
    [c] get button-select Proc
    [c] set button-select Proc 0
    [c] get button-select A~/~B
    [c] set button-select A~/~B 1
    Setting Dropdowns: (returned for FT-2000 Demo)
    Blank spaces returned by "get dropdowns" need to be converted to ~ char before used in any set commands. Any dropdown returned by "get dropdowns" needs to be encapsulated into { } chars when "get dropdown-list" or "get dropdown-text" is called, do not convert white spaces to ~ char, as this is only needed when using the "set dropdown" command.

    Note the order of the dropdown list returned and the key used in the set dropdown command!

    [c] get dropdowns
    Main Mode,Sub Mode,CW Keying,Mode Key,Receiver
    [c] get dropdown-text {Main Mode}
    Main Mode: LSB
    [c] get dropdown-list {Main Mode}
    [c] set dropdown Main~Mode LSB 0
    [c] set dropdown Main~Mode USB 1
    [c] set dropdown Main~Mode CW 2
    [c] set dropdown Main~Mode FM 3
    [c] set dropdown Main~Mode AM 4

  • #2

    Connect to HRD

    Connect to the HRD User Interface (not remote server), default port is 7809. Use TCP/IP, not UDP.
    • All requests and replies are terminated by \n (in hex 0x0A).
    • Requests are case-insensitive.
    • This is a text-based protocol.
    Current Radio

    Once you have connected you must ask HRD about the current radio. HRD supports many simultaneous radio connections, for example HRD could be controlling a TS-480SAT and TS-2000 at the same time. The current radio is the the visible radio.
    Get Frequency Frequency in Hz, for example 14070150
    Get Radio Current radio, for example TS-2000
    Get Context An internal context used by HRD to identify this radio connection, used in subsequent commands
    Get LogbookUpdates Number of logbook updates since HRD started.


    Note - context used from now on to ensure DM780 uses the same radio connection in HRD as HRD can be connected to more than one radio at the same time. All requests start [c] where c is the context number.
    Get Status
    [c] Get Frequency Returns frequency in Hz
    [c] Get Radio Checks whether connection still established
    [c] Get dropdown-list XXX XXX is a dropdown button, for example Mode Comma-separated list of dropdown entries
    [c] Get slider-range RADIO XXX RADIO is as returned above and XXX is title of slider, for example TS-2000 AF Returns minpos,maxpos
    [c] Get User-Active XXX XXX is time in milliseconds Returns 1 if the user has moved the mouse or pressed the keyboard in the last XXX milliseconds
    [c] Get Button-Select XXX XXX is button title Returns 1 if button is selected (highlighted), otherwise 0
    [c] Get Dropdown-Text XXX XXX is the title of the dropdown button, for example Mode Returns current selection (if any)
    [c] Get SMeter-Main Returns main S-Meter, some radios have two S-Meters (for example TS-2000) Returns max,raw,text where:
    • max = maximum numeric value,
    • raw = current numeric value,
    • text = current text value - e.g., S9
    [c] Get slider-pos RADIO XXX RADIO is as returned above and XXX is title of slider Returns current numeric position
    Last edited by W4PC; 11-05-15, 13:59.