Jump to content
Sign in to follow this  
bpollock

Active Com1 frequency

Recommended Posts

Is there a way to use linda or lua to constantly monitor the active Com1 frequency and write it to a simple text file.  The file would simply get overwritten when a new active com1 frequency is selected?

 

Thanks

Brian

Share this post


Link to post
Share on other sites

Hi Brian

There is but what do you intend to do with the file data? There may be a more efficient way of passing through data to another process. 


Andrew Gransden

Scotland, UK

LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer

i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew

Share this post


Link to post
Share on other sites

I'm an old school visual foxpro programmer.  When the com freq is changed, my VFP app needs to read it and then continue processing.  I wrote a VB app a while back that would grab FS data to a text file for VFP to process it, but I lost the source code.   

 

Actually, remembering back, I think my VB app would put FS data into the keyboard buffer and my VFP app would read the buffer and continue processing   

 

Im not that good of a VB programmer to do all of it, hence the passing to VFP

 

I tried using fsuipc to log the com changes but the log file only gets updated when fsuipc is closed.  

Share this post


Link to post
Share on other sites

Leave it with me for a few days.


Andrew Gransden

Scotland, UK

LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer

i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew

Share this post


Link to post
Share on other sites

Hi Brian

This should do what you wanted. Copy code into: \linda\libs\lib-user.lua or \linda\aircrafts\{your aircraft}\user.lua.

function myCOM1(val)
    local strFreq = strFreq(getCOMFrequency(1, false))
    _loggg('[LIBU] Com1=' .. strFreq)
    file = io.open ("vps.txt", "w+")
    io.output(file)
    io.write(strFreq)
    io.close(file)
end

event.offset(0x034E, "UW", "myCOM1")

It runs only when the COM1 is changed and writes the string to file vps.txt. You can change the filename to suit your needs. If you place the code into lib-user.lua then it will work will all your aircraft whereas the user.lua is for the specific aircraft.


Andrew Gransden

Scotland, UK

LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer

i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew

Share this post


Link to post
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
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...