Jump to content

PROBLEM SAITEK RADIO PANEL WITH SR22 INTERGRA


Nico3478
 Share

Recommended Posts

Hi,

 

The Saitek Radio Panel switchs do not work if I use a LUA function with the new SR22 Integra aircraft

There is no error in log.txt

DO NOT WORK

xsaitekpanels.ini

;  *********** BAT. MASTER Switch *****************
;Bat Master Switch enable = 0 disable | = 1 default | = 2 remapable command | = 3 remapable datareference | = 4 remapable float datareference
Bat Master Switch enable = 2
bat_master_switch_on_cmd = FlyWithLua/NBETBM9/Switch_Bat_On
 

SR22.lua

    function Switch_Bat_On()
        if (SR22_switches_bat1 == 0) then
            command_once("afm/sr/cmd/switches/bat1_Toggle")
        end
        if (SR22_switches_bat2 == 0) then
            command_once("afm/sr/cmd/switches/bat2_Toggle")
        end
    end
    create_command("FlyWithLua/NBESR22/Switch_Bat_On", "SWITCH BAT ON", "Switch_Bat_On()", "", "")
 

WORK OK

xsaitekpanels.ini

;  *********** BAT. MASTER Switch *****************
;Bat Master Switch enable = 0 disable | = 1 default | = 2 remapable command | = 3 remapable datareference | = 4 remapable float datareference
Bat Master Switch enable = 2
bat_master_switch_on_cmd = afm/sr/cmd/switches/bat1_Toggle

 

Thanks for your help

Nicolas   

Link to comment
Share on other sites

5 hours ago, Nico3478 said:

create_command("FlyWithLua/NBESR22/Switch_Bat_On", "SWITCH BAT ON", "Switch_Bat_On()", "", "")

@Nico3478 Have you considered that you named the command FlyWithLua/NBESR22/Switch_Bat_On but are calling it as FlyWithLua/NBETBM9/Switch_Bat_On? :)

 

@Coop Are there non-toggle commands? I.e. One for each absolute switch position? E.g. bat1_On, bat1_Off, etc. This makes this kind of integration with hardware much easier as it doesn’t require testing the state of datarefs from Lua scripts.

Edited by Pils
Link to comment
Share on other sites

11 hours ago, Pils said:

 

@Coop Are there non-toggle commands? I.e. One for each absolute switch position? E.g. bat1_On, bat1_Off, etc. This makes this kind of integration with hardware much easier as it doesn’t require testing the state of datarefs from Lua scripts.

Yes, every two-way switch should have toggle, on, and off commands.

  • Like 1
Link to comment
Share on other sites

On 3/28/2021 at 6:29 AM, Nico3478 said:

It's ok now but i have a weird noise every time i run an order from a yoke, the bravo quadrant or the saitek switch panel :o

 

I also have a weird noise when using commands from the Saitek switch panel. It's like a creaking sound, very odd. Sound recording attached.

;command for battery master switch on command
bat_master_switch_on_cmd = afm/sr/cmd/switches/bat1_On

;command for battery master switch off command
bat_master_switch_off_cmd = afm/sr/cmd/switches/bat1_Off

;command for battery master switch on command2
bat2_master_switch_on_cmd = afm/sr/cmd/switches/bat2_On

;command for battery master switch off command2
bat2_master_switch_off_cmd = afm/sr/cmd/switches/bat2_Off

The same sound will also play out for any switch on the Alpha (or probably anything) that's assigned to sim/none/none a.k.a Do nothing.

Might be the regular switch sample repeated/distorted? Not sure, to be honest.

P.S. Oddly the On/Off commands don't show up in DataRefTool which is maybe why OP didn't find them.

Recording.m4a

Edited by Pils
Link to comment
Share on other sites

On 3/28/2021 at 6:29 AM, Nico3478 said:

the noise is very present and looks like a vibration

 

@Nico3478In the meantime I suggest using the datarefs for the switches, which are used by RealSimGear and are available for reference in CommandMapping.ini.

One downside is they don't trigger the nice switch sounds. Hopefully something TorqueSim can look at.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...