Duckling Posted March 5, 2021 Posted March 5, 2021 (edited) I'm searching for a working method to read the status of a switch on a device other then Mainpanel/(0). Not sure if this 'should' work or my attempt fails to using lack of understanding LUA/DCS? I set a switch via LUA console with no issues: GetDevice(31):performClickableAction(3307, 1) But when trying to read the same argument value by issuing: returnValue = GetDevice(31):get_argument_value(3307) return returnvalue The response is: Response:runtime error 1 | [string "Lua Console Snippet"]:2: attempt to call mathod 'get_argument_value' (a nil value) Anyone that can guide me to working command? Best Gus Edited March 5, 2021 by Duckling - - - -
Duckling Posted March 10, 2021 Author Posted March 10, 2021 (edited) Hi Any help or idea appreciated. Should I be able to extract cockpit data via the DCS:BIOS Console using the syntax above? Do anyone here that have both DCS:AJS37 module and DCS:BIOS help out making that simple test described above, it would help greatly to easy troubleshoot this. (I do see applicable cockpit data active in DCS:BIOS Control reference so the connection is alive and question is in the LUA Console to query device/arguments) Right now I can't say for sure if it's my current config that fails, the LUA (HUB Version) Console that have issues with me, my syntax or if DCS:AJS37 Module that must be treated different some how. In my early A-10 simpit, I had the imports working from DCS (but there running older version of DCS:BIOS with Oakes scripts and SIOC) Work in progress is converting a real AJ37 Viggen to a simulator to join our existing J35 and J39 Sims at https://en.flygmuseum.com/ (ESOW Sweden) Existing MIL SIMs running X-Plane but this one is targeted (Of Couse) to run DCS, though the option to run it on X-Plane/FS2020/Prepar3D must be possible. That pushes us away from the 'simple' approach to use DCS:BIOS/Arduino and target is to use Oakes scripts here and IOCards/SIOC. Status right now is that the cabin is cut behind the canopy (so front of those mighty airtakes remains) Work on converting the panels to simulator use is almost completed. Gauges, radar and a lot other remain. Not exactly a Home Cockpit but essential not far from it. Early stages yet but if anyone like us to have a buildthread here to follow our progress, say the word All the best Gus Edited March 10, 2021 by Duckling 3 - - - -
Savvy Posted March 11, 2021 Posted March 11, 2021 (edited) Looks amazing, would love to see a build thread for sure. Edited March 11, 2021 by Savvy 1
Savvy Posted March 11, 2021 Posted March 11, 2021 Did you manage to get your switch problem solved? I haven't done anyting with DCS bios yet but a few things I'd try. Most of the example I see of get_argument_value use dev0, something like: local val = dev0:get_argument_value(arg_number) Actually, Reading someof the code, should the arg value be 267 instead, as defined here: defineToggleSwitch("RB_BK_REL_MODE",2, 3307, 267, "Weapon System", "RB-04/RB-15/BK Release Mode Switch") so maybe try: returnValue = GetDevice(31):get_argument_value(267)
Duckling Posted March 12, 2021 Author Posted March 12, 2021 (edited) Nopp, no joy yet .. and my LUA skill is far from top notch. (Tested just in case with suggested but failed) Testing ongoing. Digged into the metateble of the device 31 (in this case) and the function "get_argument_data" isn't listed there so I guess there no option to get it status that way. 3307 on devID 31 AJS37 is FR22's Group Selector knob, and the definitions of type, function, and coding differs for that same differs between HB, DCS BIOS HUB and the DCS-BIOS branch code for AJS37. Reused some code from above did mange to get the CK37 NAV and Destination display Digits and control some other multipos switches so not totally stranded yet. Going straight through LUA console here just to see what I manage to grab from the generic export environment but no luck on just this 'knob' yet. Cheers edit: @Savvy , If you planed for but haven't used DSC:BIOS yet, I'd say go for it. Can look a bit overwhelming at first but both code and documentation are great and cost for the Aurdinos is almost negligable Edited March 12, 2021 by Duckling - - - -
BlackLibrary Posted March 14, 2021 Posted March 14, 2021 (edited) @Duckling may look at our Discord. Here you find help! (link in my sig) Edited March 14, 2021 by BlackLibrary aka WarLord DCSFlightpanels DCS-BIOS Fork DCSFlightpanels arduino-library DCSFlightpanels DCSFlightpanels-Profiles DCS FP / BIOS Discord Server
Duckling Posted March 16, 2021 Author Posted March 16, 2021 (edited) On 3/14/2021 at 9:06 AM, BlackLibrary said: @Duckling may look at our Discord. Here you find help! BlackLibrary, thank you. Lost myself within your linked documentation for a while (or rather a day or two and still just scratched the surface ..), just the comprehensive ajs37.lua is a real timesaver for our ongoing work. Small donation inbound Cheers Gus Edited March 16, 2021 by Duckling 1 - - - -
BlackLibrary Posted March 17, 2021 Posted March 17, 2021 thanks for that! aka WarLord DCSFlightpanels DCS-BIOS Fork DCSFlightpanels arduino-library DCSFlightpanels DCSFlightpanels-Profiles DCS FP / BIOS Discord Server
Recommended Posts