eaglewen Posted November 10, 2019 Posted November 10, 2019 Parking Brake - Anti skid - off switch Hi, I'm stumbling around with trying to get the F16 Viper connected to SIOC. My configuartion is working in general with 2Position switches. However trying to get a 3 position switch functional isn't working. I'm testing the parking brake switch. This one has 3 positions: OFF/ANTI SKID/PARKING BRAKE. In SIOC translated to 2 inputs where input93=OFF and input92=PARKING BRAKE. In the sim I only seems to be having the transition between ANTI SKID and PARKING BRAKE. Can someone tell me what I'm doing wrong here? I'm relative new to DCS and LuaExport but familiar with SIOC. In command_defs.lua gear_commands = { LGHandle = counter(); --1 DownLockRelBtn = counter(); --2 ParkingSw = counter(); --3 AntiSkidSw = counter(); --4 BrakesChannelSw = counter(); --5 HookSw = counter(); --6 HornSilencerBtn = counter(); --7 AltGearHandle = counter(); --8 AltGearResetBtn = counter(); --9 In SiocConfig.lua [357] = {TwoPositionSwitch, 7, 3, 1},-- PARK BRAKE in clickabledata.lua elements["PTR-LGCP-TMB-PRKNG-357"] = default_tumb_button(_("ANTI-SKID Switch, PARKING BRAKE/ANTI-SKID/OFF"), devices.GEAR_INTERFACE, gear_commands.AntiSkidSw, gear_commands.ParkingSw, 357) I think the 2 values for arg357 would be 4 and 3, right? in SIOC Var 0357, name SIM_PARK_SKID Var 1405, name SW_PARK_OFF, Link IOCARD_SW, Input 93 { IF &SW_PARK_OFF = 1 { &SIM_PARK_SKID = 0 } IF &SW_PARK_OFF = 0 { &SIM_PARK_SKID = 4 } } Var 1406, name SW_PARK, Link IOCARD_SW, Input 92 { IF &SW_PARK = 1 { &SIM_PARK_SKID = 3 } IF &SW_PARK = 0 { &SIM_PARK_SKID = 0 } } I know my SIOC is working as expected (at least I think it should work like this) because it returns 0, 4 and 3. OFF= VAR 357 equal to 0 ANTI SKID = VAR 357 equal to 4 PARKING BRAKE = VAR 357 equal to 3 But it isn't working in DCS, any idea? I think I'm using the wrong method TwoPositionSwitch because in the defintion this is declared as default_tumb_button...and I don't have a TwoPostionSwitch but more a kind of Rotary. A TwoPostionSwitch normale has only 0 and 1. I already tried to create a TwoPositionSwitch2 with values 4 and 3 but without succes. Any help would be appreciated. Thanks in advance Werner
Duckling Posted November 11, 2019 Posted November 11, 2019 Hi Werner DCS Viper is uncharted territory for me and it's been a long time since I made any real work in DCS/SIOC so treat the following as a hunch (having an extrem early morning and fail to go back to sleep, ignore this if it's misses the target or if it's old news ;-) ) The string is SiocConfig "[357] = {TwoPositionSwitch, 7, 3, 1},-- PARK BRAKE" points to the TwoPositionSwitch function (search for it inside ExportSupport.lua). I read the gear_commands as device id=7? and the ParkingSW as Arg3 and AntiSkid as Arg 4=, but can I be wrong. The SiocConfig string adresses the Arg3 with different values (0,3,4). The VAR 257 value from SIOC gets fed ito the TwoPositionSwitch function and the result (from the TwoPositionSwitch function) is the pushed into DCS module. The traling "1" in the string is an inverting value in the TwoPositionSwitch function that might affect your result. (The function in ExportSupport grab the Integervalue from SIOC, does what the twopositionswitch function (in this case) dictates and pushes the result up to DCS) say for example using the ThreePosition switch function as (check ExportSupport.lua) if you have one and how it's stated in your case: "-- Three pos switch with clickabledata.lua arg {-1,0,1} with "0" in mid position, expect 1,2,3 as input values fr siocConfig.lua function SimpleThreePosSwitch(pValue, pDevice, pNumber) GetDevice(pDevice):performClickableAction(pNumber + 3000,(pValue - 1)) end" Using the above function, might ease to find a SIOC value for SIM_PARK_SKID that trigger the OFF position /Gus - - - -
Recommended Posts