|
So I'm writing my own little rig control / configuration utility for the KX3. But had a question on the DS command.
The programmer's reference manual states this about the text data: "TEXT and decimal point data: This field contains 8 bytes, with values 0x30 - 0xFF (hex). The first byte is the left-most displayed character. Bit 7 (MSB) of each byte indicates whether the decimal point to the left of each character is on (1) or off (0)." But the responses I'm seeing from the KX3 don't appear to follow this layout. Given an active frequency of 1.200.325 the response is: DS@1\xB200\xB325\x80\x90; The appears to be the active frequency in plain text, replacing spaces with @'s and .'s with \xB, only the last two entries for icon data and extended data are 8-bit bytes expressed in hex. In this case only my ATU icon was on, so the first one only has bit 7 on, and the second one has bit 7 and bit 4 on. Given how those last two bytes are expressed and the text in the programmers reference, I'd expect the frequency to be 8 bytes (8 bits each) expressed in hex like: DS@\x01\x82\x00\x00\x83\x02\x05 (except for the space being a @ at the beginning) Has the output changed since the last revision of the manual, or am I just reading it wrong? I'm using Revision E11 dated Oct 24, 2013 of the reference. The only real issue I'm having with the actual output it is that I'm using Python, and it considers '\xB' to be an escape sequence for superscript. I'm on a quest to find a solution to prevent python from interpreting that response from the kx3. Currently I just poll the frequency directly with the IF command. Second question, It's not documented in the reference, but is there any way to grab the complete configuration of the KX3 without manually setting the menu to an item (MN) then polling it's contents (MP)? I assume there is since the official KX3 utility appears to be able to grab the complete config without having to manually go through the menus. Just not sure if this is exposed to regular people over the serial port, or only something the official utility can do. -Dave ______________________________________________________________ Elecraft mailing list Home: http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/mmfaq.htm Post: mailto:[hidden email] This list hosted by: http://www.qsl.net Please help support this email list: http://www.qsl.net/donate.html Message delivered to [hidden email] |
|
David Patino asks:
> But the responses I'm seeing from > the KX3 don't appear to follow this > layout. Given an active frequency of > 1.200.325 the response is: > > DS@1\xB200\xB325\x80\x90; > > The appears to be the active > frequency in plain text, replacing > spaces with @'s and .'s with \xB, > only the last two entries for icon > data and extended data are 8-bit > bytes expressed in hex. It looks like the digits are in plain ASCII, as suggested by the note that the minimum value is 0x30 (the ASCII code for "0"). The digits with a decimal point to their left are encoded as ASCII+0x80, so for example ".2" appears as "0xB2" because 0x32+0x80=0xB2. This would be clearer if each byte of the response is presented on its own line: D S @ 1 \xB2 0 0 \xB3 2 5 \x80 \x90 ; Hope this helps, -- Bill, AB1AV ______________________________________________________________ Elecraft mailing list Home: http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/mmfaq.htm Post: mailto:[hidden email] This list hosted by: http://www.qsl.net Please help support this email list: http://www.qsl.net/donate.html Message delivered to [hidden email] |
|
I've found a solution with python... The problem was getting it to not interpret '\xB2' as an escape sequence, so I just re-encode it with string escapes, then do a string replacement:
>>> source = 'DS@1\xB200\xB325\x80\x90' >>> source2 = source.encode('string-escape').replace(r'\xb', '.') >>> freq = source2[2:12].replace('@','').zfill(10) >>> freq '01.200.325' Thanks for all the replies! -Dave -----Original Message----- From: "Bill Noyce" <[hidden email]> Sent: Friday, May 16, 2014 1:18pm To: [hidden email] Subject: Re: [Elecraft] Programmers Reference Questions David Patino asks: > But the responses I'm seeing from > the KX3 don't appear to follow this > layout. Given an active frequency of > 1.200.325 the response is: > > DS@1\xB200\xB325\x80\x90; > > The appears to be the active > frequency in plain text, replacing > spaces with @'s and .'s with \xB, > only the last two entries for icon > data and extended data are 8-bit > bytes expressed in hex. It looks like the digits are in plain ASCII, as suggested by the note that the minimum value is 0x30 (the ASCII code for "0"). The digits with a decimal point to their left are encoded as ASCII+0x80, so for example ".2" appears as "0xB2" because 0x32+0x80=0xB2. This would be clearer if each byte of the response is presented on its own line: D S @ 1 \xB2 0 0 \xB3 2 5 \x80 \x90 ; Hope this helps, -- Bill, AB1AV ______________________________________________________________ Elecraft mailing list Home: http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/mmfaq.htm Post: mailto:[hidden email] This list hosted by: http://www.qsl.net Please help support this email list: http://www.qsl.net/donate.html Message delivered to [hidden email] ______________________________________________________________ Elecraft mailing list Home: http://mailman.qth.net/mailman/listinfo/elecraft Help: http://mailman.qth.net/mmfaq.htm Post: mailto:[hidden email] This list hosted by: http://www.qsl.net Please help support this email list: http://www.qsl.net/donate.html Message delivered to [hidden email] |
| Free forum by Nabble | Edit this page |
