¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: FLRIG 2.0.04 + TS590SG, Meters Display no SWR or ALC


Mike Black
 

Hamlib has this logic for the TS480 and TS590 models

? ? retval = sscanf(ackbuf, "RM1%d;RM2%d;RM3%d;", swr, comp, alc);

Mike W9MDB




On Wednesday, August 28, 2024 at 06:27:22 AM CDT, Dave <w1hkj@...> wrote:


Eric,

Your code looks fine.? Please be more precise on the three readings at once.? That seems to be an undocumented feature that we should support for the SG



David

P.S.? My replies are tardy as I am a newlywed trying to merge two houses of "stuff".? I am 85 and the bride is 77.? We have too much stuff.? Alabama only recognizes a civil wedding between consenting parties.? That is in place.? This Saturday there will be a church wedding with family attendance.? Next week will be our honeymoon.? I will try to respond before we depart.

On 8/22/24 12:59, Eric Hidle wrote:
I have gotten the SWR meter working and it has a reasonably-accurate scaling with a lookup table based on the rig scaling vs the scaling of the meter in flrig. Here's the code for the get_swr function that goes into TS590SG.cxx

int RIG_TS590SG::get_swr(void)
{
? ? ? ? int mtr = 0;
? ? ? ? cmd = "RM;";
? ? ? ? sendCommand(cmd);
? ? ? ? if (wait_char(';', 8, 100, "get SWR", ASC) < 8) return 0;

? ? ? ? sscanf(replystr.c_str(), "RM1%d", &mtr);

? ? ? ? if (( 1 <= mtr ) && ( mtr <= 6 ))
? ? ? ? {
? ? ? ? ? mtr = (mtr * 12) / 6;
? ? ? ? }
? ? ? ? else if (( 7 <= mtr ) && ( mtr <= 11 ))
? ? ? ? {
? ? ? ? ? mtr = (mtr * 25) / 11;
? ? ? ? }
? ? ? ? else if (( 12 <= mtr ) && ( mtr <= 15 ))
? ? ? ? {
? ? ? ? ? mtr = 25 + ((mtr - 12)*7);
? ? ? ? }
? ? ? ? else if ( mtr >= 16 )
? ? ? ? {
? ? ? ? ? mtr = (mtr * 100) / 30;
? ? ? ? }

? ? ? ? if (mtr > 100) mtr = 100;

? ? ? ? return mtr;
}

And the result:

image.png


My get_alc doesn't seem to work, and I think it has to do with the 590SG always returning all three meter readings on a single response line. SWR is the first of the three, which is why I think it works with this function. I'm not sure how to scan for the third response. ? ? ? ? sscanf(replystr.c_str(), "RM3%d", &alc_val); doesn't seem to pull it out.

Cheers
Eric

On Tue, 20 Aug 2024 at 10:09, Wayne Carpenter KN2Z @minicowman via <mwcarpe=[email protected]> wrote:

@Philip Rose and @Cliff? Thanks guys. Got the meter(s) turned off. I must have been goofing around with settings at some point and exited with meters showing. All better now.
?
Looking forward to seeing what Dave can do with coding for the sg..?
?
I learned a lot about 'sniffing' serial data back in prep time for Y2K. At least 'something' good came from all that effort. But given that those preps happened almost 25 years ago.. a lot of what I learned back then has gotten away from me. Proof positive, if you don't use it, you lose it.?
?
73 y'all

Join [email protected] to automatically receive all group messages.