Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SIOC and how it works

Featured Replies

This SIOC language looks very interesting, thanks for these ‘tutorials’ guys.One thing I don’t understand – is it a scripts being translated in real-time, or is it compiled into some kind of run file?Cheers,Yaniv

  • Replies 70
  • Views 24.8k
  • Created
  • Last Reply

Top Posters In This Topic

Here's an example how you can toggle the value of a Flag, say from 0 to 1, back to 0, back to 1, and so on ...Var 1, name Flag, Value 0// this is one way:Var 3{ IF &Flag = 0 { &Flag = 1 } ELSE { &Flag = 0 }}// This is another way, less readable, but with much less code:Var 2{ &Flag = CHANGEBITN 0, &Flag}// Cheers!Nicowww.nicokaan.nl1704.png

Vars in SIOC are by default unsigned. This is something to be aware of when you want to calculate with a signed integer read from FSUIPC.A generic algorithm for that problem is the following code:Var 1, name SINT, Link FSUIPC_IN, Offset $037C, Length 2{ C0 = TESTBIT &SINT, 15 // test if most significant bit is 1, if so its negative IF C0 { L1 = 65536 - &SINT L0 = L1 * -1 } ELSE { L0 = &SINT }// ready: L0 contains the signed integer, you can now test on < 0 and so on}// CheersNicowww.nicokaan.nl1704.png

Thanks Nico…true it doesn’t really matter for the user, but just was interesting how it is done.CheersYaniv

  • 3 weeks later...

// How to read (Display) and write (Change) a// FSUIPC read/write variable//// The example details the AP HDG but other // application area's are: // AP SPD, VS and ALT// VOR freq and CRS// HF radio freq and CRS// ILS freq and CRS // ADF freq// VHF freq// ... and so onVar 1, name X_HDG, Link FSUIPC_INOUT, Offset $07CC, Length 2 { // convert from fsuipc range to degrees: L0 = DIV &X_HDG, 182 IF &HDG != L0 { &HDG = L0 } } Var 2, name HDG { CALL &OutHDG } Var 3, name OutHDG, Link SUBRUTINE { &D_HDG = &HDG // convert from degrees to fsuipc range: L0 = &HDG * 182 IF &X_HDG != L0 { &X_HDG = L0 } } Var 4, name RO_HDG, Link IOCARD_ENCODER, Input 36, Aceleration 4 Type 2 { L0 = &RO_HDG // * -1 turning right should be plus &HDG = ROTATE 0, 359, L0 } Var 5, name D_HDG, Link IOCARD_DISPLAY, Digit 0, Numbers 3 // endNicowww.nicokaan.nl1704.png

Does it work like this 2 ?If L0 is a 0 or a 1, then it's a boole so it's rather silly to question it with an IF if you need the same value in the variable ..______________________________________________________Var 0, value 0{&O_Led = 0&BlinkLed = 10 // Begin value &BlinkLed = TIMER 0, -1, 50 }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}Var 2, name O_Led, Link IOCARD_OUT, Output 77______________________________________________________

And now .. how does it work for the USB-servo and USB-stepper cards ?If I understand right we need CONFIG_SOIC to set up our program code. Once done we compile and then we go to SOIC itself and the program should run ? So I do not need the IOCards software ?

Hi Philippe,SIOC and IOcards are mutually exclusive... You either use the one or the other.I would forget about IOcards software, SIOC is much more flexible and powerful. That is the way to go... ;-)Nicowww.nicokaan.nl1704.png

So I just open SOIC, from there open the program interface, put all my code there, compile and than it takes me back to soic .. and that's it ? Sounds easy 'nough.So I should use SOIC as well for my servo's then.I hope I'll receive the boards & components next week. By the end of the weekend after this one, I'll have all soldered (doesn't look like much work, does it :D ) and than I got 1 servo here to start testing. If that goos well, I can order more servo's from conrad and then I can start building up the gauges. I got most faceplates finished already.

No, open Notepad, put your code in there and save as filename.txt.Compile it with config_sioc (Import, File as txt...), save it as filename.ssiand put the name filename.ssi in your sioc.ini file.Then run sioc.exeThat's allNicowww.nicokaan.nl1704.png

And what is "IOCservos.exe" for then ?

Also I understand that if you have a Var 0 which is the input of a switch or a button the code below is triggered once the input changes. 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 ?

I know nothing about that, unfortunately. I guess it is a piece of software that has to run as well to interface with the servo. I know a guy in The Netherlands who sorted that all out a few months ago (at least that is what I think he did, he asked me the very same question and I gave him a few hints after I had studied the documentation that goes with that piece of software ...I'm not at home now, I will send you his email adres bij PM this eveningNicowww.nicokaan.nl1704.png

Perfect.It's not the guy from the Baron58 by any chance ? Cuz if so, I got his e-mail. I'm waiting for a reply from him.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.