<div class="gmail_quote">On Sat, Nov 20, 2010 at 1:21 AM, Oliver Grossmann <span dir="ltr"><<a href="mailto:oliver.grossmann@bretzi.de">oliver.grossmann@bretzi.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<tt>What do you mean by <br>
<br>
</tt><tt>"You cannot write a Lua script to read a response from the
radio"?</tt></blockquote><div><br>What I mean is that the Win-Test Lua API does not allow you to send your own CAT command and receive the response.  This is not a Lua limitation, this is a limitation of the Win-Test API.<br>

<br>The GetFreq API is there to let you read the radio frequency.  <br></div></div><br><div class="gmail_quote">On Sat, Nov 20, 2010 at 3:14 AM, Oliver Grossmann <span dir="ltr"><<a href="mailto:oliver.grossmann@bretzi.de">oliver.grossmann@bretzi.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


  

<div bgcolor="#ffffff" text="#000000"><tt>1) if I'm sending a command with wtRadio:Send(), will the answer be
captured by Win-Test?</tt></div></blockquote><div><br>No, whatever reply Win-Test gets from the radio, it cannot be forwarded to your Lua script due to internal Win-Test implementation restrictions.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div bgcolor="#ffffff" text="#000000"><tt> I tried RadioState = wtRadio:Send("IF;"), but it
wasn't possible to display the variable. <br></tt></div></blockquote><div><br>Correct, as I was saying, you cannot send your own CAT command to the radio and expect the answer to be returned.  You need to use the GetFreq API instead.<br>

 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div bgcolor="#ffffff" text="#000000"><tt>
2) To be able to use this also on a VFO on a different Band i changed
the script to:<br>
<br>
    -- Save current Active VFO frequency<br>
    local ActiveVFOfreq = wtRadio:GetFreq()<br>
<br>
    -- Work on <br>
    wtRadio:SetFreq( wtRadio:GetFreqInactiveVfo() )<br>
<br>
    -- Press Ctrl-Up to move active VFO to new freq<div class="im"><br>
    wtApp:SendKeyCode(294, WT_KEY_CTRL)<br>
<br>
    -- Set VFO B freq to current VFO A freq<br></div>
    wtRadio:SetFreqInactiveVfo( wtRadio:GetFreq() )<div class="im"><br>
<br>
    -- Restore original VFO A freq<br></div>
    wtRadio:SetFreq(ActiveVFOfreq)<br>
<br>
    -- No further keystrokes<br>
    return -1#<br>
<br>
For my understanding Set/Get FreqInactiveVfo should work on the non
active VFO, but for my TS-850, the commands were send always to VFO B,
even if active VFO is B (VFO B iy yellow in Bandmap).</tt></div></blockquote><div><br>Don't worry about active / inactive.  If you want to get/set the frequency of VFO B, just do:<br><br><span style="font-family: courier new,monospace;">VFOBfreq = wtRadio:GetFreq(WT_RADIO_VFOB)</span><span style="font-family: courier new,monospace;"><br>

<br style="font-family: courier new,monospace;">wtRadio:SetFreq(VFOBFreq, WT_RADIO_VFOB)<br><br><span style="font-family: arial,helvetica,sans-serif;">See <a href="http://download.win-test.com/v4/lua">http://download.win-test.com/v4/lua</a> for the complete Lua API documentation (Wiki has not been able to keep up).<br>

<br>I will be busy with a domestic contest this weekend and unable to response further until Monday.<br><br>73,</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">Bob, N6TV</span></span><br>

</div></div><br>