Jump to content
The simFlight Network Forums

Recommended Posts

Posted (edited)

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
Posted
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.

Posted
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

Posted
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.

Posted

Thank you so much for your answer and your time. I would've never figured that out on my own. 

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.