Sending events to FS2020 issue

Peer support for Air Manager desktop users

Moderators: russ, Ralph

Message
Author
sylvain01
Posts: 3
Joined: Wed Dec 07, 2022 5:03 pm

Sending events to FS2020 issue

#1 Post by sylvain01 »

Hello !

I'm new on SimInnovations.
I setup a panel for a PA28 for FS2020, everything works well for instruments.
Except that i would like to send events with fs2020_event method but no effects on FS2020.
I misunderstood something.

I tried with many events, with instruments or hardware function, it seems they never sent.

Thanks for your help

Sylvain.
Screenshot_1.png
Attachments
Screenshot_2.png

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Sending events to FS2020 issue

#2 Post by Sling »

Hi Sylvain,

First up welcome to the forum. Glad to see another Air Manager user.

What you have posted should work. Fs2020 events are used in many of the air manager community instruments also. Can you confirm if any of these established instruments are working? If not perhaps you do not have the latest Plug-in or have a connection issue. There is a connection issue troubleshooting guide on the Sim innovations wiki but in most cases a firewall is the culprit.

Hope this helps.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Sending events to FS2020 issue

#3 Post by jph »

Sling wrote: Thu Dec 08, 2022 7:27 am
What you have posted should work. Fs2020 events are used in many of the air manager community instruments also. Can you confirm if any of these established instruments are working?

.
Obviously you didn't read his post.
I'm new on SimInnovations.
I setup a panel for a PA28 for FS2020, everything works well for instruments.
Joe. CISSP, MSc.

User avatar
Keith Baxter
Posts: 4671
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Sending events to FS2020 issue

#4 Post by Keith Baxter »

World war three on the way between two best friends. Where is the popcorn we are about to be entertained :lol:
Last edited by Keith Baxter on Thu Dec 08, 2022 11:00 am, edited 1 time in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Sending events to FS2020 issue

#5 Post by Sling »

Keith Baxter wrote: Thu Dec 08, 2022 10:33 am World war three on the way between two best friends. Where is the popcorn. :lol:
Confused. Not sure what this means. Very random

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Sending events to FS2020 issue

#6 Post by jph »

Keith Baxter wrote: Thu Dec 08, 2022 10:33 am World war three on the way between two best friends. Where is the popcorn we are about to be entertained :lol:
:lol:
If you mean that the 'antipodean Barbie mafia' may be sharpening his crayons then it is unlikely as he (selectively) blocks my posts. He has done for ages but he turns off the block to read them occasionally so he can learn something. :D
Joe. CISSP, MSc.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Sending events to FS2020 issue

#7 Post by Sling »

Oh I see now. I was just alerted away from this forum that the silly old fool is trolling again. How childish.

For everyone else I don’t see messages from jph at all because I blocked him so long ago now for continually trolling me and wanting to start arguments. It’s been so long I’d forgotten he even existed. I’d rather stick to the point of the forum, helping others.

User avatar
Ralph
Posts: 7867
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Sending events to FS2020 issue

#8 Post by Ralph »

If none of the events work and Air Manager is connected, then you can assume with 99.99% certainty that the firewall is the problem.

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: Sending events to FS2020 issue

#9 Post by SimPassion »

sylvain01 wrote: Wed Dec 07, 2022 5:18 pm Hello !

I'm new on SimInnovations.
I setup a panel for a PA28 for FS2020, everything works well for instruments.
Except that i would like to send events with fs2020_event method but no effects on FS2020.
I misunderstood something.

I tried with many events, with instruments or hardware function, it seems they never sent.

Thanks for your help

Sylvain.
In any case, just checked with existing Sim Innovations "Generic Pitch trim" and yes, it works

Code: Select all

-- Trim with buttons
-- Up
function button_trim_up_pressed()
    xpl_command("sim/flight_controls/pitch_trim_up", 1)
    fsx_event("ELEV_TRIM_UP")
    fs2020_event("ELEV_TRIM_UP")
end

function button_trim_up_released()
    xpl_command("sim/flight_controls/pitch_trim_up", 0)
end

hw_button_add("Trim up", button_trim_up_pressed, button_trim_up_released)
-- Down
function button_trim_down_pressed()
    xpl_command("sim/flight_controls/pitch_trim_down", 1)
    fsx_event("ELEV_TRIM_DN")
    fs2020_event("ELEV_TRIM_DN")
end

function button_trim_down_released()
    xpl_command("sim/flight_controls/pitch_trim_down", 0)
end

hw_button_add("Trim down", button_trim_down_pressed, button_trim_down_released)

-- Trim with potentiometer
hw_adc_input_add("Pitch trim potentiometer", function(value)
    xpl_dataref_write("sim/cockpit2/controls/elevator_trim", "FLOAT", -1 + (value * 2) )
end)

-- Trim with rotary encoder
prop_accel = user_prop_add_integer("Acceleration", 1, 10, 1, "Optional acceleration factor for rotary encoder")
hw_dial_add("Pitch trim encoder", user_prop_get(prop_accel), function(direction)
    if direction == -1 then
        xpl_command("sim/flight_controls/pitch_trim_down")
        fsx_event("ELEV_TRIM_DN")
        fs2020_event("ELEV_TRIM_DN")
    else
        xpl_command("sim/flight_controls/pitch_trim_up")
        fsx_event("ELEV_TRIM_UP")
        fs2020_event("ELEV_TRIM_UP")
    end
end)
image.png

Here with "Generic - Aileron trim"

Code: Select all

adc_lowest  = user_prop_add_real("Lowest", 0.0, 0.4, 0.0, "Lowest value of your ADC output")
adc_highest = user_prop_add_real("Highest", 0.6, 1.0, 1.0, "Highest value of your ADC output")

local aileron_range = { { user_prop_get(adc_lowest), -16383 },
                        { user_prop_get(adc_highest), 16383 } }

hw_adc_input_add("Aileron", function(adc_val)

    fs2020_event("AILERON_SET", interpolate_linear(aileron_range, adc_val) )
    fsx_event("AILERON_SET", interpolate_linear(aileron_range, adc_val) )
    xpl_dataref_write("sim/flightmodel/controls/ail_trim", "FLOAT", -1 + adc_val * 2)

end)
image.png
AM_FS2020_ElevatorTrim_ADC_Dial_NANO_#I_01.jpg
image.png
Last edited by SimPassion on Fri Dec 09, 2022 11:03 pm, edited 1 time in total.

sylvain01
Posts: 3
Joined: Wed Dec 07, 2022 5:03 pm

Re: Sending events to FS2020 issue

#10 Post by sylvain01 »

Hi

I finally decided to uninstall AirManager + plugins + user folder (i did a backup) and reinstall everything.
So now it is working, also with my previous user folder.
Don't able to understand what's happened, but not a big deal.

Thanks you for your help !:)

Post Reply