SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
CAT via .NET SerialPort class
I am 99% there with a voice keyer app I'm experimenting with. I am having a problem getting the signal correct to CAT via a SerialPort.
I have a TX CAT configured for COM5 and I can connect to it just fine.
I have it set to respond to RTS with Polarity = Active Low
My app is configurable for RTS/DCS and Active Low/HI but Low/Hi seems backwards.
It boils down to this:
m_SerialPort.RtsEnable = true
keys the radio! I thought if Polarity = Active Low, setting RtsEnable to FALSE would key the radio??
Sure enough, if I change the CAT to be Active High, then
m_SerialPort.RtsEnable = false
keys the radio!
Where have I messed this up?
Thanks, and 73!
-Brian n8wrl
Answers
-
I sent an email to devhelp with more details:
Good morning!
I am writing a voice keyer to get familiar with CAT programming on the Flex, and I'm 99% there. My last problem is actually triggering PTT.
I have a PTT CAT port set up configured for DTR Active High, (see attached screenshot) although I can reproduce “the problem” with all the other combinations of RTS/DTR Active Low/High.
I can connect to the port using a .NET SerialPort object with no trouble.
Here is likely the basis of my confusion - I think “Active High” means setting the port to “High” or “True” will enable PTT, but it seems just the opposite. Here is some very simple .NET8 code to demonstrate:
using System.IO.Ports;
Console.WriteLine("Creating SerialPort");
using (SerialPort port = new("COM5"))
{
port.Open();
Console.WriteLine($"Port Open RTS={port.RtsEnable} DTR={port.DtrEnable}");
// Flex CAT set to DTR Active HI
// So this should key the radio BUT IT DOES NOT!
port.DtrEnable = true;
Console.WriteLine($"PTT ON RTS={port.RtsEnable} DTR={port.DtrEnable}");
Console.ReadKey();
// And this should unkey it BUT THE RADIO GOES INTO TRANSMIT!
port.DtrEnable = false;
Console.WriteLine($"PTT OFF RTS={port.RtsEnable} DTR={port.DtrEnable}");
Console.ReadKey();
port.Close();
}
The output is:
Creating SerialPort
Port Open RTS=False DTR=False
PTT ON RTS=False DTR=True ←- RADIO IS NOT KEYED
PTT OFF RTS=False DTR=False ←-- RADIO IS KEYED!!
Note that even after the program closes the radio stays keyed and I have to shut down SmartSDR to get it to unkey.
So it seems that my understanding of “Active High” is backwards - a port set to “Active High” should be set to LOW/False to key the radio and vice-versa.
Does this make any sense?
Thank you, and 73!
-Brian n8wrl
0 -
Hi Brian, so by switching the on and off sense of the RTS line, everything works?
0 -
Hi Len!
Switching on/off of RTS affects PTT but not the way I would expect.
When I set up PTT CAT with the RTS line and "Active High" setting RTS to FALSE turns on PTT.
It's backwards - Active High needs FALSE while Active Low needs TRUE.
I gotta believe it's just my misunderstanding. So much software is already in use. I must be doing something wrong.
73
-Brian n8wrl
0 -
Well, I guess it depends on the definition of true and false as implemented with respect to high and low signals. If you flip the true/false sense and it works, then it is probably just your understanding.
I seem to remember something about RS232 signals being negative voltages, and if so, that would flip the sense. Been a looong time since I ever fooled with the physical layer of RS232, so I may not have that right.
In any event, as long as it works (flipped), I don't think that you are doing anything wrong.
0 -
It seems correct to me.
If you select Active Low and True, the RTS line will go low which is what the PTT line needs to key.
0 -
Well, this has been quite a ride.
First off, you guys are correct, "Active LO" means setting the port to TRUE triggers PTT. Hopefully you can forgive me, because I'm a software guy, and, to me "LO" means "FALSE." (I also don't understand the age-old convention that a switch is "open" if current doesn't flow, while a "closed" switch will. On a server, a port is "open" if traffic flows and closed otherwise.)
I just have to get used to the nomenclature.
This led me down another rabbit hole - Polarity Active HI is unusable from the Microsoft .NET SerialPort object. I spent quite a bit of time spelunking the source code and learned that it wants to manage the DTR and RTS ports. When I close the serial port, it asserts DTR and RTS to false which, when polarity is HI, triggers PTT! When Polarity=LO, all is well.
So, I can either restrict CAT PTT ports to be Polarity=LO or connect to a "CAT" port and send TX0/TX1. Need to find out how portable that is across radio brands - Looks like Yaesu uses that too.
73 all, and thanks again!
-Brian n8wrl
1 -
SMOP = Simple Matter of Programming
As you know, it is never that simple.
Glad to see you playing with it.
73
0 -
Hey Mike!
Do you know of anyone using Polarity=HI? If so, what are they using to talk to the serial port?
0 -
I do not. But, I am sure some of the Microwave guys would use it for PreAmps, etc.
0
Leave a Comment
Categories
- All Categories
- 289 Community Topics
- 2.1K New Ideas
- 534 The Flea Market
- 7.5K Software
- 6K SmartSDR for Windows
- 146 SmartSDR for Maestro and M models
- 360 SmartSDR for Mac
- 249 SmartSDR for iOS
- 230 SmartSDR CAT
- 172 DAX
- 352 SmartSDR API
- 8.8K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 26 FLEX-8000 Signature Series
- 850 Maestro
- 44 FlexControl
- 847 FLEX Series (Legacy) Radios
- 796 Genius Products
- 416 Power Genius XL Amplifier
- 277 Tuner Genius XL
- 103 Antenna Genius
- 243 Shack Infrastructure
- 166 Networking
- 404 Remote Operation (SmartLink)
- 130 Contesting
- 631 Peripherals & Station Integration
- 125 Amateur Radio Interests
- 870 Third-Party Software