{"id":539,"date":"2011-08-24T14:09:54","date_gmt":"2011-08-24T14:09:54","guid":{"rendered":"http:\/\/www.raveon.com\/data_radio_info\/?p=539"},"modified":"2011-08-24T15:49:20","modified_gmt":"2011-08-24T15:49:20","slug":"using-a-macro-file-to-configure-a-data-radio-modem","status":"publish","type":"post","link":"https:\/\/www.raveon.com\/data_radio_info\/using-a-macro-file-to-configure-a-data-radio-modem-539\/","title":{"rendered":"Using a Macro File to Configure a Data Radio Modem"},"content":{"rendered":"<p><a href=\"http:\/\/www.raveon.com\/data_radio_info\/wp-content\/uploads\/2011\/08\/TT11.jpg\"><\/a><\/p>\n<p>The terminal emulation program Tara Term is an easy-to-use terminal emulator, similar in function to HyperTerminal or Procomm.\u00a0 But, Raveon finds it is easier to use, more reliable, and has better features.\u00a0 One of its new features is the ability to process a &#8220;Macro File&#8221;.\u00a0 It is a very handy program to communicate with a Raveon data radio modem, and\u00a0is a good way to automate the\u00a0configuing your radio modem.\u00a0<\/p>\n<p>Tera Term is an open-source terminal emulation program that is easy to use, and very powerful.\u00a0 Raveon recommends using it over Hyperterminal.\u00a0 Version 4.7 is currently available for download at logmett.com here: <a href=\"http:\/\/logmett.com\/index.php?\/download\/download-tera-term-470-freeware.html\">http:\/\/logmett.com\/index.php?\/download\/download-tera-term-470-freeware.html<\/a>\u00a0\u00a0 Tera Term\u00a0has a Macro FIle\u00a0script processor that allows a person to create\u00a0a script file of macro commands. The Script file can configure the radio modem, prompt the user for input, and validate the programming of the radio modem.<\/p>\n<p>Tera Term Macro files have an extension .TTL.\u00a0\u00a0 When in install Tera Term, the .TTL extension will be associated with Tera Term, so anytime you click on a .TTL file, the Tera Term maco processor should run it.\u00a0 If it does not, you can manually associate the &#8220;TLL&#8221; file as described below.\u00a0<\/p>\n<p>The macro File with the .TTL extension must be created before you can run it.\u00a0 Raveon may provide this for you, or you may create this yourself.\u00a0 Information about Tera Term&#8217;s Macro abilities is here:<a href=\"http:\/\/ttssh2.sourceforge.jp\/manual\/en\/macro\/\">http:\/\/ttssh2.sourceforge.jp\/manual\/en\/macro\/<\/a>\u00a0 although you may have to search the Internet for more details.\u00a0 A good way to understand it, is to study a macro file provided by Raveon.<\/p>\n<p>When you run a macro file, there will be at least two windows pop-up, and maybe three windows.\u00a0 The\u00a0largest window is the Tera Term program itself.\u00a0 As the macro runs, there will be a small window titled MACRO &#8211; xxxxx where xxxxx is the name of the macro file that is running.\u00a0 You can pause or end the macro execution by clicking on a button on this window.\u00a0<\/p>\n<p>At various plces in the macro file script, the user may be promoted to enter a paramter, or answer yes\/no to a question.\u00a0 A good practice at the end of the script is\u00a0have the macro script close Tera Term so another script may be started.<\/p>\n<p><a href=\"http:\/\/www.raveon.com\/data_radio_info\/wp-content\/uploads\/2011\/08\/TT11.jpg\"><img loading=\"lazy\" title=\"TT1\" src=\"http:\/\/www.raveon.com\/data_radio_info\/wp-content\/uploads\/2011\/08\/TT11.jpg\" alt=\"\" width=\"305\" height=\"295\" \/><\/a><\/p>\n<h2>How to associate &#8220;TTL&#8221; files with MACRO<\/h2>\n<p>Since Tera Term 4.59, you can associate &#8220;.TTL&#8221; files with MACRO with installer.\u00a0 To associate the file extension &#8220;.TTL&#8221; with MACRO, do the following steps.<\/p>\n<ol>\n<li>Execute the [View] Options command of Explorer.<\/li>\n<li>Select the &#8220;File Types&#8221; tab.<\/li>\n<li>Click the &#8220;New Type&#8221; button and specify items like the following.\n<pre>Description of type: Tera Term macro files Associated extension: TTL<\/pre>\n<\/li>\n<li>Click the &#8220;New&#8221; button and specify items like the following.\n<pre>Action: Execute Application used to perform action: \"C:\\Program Files\\teraterm\\ttpmacro.exe\" \"%1\" (If Tera Term Pro is installed in C:\\Program Files\\teraterm.)<\/pre>\n<\/li>\n<li>Close all the dialog boxes by clicking &#8220;OK&#8221; buttons.<\/li>\n<\/ol>\n<h2>Macro Example<\/h2>\n<p>Below is a simple example macro script to program a Raveon M7 radio modem.\u00a0<\/p>\n<pre><span style=\"color: #993366;\">CONNECT '\/C=1'\r\nSEND '+++'<\/span><\/pre>\n<pre><span style=\"color: #993366;\">:START\r\n;READ UNIT ID\r\nPAUSE 1\r\nSENDLN 'MYID'\r\nPAUSE 1<\/span><\/pre>\n<pre><span style=\"color: #993366;\">yesnobox 'CHANGE UNIT ID?' 'CHANGE UNIT ID?' <\/span><\/pre>\n<pre><span style=\"color: #993366;\">if result goto CHANGEID GOTO DESTINATION \r\n<\/span><span style=\"color: #993366;\">:CHANGEID \r\n<\/span><span style=\"color: #993366;\">;CHANGE UNIT ID \r\n<\/span><span style=\"color: #993366;\">inputbox 'ENTER UNIT ID' 'MYID' \r\n<\/span><span style=\"color: #993366;\">SENDLN 'MYID ' INPUTSTR<\/span><\/pre>\n<pre><span style=\"color: #993366;\">:DESTINATION \r\n<\/span><span style=\"color: #993366;\">;READ DESTINATION ID \r\n<\/span><span style=\"color: #993366;\">PAUSE 1 \r\n<\/span><span style=\"color: #993366;\">SENDLN 'TOID' \r\nPAUSE 1 \u00a0 \r\nyesnobox 'CHANGE DESTINATION ID?' 'CHANGE DESTINATION ID?' \r\nif result goto DESTID GOTO RXFREQ \r\n:DESTID \r\n;CHANGE DESTINATION ID \r\ninputbox 'ENTER DESTINATION ID' 'TOID' \r\nSENDLN 'TOID ' INPUTSTR<\/span><\/pre>\n<pre><span style=\"color: #993366;\">:RXFREQ\r\n;READ RX FREQ\r\nPAUSE 1\r\nSENDLN 'ATFR'\r\nPAUSE 1<\/span><\/pre>\n<pre><span style=\"color: #993366;\">yesnobox 'xxx.xxxx' 'CHANGE FREQUENCY?' \r\nif result goto SETFREQ GOTO ECHOSTEP \r\n:SETFREQ\r\n;CHANGE FREQUENCY \r\ninputbox 'ENTER FREQUENCY' 'ATFX' \r\nSEN<\/span><span style=\"color: #993366;\">DLN 'ATFX ' INPUTSTR<\/span><\/pre>\n<pre><span style=\"color: #993366;\">;SET ECHO ON \r\n:ECHOSTEP\r\n<\/span><span style=\"color: #993366;\">\r\n\r\n\r\n\r\nSENDLN 'ATE 1'<\/span>\r\n<pre><span style=\"color: #993366;\">;SET CARRIER DETECT TO SHOW ON-LINE STATUS (BASE AND REMOTE)\r\nSENDLN 'ATR1 2'\r\nPAUSE 1<\/span><\/pre>\n<pre><span style=\"color: #993366;\">;SET ON-LINE AFTER DIAL (DISABLED ON BASE ONLY)\r\nSENDLN 'ATCS 0'\r\nPAUSE 1<\/span><\/pre>\n<pre><span style=\"color: #993366;\">SENDLN 'SHOW'\r\nPAUSE 2<\/span><\/pre>\n<pre><span style=\"color: #993366;\">yesnobox '\"Y\"= FINISHED, \"N\"= RESTART' 'ALL PARAMETERS CORRECT?' \r\nif result goto CLOSE GOTO START<\/span><\/pre>\n<pre><span style=\"color: #993366;\">:CLOSE\r\ndisconnect 0 ;disconnect from teraterm, no confirmation\r\nclosett ;close tera term window\r\nEND<\/span><\/pre>\n<h1>\u00a0<\/h1>\n<h1>Tera Term Macro Language Information<\/h1>\n<p>Following is a quick overview of the Tera Term Macro Language. \u00a0<\/p>\n<h2>Identifiers and reserved words<\/h2>\n<h3>1) Variable identifiers<\/h3>\n<p>The first character must be an alphabetic (A-Z, a-z) or an underscore character \"_\". Subsequent characters can be alphabetic, underscore or numeric (0-9). Variable identifiers are not case sensitive. The maximum length is 32.<\/p>\n<pre>Example:\r\n    VARIABLE\r\n    _flag<\/pre>\n<h3>2) Label identifiers<\/h3>\n<p>Label identifiers consist of alphabetic, underscore or numeric characters, and are not case sensitive. The maximum length is 32.<\/p>\n<pre>Example:\r\n    label1\r\n    100<\/pre>\n<h3>3) Reserved words<\/h3>\n<p>The following words are reserved:<\/p>\n<pre>[Command] bplusrecv, bplussend, changedir... (see the <a href=\"http:\/\/ttssh2.sourceforge.jp\/manual\/en\/macro\/command\/index.html\">command list<\/a>) [Operator] and, not, or, xor [System variable] groupmatchstr1, groupmatchstr2, groupmatchstr3, groupmatchstr4, groupmatchstr5, groupmatchstr6, groupmatchstr7, groupmatchstr8, groupmatchstr9, inputstr, matchstr, param2, param3, param4, param5, param6, param7, param8, param9, result, timeout, mtimeout<\/pre>\n<h2>Line formats<\/h2>\n<p>There are four kinds of line formats for macro files. Any line can contain a comment which begins with a \";\" character. Also, a user can use the C language style comment(\/* - *\/).<br \/>\nComments give no effect on the execution of MACRO.<br \/>\nOne line can contain up to 500 characters. The part that exceeded 500 characters is ignored.<\/p>\n<h3>1) Empty lines<\/h3>\n<p>Lines which have no character or contain only space or tab characters or a comment. They give no effect on the execution of the macro.<\/p>\n<pre>Example:\r\n    ; Tera Term Language<\/pre>\n<pre>Example: showtt 0 MessageBox 'message 1' 'title 1' \/* This is 'comment' \"string\" *\/ MessageBox 'message 2' 'title 2' closett<\/pre>\n<h3>2) Command lines<\/h3>\n<p>Lines containing a single command with parameters.<\/p>\n<pre>Format: &lt;command&gt; &lt;parameter&gt; ... Example: connect'myhost' wait 'OK' 'ERROR' if result=2 goto error sendln 'cat' pause A*10 end<\/pre>\n<h3>3) Assignment lines<\/h3>\n<p>Lines which contain an assignment statement.<\/p>\n<pre>Format: &lt;Variable&gt; = &lt;Value (constant, variable, expression)&gt; Example: A = 33 B = C C must already have a value. VAL = I*(I+1) A=B=C The value of B=C (0 for false, 1 for true) is assigned to A. Error=0&lt;J Username='MYNAME'<\/pre>\n<h3>4) Label lines<\/h3>\n<p>Lines which begin with a ':' character followed by a label identifier.<\/p>\n<pre>Format:\r\n    :&lt;Label&gt;\r\n\r\nExample:\r\n    :dial\r\n    :100<\/pre>\n<h2>Communication commands<\/h2>\n<ul>\n<li>bplusrecv<\/li>\n<li>bplussend<\/li>\n<li>callmenu (version 4.56 or later)<\/li>\n<li>changedir<\/li>\n<li>clearscreen<\/li>\n<li>closett<\/li>\n<li>connect<\/li>\n<li>cygconnect (version 4.57 or later)<\/li>\n<li>disconnect<\/li>\n<li>dispstr (version 4.67 or later)<\/li>\n<li>enablekeyb<\/li>\n<li>flushrecv<\/li>\n<li>gethostname (version 4.61 or later)<\/li>\n<li>gettitle<\/li>\n<li>kmtfinish<\/li>\n<li>kmtget<\/li>\n<li>kmtrecv<\/li>\n<li>kmtsend<\/li>\n<li>loadkeymap<\/li>\n<li>logclose<\/li>\n<li>logopen<\/li>\n<li>logpause<\/li>\n<li>logstart<\/li>\n<li>logwrite<\/li>\n<li>quickvanrecv<\/li>\n<li>quickvansend<\/li>\n<li>recvln<\/li>\n<li>restoresetup<\/li>\n<li>scprecv (version 4.57 or later)<\/li>\n<li>scpsend (version 4.57 or later)<\/li>\n<li>send<\/li>\n<li>sendbreak<\/li>\n<li>sendbroadcast (version 4.62 or later)<\/li>\n<li>sendfile<\/li>\n<li>sendkcode<\/li>\n<li>sendln<\/li>\n<li>sendlnbroadcast (version 4.62 or later)<\/li>\n<li>sendmulticast (version 4.62 or later)<\/li>\n<li>setbaud (version 4.58 or later)<\/li>\n<li>setdebug (version 4.64 or later)<\/li>\n<li>setdtr (version 4.59 or later)<\/li>\n<li>setecho<\/li>\n<li>setmulticastname (version 4.62 or later)<\/li>\n<li>setrts (version 4.59 or later)<\/li>\n<li>setsync<\/li>\n<li>settitle<\/li>\n<li>showtt<\/li>\n<li>testlink<\/li>\n<li>unlink<\/li>\n<li>wait<\/li>\n<li>wait4all (version 4.63 or later)<\/li>\n<li>waitevent<\/li>\n<li>waitln<\/li>\n<li>waitn (version 4.62 or later)<\/li>\n<li>waitrecv<\/li>\n<li>waitregex (version 4.21 or later)<\/li>\n<li>xmodemrecv<\/li>\n<li>xmodemsend<\/li>\n<li>ymodemrecv (version 4.66 or later)<\/li>\n<li>ymodemsend (version 4.66 or later)<\/li>\n<li>zmodemrecv<\/li>\n<li>zmodemsend<\/li>\n<\/ul>\n<h2>Control commands<\/h2>\n<ul>\n<li>break (version 4.53 or later)<\/li>\n<li>call<\/li>\n<li>do, loop (version 4.56 or later)<\/li>\n<li>end<\/li>\n<li>execcmnd<\/li>\n<li>exit<\/li>\n<li>for, next<\/li>\n<li>goto<\/li>\n<li>if, then, elseif, else, endif<\/li>\n<li>include<\/li>\n<li>mpause (version 4.27 or later)<\/li>\n<li>pause<\/li>\n<li>return<\/li>\n<li>until, enduntil (version 4.56 or later)<\/li>\n<li>while, endwhile<\/li>\n<\/ul>\n<h2>String operation commands<\/h2>\n<ul>\n<li>code2str<\/li>\n<li>expandenv (version 4.71 or later)<\/li>\n<li>int2str<\/li>\n<li>sprintf (version 4.52 or later)<\/li>\n<li>sprintf2 (version 4.62 or later)<\/li>\n<li>str2code<\/li>\n<li>str2int<\/li>\n<li>strcompare<\/li>\n<li>strconcat<\/li>\n<li>strcopy<\/li>\n<li>strinsert (version 4.67 or later)<\/li>\n<li>strjoin (version 4.67 or later)<\/li>\n<li>strlen<\/li>\n<li>strmatch (version 4.59 or later)<\/li>\n<li>strremove (version 4.67 or later)<\/li>\n<li>strreplace (version 4.67 or later)<\/li>\n<li>strscan<\/li>\n<li>strspecial (version 4.67 or later)<\/li>\n<li>strsplit (version 4.67 or later)<\/li>\n<li>strtrim (version 4.67 or later)<\/li>\n<li>tolower (version 4.53 or later)<\/li>\n<li>toupper (version 4.53 or later)<\/li>\n<\/ul>\n<h2>File operation commands<\/h2>\n<ul>\n<li>basename (version 4.69 or later)<\/li>\n<li>dirname (version 4.69 or later)<\/li>\n<li>fileclose<\/li>\n<li>fileconcat<\/li>\n<li>filecopy<\/li>\n<li>filecreate<\/li>\n<li>filedelete<\/li>\n<li>filemarkptr<\/li>\n<li>fileopen<\/li>\n<li>filereadln<\/li>\n<li>fileread (version 4.48 or later)<\/li>\n<li>filerename<\/li>\n<li>filesearch<\/li>\n<li>fileseek<\/li>\n<li>fileseekback<\/li>\n<li>filestat (version 4.66 or later)<\/li>\n<li>filestrseek<\/li>\n<li>filestrseek2<\/li>\n<li>filetruncate (version 4.67 or later)<\/li>\n<li>filewrite<\/li>\n<li>filewriteln<\/li>\n<li>findfirst, findnext, findclose<\/li>\n<li>foldercreate (version 4.69 or later)<\/li>\n<li>folderdelete (version 4.69 or later)<\/li>\n<li>foldersearch (version 4.69 or later)<\/li>\n<li>getdir<\/li>\n<li>getfileattr (version 4.69 or later)<\/li>\n<li>makepath<\/li>\n<li>setdir<\/li>\n<li>setfileattr (version 4.69 or later)<\/li>\n<\/ul>\n<h2>Password commands<\/h2>\n<ul>\n<li>delpassword<\/li>\n<li>getpassword<\/li>\n<li>passwordbox<\/li>\n<\/ul>\n<h2>Miscellaneous commands<\/h2>\n<ul>\n<li>beep<\/li>\n<li>closesbox<\/li>\n<li>clipb2var (version 4.46 or later)<\/li>\n<li>crc32 (version 4.60 or later)<\/li>\n<li>crc32file (version 4.60 or later)<\/li>\n<li>exec<\/li>\n<li>filenamebox (version 4.54 or later)<\/li>\n<li>getdate<\/li>\n<li>getenv<\/li>\n<li>gettime<\/li>\n<li>getttdir (version 4.60 or later)<\/li>\n<li>getver (version 4.58 or later)<\/li>\n<li>ifdefined (version 4.46 or later)<\/li>\n<li>inputbox<\/li>\n<li>messagebox<\/li>\n<li>random (version 4.27 or later)<\/li>\n<li>rotateleft (version 4.54 or later)<\/li>\n<li>rotateright (version 4.54 or later)<\/li>\n<li>setdate<\/li>\n<li>setdlgpos<\/li>\n<li>setenv (version 4.54 or later)<\/li>\n<li>setexitcode<\/li>\n<li>settime<\/li>\n<li>show<\/li>\n<li>statusbox<\/li>\n<li>var2clipb (version 4.46 or later)<\/li>\n<li>yesnobox<\/li>\n<\/ul>\n<p>PAUSE 1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The terminal emulation program Tara Term is an easy-to-use terminal emulator, similar in function to HyperTerminal or Procomm.\u00a0 But, Raveon finds it is easier to use, more reliable, and has better features.\u00a0 One of its new features is the ability to process a &#8220;Macro File&#8221;.\u00a0 It is a very handy program to communicate with a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[47],"tags":[],"_links":{"self":[{"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/posts\/539"}],"collection":[{"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/comments?post=539"}],"version-history":[{"count":6,"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/posts\/539\/revisions"}],"predecessor-version":[{"id":546,"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/posts\/539\/revisions\/546"}],"wp:attachment":[{"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/media?parent=539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/categories?post=539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.raveon.com\/data_radio_info\/wp-json\/wp\/v2\/tags?post=539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}