-
Re: Interfacing a Basic ASI Gauge
Hi Jack,
Welcome to the world of Sioc. David is correct, you really need to sit down and read thorughly the manuals provided by O/C. By reading all of their docs
you will get a better understanding of how all of this fits together. From your questions there appears many hole in your understanding. Believe me we all have gone thru this and will tell you that much satisfaction will be gained by better understanding.This will lead you to being able to dissect and modify others code to suit you. O/c forum site has a sub section of examples, when you better iunderstand SIOC this section will be invaluable .
Hope this helps, just remember there are many users here but first one has to get a basic grasp on what happens overall when one trys to interface hardware with fsim.
Rgds
Les
-
Re: Interfacing a Basic ASI Gauge
I have sat through the entire SIOC tutorial, SIOC II is broken (dead link).
I have read the SIOC manual.
I know exactly what the "var" and "length" entires are, but I just don't know how you GET them (ie where).
Var is of course the variable, and length is the associated length entry appropriate to the PM offset (according to the SIOC tutorial).
Furthermore, I think a lack of FSUIPC resources is also a contributing factor. I have searched and searched for the "advanced users manual" which apparently provides a list of FSUIPC offsets, but I couldn't find it. So I downloaded FSInterragator, and managed to obtain the Offset code for IAS on the ASI, however still couldn't find the variable number or the relavent information to proceed further.
I have put substantial effort into trying to understand all the SIOC scripts mentioned in this thread, and I think going from zero knowledge to knowing how to properly scale and things is rather difficult.
The SIOC manual hasn't been updated since 2004, and still refers back to the very old SIOC versions, very, very confusing.
The SIOC PowerPoint presentation teaches me nothing (I actually watched it twice previous to making this thread), it only explains things like where SIOC is used, what it does, when to use it, not HOW or what to do.
It is extraordinarily difficult for me to understand all this when I have absolutely no scripting/programming experience.
-
Re: Interfacing a Basic ASI Gauge
Jack
Progress:)
The var number is your choice you can have Var 0001, Var 9999 etc etc - you just cannot have two of the same number
Do you have a registered copy of FSUIPC - the list of offsets is in it
Read this link to understand how to access information from FSUIPC
http://www.lekseecon.nl/howto.html#readFSUIPC
David
-
Re: Interfacing a Basic ASI Gauge
Hiya David,
When you say in FSUIPC, are you referring to in-sim FSUIPC or the provided manuals?
According to the link to Nicos site, the offsets are in the "Programmers Manual", I will try and find this.
-
Re: Interfacing a Basic ASI Gauge
Jack
Do you have a registered copy of FSUIPC - http://www.schiratti.com/dowson.html
I am not certain what is inside Nico`s "Programmers Manual" , may well be fine, but the authority is the FSUIPC list of offsets
David
-
Re: Interfacing a Basic ASI Gauge
I've had a go at making my own SIOC script using the built-in Config_SIOC tool.
Take a look at this:
http://i822.photobucket.com/albums/z...onfig_SIOC.jpg
As you can see, I've inputted all necessary information... But when I hit okay, nothing happens! Shouldn't a line of SIOC script appear?
By the way, of course these are not the true values, I am just making a default example. The L, C, and R values will change along with the Device number, etc.
Jack:D
-
Re: Interfacing a Basic ASI Gauge
Jack
Where is your script? You should make up scripts using a text editor and then complie using sioc. Please read the Howto section on Nico`s site - http://www.lekseecon.nl/configsioc.html.
David
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
It is extraordinarily difficult for me to understand all this when I have absolutely no scripting/programming experience.
I believe that in this case you should not try to write a script for a Servo, much to dificult for a beginner...
The FSUIPC for programmers manual is in the FSUIPC SDK (to be downloaded from Pete Dowson's page)
If you push OK in the GUI tool of Config_sioc you wil have add a line to the SIOC script. You can get that script by Exporting it to a txt file. In your example you only have defined the Servo definition var, you should also write an algorithm doing someting with that var. That is the difficult part...
And, like fordgt40 says, it is much easier to use the Notepad editor and to write the script using that text editor, after that comple it with config_sioc.exe.
-
Re: Interfacing a Basic ASI Gauge
Okay Nico, I will try that.
-
Re: Interfacing a Basic ASI Gauge
Right, I've poured all of my knowledge into the following very simple script.
Whilst it does bear similarities to other scripts posted here, I did make this one completely by myself.
It is not finished, I have not defined the scaling or anything like that... One step at a time.
Code:
// *****************************************************************************
// * Config_SIOC ver 3.7B1 - By Manolo Vélez - www.opencockpits.com
// *****************************************************************************
// * FileName : sioc.txt
// * Date : 20/06/2010
Var 9004, name Servo4, Link USB_SERVOS, Output 4, PosL 1, PosC 511, PosR 1023, Type 2 // Servo Motor
Var 9005, name IndAirSpeed, Link FSUIPC_INOUT, Offset $02BC, Length 4 // Value of Indicated Air Speed * 128
Progress?
-
Re: Interfacing a Basic ASI Gauge
Jack,
This script does nothing ...
First you have to specify what you want to achieve and then you have to develop an algorithm doing that (using these Vars and maybe some others as well). You have to write SIOC code between curly braces attached to a Var otherwise nothing will happen at all ....
regards,
Nico
-
Re: Interfacing a Basic ASI Gauge
Hi Nico,
As I said the script is not finished, I have to scale it yet.
I noticed on the previous page David (on one of his scripts) posted the line "L0 = &LeftDuctPress / 1.5"
I understand that line, except for the definition of "L0". The line means that, whatever L0 is, is that it is equal to the value of LeftDuctPress Offset divided by 1.5.
The line after that, "&Servo4 = L0 + 364", I udnerstand as the scaling of the servo. It is basically telling the servo that Zero is "+364", so that the gauge and "real" servo are in-sync (if that makes sense, pretty much making sure that both of them are zero).
If all that is correct, that means I understand about 85% of that SIOC script, I just need to know what L0 is, and then I can start to develop my own.
I'm finding this fun, learning SIOC is a challenge but I see how it can be rewarding. Still, I don't understand how everyone can learn SIOC when one of the tutorials is a dead link, and the manual is 6 years out of date!:)
Thankfully, your site does provide relief to an extent, I learnt how to program push-buttons and basic outputs (like LEDs) from you site.
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
I just need to know what L0 is,
L0 is a internal integer/float variable, to be used in a script, see my HowTo page http://www.lekseecon.nl/howto.html#internalVars
Study the Help information in Config_sioc, it decribes each language feature of SIOC ...
Quote:
Originally Posted by
Boeing 747 Flyer
and then I can start to develop my own.
Again, in my opion, you are too optimistic. I'd recommend to practice with SIOC scripts for easier tasks first (encoders, leds, and so on). Programming Servo's is risky if you do not understand it fully. Servo's can be blown up easily ... ;-)
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
I don't understand how everyone can learn SIOC when one of the tutorials is a dead link, and the manual is 6 years out of date!:)
The SIOC language has not changed much since 2004 except for some minor additions. So one cannot say that the Manual is out of date....
A lot of programming languages have Manuals dating years back, but these languages are still being used today ;-)
-
Re: Interfacing a Basic ASI Gauge
Nico, I'm referring to the SIOC interface has changed. It looks much more different to 2004.
Furthermore, I'm extremely please because I *think* I understand the L0 now.
Is this correct:
For example:
"v7 = v3 / 7 + v9" = WRONG, because more than one operation is happening in one line/statement
"L0 = v3 / 7
v7 = L0 + v9" = CORRECT, because you are using L0 as a "subtitute" to v3 / 7
Is that correct?
Also, a more practical example:
"L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364"
=
"&Servo4 = &LeftDuctPress / 1.5 + 364" -> BUT this cannot be written as it is more than one operation.
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
Nico, I'm referring to the SIOC interface has changed. It looks much more different to 2004.
With 'SIOC interface' I believe you mean the 'tools'. If I'm right you are referring to the -now obsolete- GUI tool for programming IOCards.
The other option, SIOC as a language for programming IOCards, has not changed and if you are using the Notepad editor the 'tooling' also has not changed ;-)
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
Is that correct?.
Yes it is.
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
kiek
Yes it is.
Woooooo!:o
also, you say I should try programming rotary encoders. I think I know how to do this already, the following small script is for a Speed Selector on the A/P Panel, which ranges from 0 to 999 knots:
Var 6 Link IOCARD_ENCODER Input 43 Aceleration 3 Type 2
{
L0 = v6 * +1
v7 = ROTATE 0 999 L0
Is that correct?
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
"var 6 Link IOCARD_ENCODER Input 43 Aceleration 3 Type2
{
L0 = v6 * +1
v7 = ROTATE 0 999 L0"
No, this script will not even compile, because it is syntactically not correct. Please try to compile your script first before posting questions here...
Let us end this discussion now. A Forum is not the right place to teach you programming...
-
Re: Interfacing a Basic ASI Gauge
Jack
(posted before I saw Nico`s reply, but the message is still sound)
Sorry but no!
Remove the quotes before var 6
Add a curly bracket at the end of the code
Where is the definition for Var7? ie where does the output go to?
Sorry, but you are a bit like a spinning top bouncing off the walls:)
Slow down, follow Nico`s advice and try working simple examples through. For example did you try to compile this script, if you had, then errors would have been flagged. Learn the simple steps first - please:)
David
-
Re: Interfacing a Basic ASI Gauge
Hmmm... Not sure what the problem is, when I use the compiler it says a green "OK" at the bottom, surely this is correct?
EDIT: Found the problem. When I pasted it into the MyCockpit forums it chopped the bottom lines off. This is what it actually looks like:
Code:
Var 6 Link IOCARD_ENCODER Input 40 Aceleration 2 Type 2
{
L0 = v6 * +1
v7 = ROTATE 0 999 L0
}
Var 7
Nico, I'd rather keep the discussion going, I'm learning an awful lot more than I would if just reading manuals. People learn in different ways, for me it is using practical examples and actually performing things that allows me to learn.
-
Re: Interfacing a Basic ASI Gauge
I have further good news!
Just had a crack at making my own Servo Script, and hey presto! It complied sucessfully!
Take a look:
Code:
var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 3, PosC 517, PosR 1007, Type 2 // Servo Motor
Var 9003, name IAS, Link FSUIPC_INOUT, Offset $02BC, Length 4 // Indicated Air Speed * 128
{
L0 = &IAS / 1.5
&Servo4 = L0 + 213
}
-
Re: Interfacing a Basic ASI Gauge
Quote:
Originally Posted by
Boeing 747 Flyer
I have further good news!
Just had a crack at making my own Servo Script, and hey presto! It complied sucessfully!
Take a look:
Code:
var 9000, name Servo4, Link USB_SERVOS, Output 1, PosL 3, PosC 517, PosR 1007, Type 2 // Servo Motor
Var 9003, name IAS, Link FSUIPC_INOUT, Offset $02BC, Length 4 // Indicated Air Speed * 128
{
L0 = &IAS / 1.5
&Servo4 = L0 + 213
}
Congrats! But you need to put limiter's in the script as not to overdrive the servo. Example, If LO + 213 > 900 &servo4=900
-
Re: Interfacing a Basic ASI Gauge
Thanks for the help everyone, I've learnt an awesome amonut this week, thread can be closed now.
Just one final question... I want to "test" my SIOC skills. I own the O/C Transponder, which I might have a go at making a SIOC script to interface with maybe a default FSX aircraft. However, I do not have a wiring diagram of which switch/knob/button is connected to wish, and the O/C users manual yields no results. Any ideas how I can find out what's wired to what on the card?
-
Re: Interfacing a Basic ASI Gauge
Jack
I would expect the ready built OC Transponder to come with a script to suit FSX. In which case examination of the script should show which inputs/outputs are connected to their respective switches/leds. Else, when running the script under SIOC, you can use IOCPCONOLE and its log function to trace and work out assignments
David
-
Re: Interfacing a Basic ASI Gauge
Hi David,
A SIOC script is required to let it run with specific aircraft, as per Opencockpits support.
It will provide a default root for the Transponder Code, however buttons like the IDENT button and mode knob required a script to get working.
If, as you say, it comes with a script... I cannot find it within the installation files.
-
Re: Interfacing a Basic ASI Gauge
Jack
Quote from the manual
USING SIOC WITH THE MODULES:
Actually it is possible to accede to the programming of the modules by means of our SIOC programming language,
for that purpose the 3.7 version includes the definition of the variables of each module, se we can program the
module to our liking.
Albeit technically the programming of the module under IOCModules is correct, with this SIOC option details like
controlling the brightness with the hardware, or maybe the COLD&DARK option, etc…, can be added.
So it must be somewhere:)
David
-
Re: Interfacing a Basic ASI Gauge
I believe it is in the SIOC directory, it comes with 3.7 beta 1.
And otherwise, have a look at my SIOC script for the OC transponder to be used with lekseecon and the Level-D. I am using the same in- and outputs.
It is a file in this zip http://www.mycockpit.org/forums/down...do=file&id=393
I will not tell you the name of the file. It is a nice test to check your skills in reading and understanding SIOC files ;-)
Nico
-
Re: Interfacing a Basic ASI Gauge
Bingo!
I *think* the file is called "ATC_Definicion"... It lists all the inputs on the card.
-
Re: Interfacing a Basic ASI Gauge
Indeed, that's the one. For every OC module there is such a definition file. You see, it's all there, you only have to find it. :-)