Macros

Macros are short text statements that contain imbedded references to text data used by the program fldigi.   Macro definition files(s) are located in the $HOME/.fldigi/macros/ directory and all have the extention ".mdf".  The default set of macros are contained in the file $HOME/.fldigi/macros/macros.mdf.  Fldigi will create this file with a set of default macros on its first execution.

Fldigi supports up to 48 macro definitions in sets of 12.  Macro definitions are not recursive, that is; a macro cannot reference another macro or itself.

The imbedded references are similar to those used by DigiPan and other fine modem programs.  The imbedded reference is an uppercase plain text descriptor contained with the <> brackets.

Reference definitions:

<MYCALL>  my call   <CALL> remote call
<LDT>  local date time Zone
format : %x %H:%M%Z 
  • %x is preferred short form date ie: MM/DD/YY or DD/MM/YYYY etc for your locale
  • %H is hour with leading 0
  • %M is minute with leading 0
  • %Z is abbreviated time zone ie: EDT or GMT
<ZDT>  GMT date time Zone
format : %x %H:%M %Z
  • %x is preferred short form date ie: MM/DD/YY or DD/MM/YYYY etc for your locale
  • %H is hour with leading 0
  • %M is minute with leading 0
  • %Z is abbreviated time zone ie: EDT or GMT
<QSOTIME> current log time in Zulu HHMM format
<FREQ> my frequency
<ID>  send waterfall video mode identifier
<TEXT> send user specified video text
<CWID> send AFCW "DE <MYCALL>" at end of transmission
<MYLOC>  my locator <LOC>  remote locator
<MODE>  my mode
<MYNAME>  my name  <NAME>  remote name
<MYQTH>  my qth   <QTH>  remote qth
<RX>  return to receive <TX> start transmit
<MYRST>  my RST <RST>  remote RST
<CNTR> insert current contest serial number into the text stream
<INCR> increment contest serial number
<DECR> decrement contest serial number
<XOUT> contest exchange 
<INFO1> append the current data in the 1st status field; s/n for BPSK
<INFO2> append the current data in the 2nd status field; imd for BPSK
<MODEM>name  cause program to change operating mode to named mode. Use the shorthand names that are in the pick list.
<LOG>  submit QSO data to logbook program & clear the QSO data fields.  This macro reference is not constrained to a particular position in the macro.  The macro reference action takes place when macro is expanded, so effect is seen immediately after pressing the macro function key which contains this macro reference.
<IDLE:NN> causes fldigi to transmit an idle signal for NN seconds
<TIMER:NN> auto repeat this macro after NN seconds
<WPM:nn> CW words per minute = nn<PRE:dd.dd> QSK pre-timing = dd.dd msec
<RISE:dd.dd> CW pulse risetime = dd.dd msec<POST:+/-dd.dd> QSK post-timing = dd.dd msec
<FILE:[fname]> select this from the tag list; a file selection dialog opens for you to choose the file.  Select your file to be inserted with this macro.  The tag definition will be completed with the fully qualified filename inserted into the macro definition as in:
    <FILE:/home/dave/.fldigi/mybrag.txt>
The specified file will be opened and the text inserted into the Tx buffer when this macro is executed.
<MACRO:[fname]> select this from the tag list; a file selection dialog opens for you to choose the file.  Select your macro file to be inserted with this macro.  The tag definition will be completed with the fully qualified filename inserted into the macro definition as in:
    <MACROS:/home/dave/.fldigi/macros/testmacros.mdf>
The new set of macros will be opened and replace the current one when this macro is executed.

Local references are specified during the program configuration and can be changed during program operation.

Remote references are all part of the qso log field definitions and are routinely changed from contact to contact.

Global references are for items like Greenwich Mean Time.

The macros.mdf file can be edited with any ascii text editor such as kedit, gedit, geany, nano etc.  But it is much easier to use the built-in macro editor provided in the program.

Right click on any macro key (or the alternate set) and a macro editing dialog opens with the current copy of that macro and its label.  This looks very similar to the DigiPan macro editor at the urging of Skip Teller, KH6TY.



The Text box is a mini-editor with a very limited set of control functions.  You can mark, bound and select text for deletion (ctrl-X), copy (ctrl-C), and paste (ctrl-V).  Marked text can also be deleted with the delete or the backspace keys.  Marked text modification can also be invoked by using the mouse right click after highlighting.  

The macro reference in the pick list can be transfered to the current editing cursor location.  Highlight the desired macro reference and then press the double << arrow key for each occurance of the reference to be put into the macro text.  You can change the label name but any more than 8 characters may exceed the width of the button for the default sized main dialog.

The <TIMER:NN> and <IDLE:NN> macro tags should have the NN replaced with the time interval in seconds.

<TX><IDLE:5>CQ CQ de <MYCALL> <MYCALL> k<RX><TIMER:20>
The label associated with each macro key can be individually annotated with a symbol.  Here are the symbols that are recognized by the button label drawing routine:


The @ sign may also be followed by the following optional "formatting" characters, in this order:

Thus, to show a very large arrow pointing downward you would use the label string "@+92->".

Here are my macro buttons suitably annotated:



There are 4 sets of 12 macro functions.  You can move between the 4 sets using the keyboard and the mouse.
  1. Left click on the "1" button to move to set #2.  Right click on the "1" button to move to set #4.
  2. Move the mouse to anywhere on the macro buttons.  Use the scroll wheel to move forward  & backward through the macro sets
  3. Press the Alt-1, Alt-2, Alt-3 or Alt-4 to immediately change to that macro set.

You could use any label that is symbolic to the function required. Refer to the FLTK web site for a full list of label types.

If you modify the macros and do not save them ("Files/Save Macros" on the main window) fldigi will prompt you to save the macros when you exit the program if you have the "Nag me" option selected.

The <EXEC>...</EXEC> macro tag provides a way to create external shell scripts and programs that can interact with fldigi.  See Exec Macro to learn more about the <EXEC> macro tag.

Contents