stinger2k2 Posted November 27, 2016 Share Posted November 27, 2016 Hi all, I am trying to write some lua code to operate the emergency lights switch of my Carenado Phenom 300. Using LINDA i have extracted the following Lvar.....ASD_SWITCH_EMER_LIGHT_EMB500 Can i derive the function name from this Lvar or do i need to source it elsewhere? Thanks Stinger Sent from my MZ604 using Tapatalk Link to comment Share on other sites More sharing options...
Mark Hurst Posted November 27, 2016 Share Posted November 27, 2016 Using LINDA i have extracted the following Lvar.....ASD_SWITCH_EMER_LIGHT_EMB500 Can i derive the function name from this Lvar or do i need to source it elsewhere? There is no 'function name', you will need to manipulate the Lvar, which is just a variable, to give the desired effect. There is no guarantee that it will be possible as it depends on the implementation. To proceed, you need to watch the contents of the Lvar in LINDA when you manipulate the light switch in the virtual cockpit. If you're lucky, it might vary between, say, 1 and 0 to reflect the position of the switch. And if your luck holds, poking 1 or 0 into it will flip the switch. You can try that in the LINDA Tracer too. If it works, you will need to use a line of code like this to do it from a Lua program: ipc.writeLvar("L:ASD_SWITCH_EMER_LIGHT_EMB500", 1) MarkH Link to comment Share on other sites More sharing options...
stinger2k2 Posted November 27, 2016 Author Share Posted November 27, 2016 I have done that and in fact found that I need numbers 0 to 2 for off,arm and on. I already had the pic line you quoted but did not have "L:" before the ASD. So I will try that. Thanks Sent from my SM-A300FU using Tapatalk Link to comment Share on other sites More sharing options...
stinger2k2 Posted November 27, 2016 Author Share Posted November 27, 2016 I meant ipc, not pic ! Sent from my SM-A300FU using Tapatalk Link to comment Share on other sites More sharing options...
stinger2k2 Posted December 6, 2016 Author Share Posted December 6, 2016 Sorted !! I now have a fully working overhead panel for my Phenom. The taxi lights turned out to be the trickiest part because Carenado had used two different addresses, One for the switch operation and one for actual light operation and because it is a 3 position switch which also operates the landing lights it was a bit tricky. On to the next bit now.....the autoplilot module ! ( I say module because I am building my cockpit to be put away after use so it will be in modules) cheers Stinger Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.