[WT-support] Script for getting next call in Bandmap

Bob Wilson, N6TV n6tv at arrl.net
Sat Nov 20 19:45:05 CET 2010


On Sat, Nov 20, 2010 at 1:21 AM, Oliver Grossmann <
oliver.grossmann at bretzi.de> wrote:

> What do you mean by
>
> "You cannot write a Lua script to read a response from the radio"?


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.

The GetFreq API is there to let you read the radio frequency.

On Sat, Nov 20, 2010 at 3:14 AM, Oliver Grossmann <
oliver.grossmann at bretzi.de> wrote:

> 1) if I'm sending a command with wtRadio:Send(), will the answer be
> captured by Win-Test?
>

No, whatever reply Win-Test gets from the radio, it cannot be forwarded to
your Lua script due to internal Win-Test implementation restrictions.


>  I tried RadioState = wtRadio:Send("IF;"), but it wasn't possible to
> display the variable.
>

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.


> 2) To be able to use this also on a VFO on a different Band i changed the
> script to:
>
>     -- Save current Active VFO frequency
>     local ActiveVFOfreq = wtRadio:GetFreq()
>
>     -- Work on
>     wtRadio:SetFreq( wtRadio:GetFreqInactiveVfo() )
>
>     -- Press Ctrl-Up to move active VFO to new freq
>
>     wtApp:SendKeyCode(294, WT_KEY_CTRL)
>
>     -- Set VFO B freq to current VFO A freq
>     wtRadio:SetFreqInactiveVfo( wtRadio:GetFreq() )
>
>
>     -- Restore original VFO A freq
>     wtRadio:SetFreq(ActiveVFOfreq)
>
>     -- No further keystrokes
>     return -1#
>
> 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).
>

Don't worry about active / inactive.  If you want to get/set the frequency
of VFO B, just do:

VFOBfreq = wtRadio:GetFreq(WT_RADIO_VFOB)

wtRadio:SetFreq(VFOBFreq, WT_RADIO_VFOB)

See http://download.win-test.com/v4/lua for the complete Lua API
documentation (Wiki has not been able to keep up).

I will be busy with a domestic contest this weekend and unable to response
further until Monday.

73,
Bob, N6TV
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.f5mzn.org/pipermail/support/attachments/20101120/7070aee3/attachment-0001.htm 


More information about the Support mailing list