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

gt-i at gmx.net gt-i at gmx.net
Fri Dec 16 01:15:20 CET 2016


Bob,
good hint. However, after playing quite a while, I'm pretty sure that 
io.write does not send anything out, instead it seems to write it to an 
internal buffer which I can check using :read(1). I tried :flush() and 
:setvbf("no") which did not cure this. I also played with variations of 
io.open(.."w", "r+") etc. I tested on a phyiscal COM-port with an 
Echo-plug (RX/TX, all Modemlines connected to each other), to a virtual 
one using com0com etc - no change.
Any other idea?
Tnx,

Gernot DF5RF


Am 14.12.2016 um 23:43 schrieb Bob Wilson, N6TV:
> 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
>     <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 <mailto: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
>



More information about the Support mailing list