August 17, 200520 yr Howdy.Looks like I got the idea of SIOC-coding. I managed to hook up my gear lever and leds..http://tigert.com/aviation/vatsim/cockpit-...three-green.jpgI am starting to like SIOC a lot, it's pretty powerful thing! Only if Ferdie would hack it so that you could use real names for variables and not numbers, those make my head spin and cause unnecessary bugs in the code that are pretty hard to find sometimes.. But other than that it's pretty cool! FSBus has the nice graphical logic builder interface that I liked even more, but this is also quite neat, once one gets the idea. The event-based language is very nice.A snippet that connects my analog input 1 to ailerons: // Aileron axisVar 0001, Link FSUIPC_OUT, Offset $0BB6, Length 2 // Aileron variable, -16383 to 16383Var 0101, Link IOCARD_ANALOGIC, Input #1, PosL 88, PosC 128, PosR 168 // Aileron pot{ L0 = V0101 - 128 V0001 = L0 * 128} and another that makes the left main gear "green" led light up: Var 0116, Link IOCARD_OUT, Output 14 // Left gear green ledVar 0012, Link FSUIPC_IN, Offset $0BF4, Length 4 // Left main gear position, 0=up, 16383=dwn{ IF V0012 = 16383 { V0116 = 1 } IF V0012 < 16383 { V0116 = 0 }} Pretty scary for the first time looker, but not that hard after all. The idea is, that any block of code { like this } after a variable is run, whenever the variable changes. Like on the last snippet, when V0012 changes (landing gear moves and the variable in FSUIPC changes), the IF-statements are run, and thus the green led lights up if the value is 16383, and goes off if the value is less than that (which would mean the gear is not down and locked)But please, I'd enjoy this a lot more: Var $LED_LeftGreen, Link IOCARD_OUT, Output 14 // Left gear green ledVar $FS_LeftGearPosition, Link FSUIPC_IN, Offset $0BF4, Length 4 // Left main gear position, 0=up, 16383=dwn{ IF $FS_LeftGearPosition = 16383 { $LED_LeftGreen = 1 } IF $FS_LeftGearPosition < 16383 { $LED_LeftGreen = 0 }} This would be so much easier to work with, so please, Ferdie and others, this would be just awesome if you could change the language spec to allow symbolic variable names.//Tuomas
August 18, 200520 yr What's great with opencockpits that when you need something, you ask and ... they'll do it or better it's still in the next version ...Thank'sWhen is the release of the next version of SIOC ?BOBPS for Tuomas:- Wasn't you before an expert on FSBUS ? - Did you swap like me to IOCARD ?
August 18, 200520 yr Author >PS for Tuomas:>- Wasn't you before an expert on FSBUS ? >- Did you swap like me to IOCARD ?Yeah, we have FSBUS on our Cessna 172 simulator at the aviation club. I am using IOCards on my home setup. Both are nice. I have FSBUS too, but the IOCards people seem to have more folks working on the hardware, and it uses less PIC's. Dirk's new designs also have cheaper components which is nice. I'm looking forward to see the new software he is working on too. Of course he is working alone on the project, thus things take longer.I like FSBUS's user interface, especially the CCC graphical logic stuff, it was a great way to make this stuff easy. SIOC is powerful, but harder to learn. The principles are the same of course.//Tuomas
August 18, 200520 yr > >Var 0116, Link IOCARD_OUT, Output 14 // Left gear green>led>Var 0012, Link FSUIPC_IN, Offset $0BF4, Length 4 // Left main>gear position, 0=up, 16383=dwn>{> IF V0012 = 16383> {> V0116 = 1> }> IF V0012 < 16383> {> V0116 = 0> }>}> Hi Tuomas,Welcome to the SIOC club! SIOC is very powerful indeed.Just a hint:You could also have written the body part like this: IF V0012 = 16383{ V0116 = 1}ELSE{ V0116 = 0} just a little bit easier to comprehend ...and faster to execute [iMHO]Best Regards,Nicowww.nicokaan.nl
August 18, 200520 yr Hi Tuomas,Welcome to the SIOC club! SIOC is very powerful indeed.> >Var 0116, Link IOCARD_OUT, Output 14 // Left gear green>led>Var 0012, Link FSUIPC_IN, Offset $0BF4, Length 4 // Left main>gear position, 0=up, 16383=dwn>{> IF V0012 = 16383> {> V0116 = 1> }> IF V0012 < 16383> {> V0116 = 0> }>}> Just a hint:You could also have written the body part like this: IF V0012 = 16383{ V0116 = 1}ELSE{ V0116 = 0} Just a little bit easier to comprehend ...IMHOBest Regards,Nicowww.nicokaan.nl
August 18, 200520 yr Author >Just a hint:>You could also have written the body part like this:> >IF V0012 = 16383>{> V0116 = 1>}>ELSE>{> V0116 = 0>}> >>Just a little bit easier to comprehend ...IMHOYeah. I didnt look over it again - it sort of evolved to that because I didnt realize one needs to provide both cases (I originally only set the led ON if the value is right, so it worked once, until I realized one needs to provide code for both cases :) - and then I didnt optimize the code yet. Thanks for that :) It's indeed pretty cool stuff.//Tuomas
Create an account or sign in to comment