May 19, 200620 yr >Var 1, name BlinkLed>{>L0 = MOD &BlinkLed, 2 >// a so called Modulo 2 test: if even result is 0, >// if odd result is 1>&O_Led = L0>}This is indeed smaller code with the same semantics. For didactical reasons I used the IF statement>If L0 is a 0 or a 1, then it's a boole so it's rather silly toNo, just because there are just two values does not make it a BOOLEAN...! BOOLEANs have values FALSE and TRUE. It depends on the computer language how that is represented in bits. FALSE is indeed quite often 0, but TRUE is sometimes 1, sometimes -1, ...In SIOC the local BOOLEAN values are named C0, C1 and C2L0, L1 and L2 are signed integer valuesNicowww.nicokaan.nl
May 19, 200620 yr >But what with variables read from FS ? Is the>code below that triggered each time the variable changes ?>This means for constant changing values like e.g. IAS or ALT>or whatever that the code is running constantly. What's the>speed on that then ?You are right, each time the ALT changes, the code in the body of the FSUIPC var between curly brackets is executed. But only at the pace you have defined in sioc.ini. Suppose you have defined your FSUIPC_Refresh time at 100 msec, then it will executed that body (at most) 10 times a second.There is no noticable effect on your fps.Nicowww.nicokaan.nl
May 19, 200620 yr I thought the FSUIPC refresh rate is not possible to be set ?I thought I read that it's equal to the FPS in flightsim which seems logical.But maybe we're both right. If you set it to 1000ms it goos slow, if you set it to 1ms it will check the FPS and run at that speed.
May 19, 200620 yr >I thought the FSUIPC refresh rate is not possible to be setNo, you can, look at sioc.ini>But maybe we're both right. I don't know about you. But I'm right ;-)Nicowww.nicokaan.nl
May 19, 200620 yr Author >>I thought the FSUIPC refresh rate is not possible to be set>No, you can, look at sioc.ini>>>But maybe we're both right. >I don't know about you. But I'm right ;-)You both are right :) The maximum refresh rate for fsuipc is the FS2004 framerate. But SIOC has a setting for this too, to set it lower than that, if needed.//Tuomas
July 25, 200619 yr Hi Guys,It's still way too hot over here for flying on-line, so let's continue with good examples of the use of SIOC:A guys asked: "I want to trigger a Relay when offset 049C is between 175 and 245. This will turn on my 'Below G/S' lamp on my 737 I am using SIOC 3.2"Well, this is how you can do that (elegantly):Var 1, name FI_GS, Link FSUIPC_IN, Offset $049C, Length 2 { C0 = &FI_GS > 175 C1 = &FI_GS < 245 IF C0 AND C1 { &O_GSLamp = 1 } ELSE { &O_GSLamp = 0 } } var 2, name O_GSLamp Link IOCARD_OUT, Output 77 Nicowww.nicokaan.nl
July 27, 200619 yr Hi Nico,My list of FSUIPC offsets does not show anything for $049C. Can you give me some info about this offset, what does it show? Below GS light would be a nice one to impliment.Regards, Simonwww.desktopflying.co.uk (Very out of date)Very slowely putting together a generic twin desktop unit.
July 27, 200619 yr Hi Simon,Don't know either, it was a question from a guy called Rob in the Opencockpits forum on SIOC examples. Here is his website:http://www.737nut.com/ Regards,Nicowww.nicokaan.nl
November 15, 200619 yr //dme1_distance Var 0610, name dme1_d_nXX, Link FSUIPC_IN, Offset $0C29, Length 1 // first segment DME1 distance NX.X { &dme1_d_disp1 = &dme1_d_nXX - 48 } Var 0614, name dme1_d_disp1, Link IOCARD_DISPLAY, Digit 2, Numbers 1 // Dme1 distance segment 1 //dme2_distance Var 0630, name dme2_d_nXX, Link FSUIPC_IN, Offset $0C33, Length 1 // first segment DME2 distance NX.X { &dme2_d_disp1 = &dme2_d_nXX - 48 } Var 0634, name dme2_d_disp1, Link IOCARD_DISPLAY, Digit 2, Numbers 1 // Dme2 distance segment 1 // Button Var 0010, name dme1_sw, Link IOCARD_SW, Input 10 // dme1 switch Var 0015, name dme1_dme2_o, Link FSUIPC_OUT, Offset $0378, Length 2 // offset toggle Var 0020, name dme2_sw, Link IOCARD_SW, Input 11 // dme2 switch Have a button witch works like 1-2 (inputs 11 & 12 ,not monentary switch ).I have some simple problems with sioc programming. I need solution for following thing:When I push button display ( shows dme1 segment 1 in digit 2. When I push it again it shows dme2 segment in digit 2.How to make that work with this code I have?I took off all other segments, it simplifies code, but shows the basics.Please help
December 1, 200619 yr I have a question about compiling multiple TEXT mode files of SIOC.Right now, I have Nioc's Level-D MCP code up and running great,and now want to add his ILS code. In text mode, I tried to copy and past the ILS code after the MCP code, but when I compiled I got many errors. In particular, it metions that several variables have already been occupied.How do I add his additional code ( his ILS SIOC)?Thanks,Polmer
December 1, 200619 yr First you must check if the name of the variable or variables in the code that you want to paste is already used in the SIOC file where you want to add this new code.Remember that the name of a variable must be unique, duplicated variables are not allowed.If you get a lot of errors it may be a conseguence of the duplicated variables.Check the code and retry.Let us know if it worked.Regards,Bob
December 5, 200619 yr Well,I tried to simply cut and past the two codes together. Then going through and remove any redudant Variables listed ( which I thought I did correctly), but still getting comiling errors for some reason.Time for me to re-read the SIOC manual once more.Polmer
December 6, 200619 yr Author >Well,>>I tried to simply cut and past the two codes together. Then>going through and remove any redudant Variables listed ( which>I thought I did correctly), but still getting comiling errors>for some reason.>Time for me to re-read the SIOC manual once more.>>PolmerThe problem is the *numbers* - if you have "var 001" twice, even though they are used for different things, they conflict, since the compiler is going to complain if you try to define two things as var 001.Ferdie, or other IOCards people, wouldn't it make a lot more sense that you could use the named variables *only* in this, and then just at compile-time assign the variables as numbers? So that the code could use:Var $LandingLightSwitch link iocard blah blah...and when you compile it, it would become 001. I don't think it would hurt anything (since the variable numbers are not needed for "normal" use - and if you need them, those are still available in the protocol level anyway. The compiler could produce the numbers for iocpconsole anyway.What do you think?//Tuomas
December 7, 200619 yr That would be great indeed. But e.g. in the lcd software now I just give a var as a number. Else they would have to make it a text box. It's doable but they'd have to do changes to everything .. not just sioc.
Create an account or sign in to comment