Jump to content
The simFlight Network Forums

Best way to receive active com frequency type on the current aircraft?


Recommended Posts

I'm currently trying to figure out what the best way to receive the type of the active COM frequency(specifically COM ACTIVE FREQ TYPE:1) for the current aircraft is in C#. I noticed that there isn't an offset value for the SimVar mentioned in the offset list document. And in a similar forum post it was mentioned that:

Quote

The coms frequencies for airports are available in the FsAirport.COMFrequencies property.


Would this then mean I would have to loop through all of the airports and frequencies within the current airport to determine the frequency type, or is there a more efficient way to receive the value?
I did try defining an offset specifically for the SimVar in the myOffsets.txt file to see if I could avoid the excessive looping but did not have much luck there.

Any insight or suggestions are greatly appreciated, thank you!

Edited by Hooji
refine question
Link to comment
Share on other sites

2 hours ago, Hooji said:

And in a similar forum post it was mentioned that:

Quote

The coms frequencies for airports are available in the FsAirport.COMFrequencies property.

Would this then mean I would have to loop through all of the airports and frequencies within the current airport to determine the frequency type, or is there a more efficient way to receive the value?

No - they are the airport com frequencies, not the type of the active com frequency in the aircraft.  You need to read the value of the COM ACTIVE FREQ TYPE:1 simvar, as you say.

2 hours ago, Hooji said:

I did try defining an offset specifically for the SimVar in the myOffsets.txt file to see if I could avoid the excessive looping but did not have much luck there.

What was the problem when adding the simvar to an FSUIPC offset? That would be the way to read this simvar using FSUIPC.

Link to comment
Share on other sites

49 minutes ago, John Dowson said:

What was the problem when adding the simvar to an FSUIPC offset? That would be the way to read this simvar using FSUIPC.

Ok, I have taken a look at this and there seems to be an issue adding string values to offsets - I will investigate and get back to you.

John

Link to comment
Share on other sites

4 minutes ago, John Dowson said:

Ok, I have taken a look at this and there seems to be an issue adding string values to offsets - I will investigate and get back to you.

Correction - I can add the  COM ACTIVE FREQ TYPE:1 simvar to an offset, but the units is Number and not String for some reason. If I add this to the myOffsets.txt file:

Quote

0xA008, 4, COM ACTIVE FREQ TYPE:1, S8, Number

And I add logging for this offset in FSUIPC7, I see this logged when on the runway with COM on the tower frequency:

Quote

     6172 Monitor IPC:A008 (AsciiZ) = [3]"TWR"
     6172 SimRead: A008="COM ACTIVE FREQ TYPE:1"
            STR8: "TWR"

So it looks like you can use this simvar.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.