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: 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:
|