[WT-support] Access to antenna controller from LUA-script

Bob Wilson, N6TV n6tv at arrl.net
Wed Dec 14 23:43:24 CET 2016


Win-Test includes the Lua version 5.1 interpreter, which supports decimal
escape sequences in string literals.  (Only Lua 5.2 and later supports hex
escape sequences.)

So to write the string TEST, preceded by SOH (1 decimal) and terminated by
ETX (3 decimal), you may simply code:

      device:write("\1TEST\3")

You may specify up to three decimal digits after the backslash, \0 to \255
(for 0x00 to 0xFF).  If you need a CR or LF, you may use \r or \n .

You may find this ASCII to decimal lookup table helpful:

https://courses.engr.illinois.edu/ece390/books/labmanual/
ascii-code-table.html


Attached is a much improved serial port script that runs the Windows MODE
command only once, instead of every time you run the script.  It also
accepts the COM port number 1-99 as an script argument so that you don't
have to answer a prompt for COM port number the first time you run it.

Win-Test reflector subscribers may not see the attachment, but there will
be a link to a "non-text attachment" in the reflector archives for this
month <http://lists.f5mzn.org/pipermail/support/2016-December/>, at the
bottom of this post, where you should be able to view and download it using
your browser.  During download, be sure to rename the file from
*attachment.obj* to *COM_Test.wts*.

73,
Bob, N6TV

On Wed, Dec 14, 2016 at 1:09 PM, <gt-i at gmx.net> wrote:

> Bob,
>
> thanks for sharing, this is what I was looking for. However, it does not
> seem to work with the antswitch and since it is a USB-VCOM port I cannot
> check externally. The protocol requires special bytes like SOH (0x01) and
> ETX (0x03) - maybe those will be filtered out somehow? Any idea how to make
> sure these characters will be sent out unchanged?
>
> 73
>
> Gernot, DF5RF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.f5mzn.org/pipermail/support/attachments/20161214/77166368/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: COM_Test.wts
Type: application/octet-stream
Size: 2276 bytes
Desc: not available
URL: <http://lists.f5mzn.org/pipermail/support/attachments/20161214/77166368/attachment.obj>


More information about the Support mailing list