Re: [Hamlib-developer] S-meter reading - flrig/IC-7300
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Black M. <mdb...@ya...> - 2024-12-04 20:48:30
|
Thanks...I put that in. Mike W9MDB On Wednesday, December 4, 2024 at 02:36:42 PM CST, Philip Rose <gm...@bt...> wrote: Hi Mike, rig.get_DBM returns the value in dB relative to 1mW. S9 is -73 dBm. I've patched flrig.c and this now works with the attached patch. Phil GM3ZZA On 04/12/2024 19:32, gm3zza via Hamlib-developer wrote: > Thanks, Mike. > > I saw the check-in and planned to git pull and recompile when I get the chance. > > Phil GM3ZZA > > On 4 December 2024, at 19:05, Black Michael <mdb...@ya...> wrote: > > > Just tested that and I was using rig.get_smeter -- changed it just now to rig_get_DBM and it matches much better now. > > If you aren't compiling from the git repo here's a new 64-bit DLL with the fix. > > https://www.dropbox.com/scl/fi/q0s2ykjhaz19j7sv84rf6/libhamlib-4.dll?rlkey=m02sjo5hqyfqgquhasdpptals&dl=0 > > Mike W9MDB > > > > > > > > On Wednesday, December 4, 2024 at 08:47:35 AM CST, Philip Rose via Hamlib-developer <ham...@li...> wrote: > > > > > > > > I have noticed a discrepancy when displaying the S-meter reading read from IC-7300 using flrig and hamlib. > > > > > I have looked at the code at each stage. > > The Icom CI-V has: > > Read S-meter level > *(0000=S0, 0120=S9, 0241=S9+60dB) > > Flrig converts this into percentage full-scale deflection (S9+60) (IC7300.cxx l. 1670): > > mtr = (int)ceil(mtr / 2.41); > > > > > and the display on flrig and the actual IC-7300, as far as I can tell, look pretty much the same. > > Hamlib seems to interpret this (flrig.c ll.2388+) as dB above S0. > > > > > case RIG_LEVEL_STRENGTH: > val->i = atoi(value) - 54; > //if (val->i > 0) val->i /= 10; > rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); > break; > > and converts this to dB above S9 per the comment in rig.h L. 1080. > > #define RIG_LEVEL_STRENGTH CONSTANT_64BIT_FLAG(30) /*!< \c STRENGTH -- Effective (calibrated) signal strength relative to S9, arg int (dB) */ > > > > > However its not - it's out by about 10%. > > > My app then interprets this per the hamlib definition, which seems to the only specified value and I display a version which is several dB lower then that displayed on the rig or on flrig. I couldn't find in the flrig documentation what rig.get_smeter should return. Looking at rig.get_Sunits and rig.get_DBM it looks like a value of 50 is S9, 100 is S9+60 and linearly interpolated over 0-50 and 50-100. > > > > > > I don't know if this is a general problem across all rigs. Is FSD on the flrig S-meter always S9+60? Or will it vary by rig? > > > > > It's not a major issue in the grand scheme of things. I was just curious why I seemed to be displaying a lower value than flrig was. It's not an accurate value anyway, just wondered why it was different. > > > > > 73 Phil GM3ZZA > > > > > > > > > > > > > > > > _______________________________________________ > Hamlib-developer mailing list > Ham...@li... > https://lists.sourceforge.net/lists/listinfo/hamlib-developer > > _______________________________________________ > Hamlib-developer mailing list > Ham...@li... > https://lists.sourceforge.net/lists/listinfo/hamlib-developer |