PDA

View Full Version : Interfacing a Basic ASI Gauge



Boeing 747 Flyer
06-11-2010, 02:43 PM
Hello everyone,

I have managed to pick up today 7 real-world aircraft instruments for an outstanding price.

One of the items picked up was an altimeter. It is an altimeter ranging from 0-450, presumed ex-military.

Anyway, I was wondering how this could be interfaced. Maybe through using the USBServos Card from Opencockpits? I'm getting the hang of SIOC (having just sucessfully implemented the USBKeys Card) but am pretty much lost on how to get the "output information" from the SIm to reference in SIOC, and then from then on onto the actual servo motor.

Even then, how do I define how mcuh the motor turns? Obviously,different gauges have different scales, so how do I tell the USBServos Motor this?

Maybe someone how has interfaced something like an analogue ASI could give me some tips.

Thanks very much,

Jack:D

737NUT
06-11-2010, 04:34 PM
It is kind of a complicated process but once you get the hang of it, it is easy. First off you need to determine what drives the gauge. A dc motor with a pot as feedback, (easy to interface) Synchro resolver's and transmitters, or simple air pressure or differential air. If you have to add a servo to drive a gauge, they are limited to 180deg movement. So if you have a gauge that has more than that, which 99% do, you will need to add some kind of gearing. Again, easy once you get the hang of it. You could even drive an altimeter with a simple dc motor and 10turn pot. Using gearing and programming. Once you have the mechanical set-up done, you test it by using IOCP console and commanding the servo to position 1-1022 to determine the range that matches your gauge. Example, my VSI gauge -5000 = servo position 450 and +5000 = servo position 925 Once you know that, you apply a little math and a small program in sioc and it functions perfect! Here is an example of some of my gauge scripts,

Var 0001, name VSI, Link USB_SERVOS, Output 1, PosL 170, PosC 612, PosR 1023, Type 1 // vsiservo

Var 0002, name EngN1servo, Link USB_SERVOS, Output 2, PosL 345, PosC 647, PosR 950, Type 1 // N1 Servo

Var 0003, name egt1servo, Link USB_SERVOS, Output 3, PosL 1, PosC 550, PosR 1023, Type 1 // EGT Gauge

Var 0004, name eng3N2servo, Link USB_SERVOS, Output 4, PosL 345, PosC 647, PosR 950, Type 1

Var 0005, name Eng3N1servo, Link USB_SERVOS, Output 5, PosL 345, PosC 647, PosR 950, Type 1

Var 0006, name Eng2N2servo, Link USB_SERVOS, Output 6, PosL 345, PosC 647, PosR 950, Type 1

Var 0007, name eng3N2, Link FSUIPC_INOUT, Offset $09C6, Length 2 // N2 rpm for eng 3
{
L0 = &eng3N2 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
&eng3N2servo = L2
}

Var 0011, name eng1N1, Link FSUIPC_IN, Offset $0898, Length 2
{
L0 = &eng1N1 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
&EngN1servo = L2
CALL &ConfigWarn1
}

Var 0012, name Eng1Egt, Link FSUIPC_IN, Offset $08BE, Length 2 // Eng 1 EGT
{
L0 = &Eng1Egt * 0.05249023 // 16384=860C
L1 = L0 * 0.522727
L2 = L1 + 335
&egt1servo = L2
}

Var 0013, name relay1, Link USB_RELAYS, Output 1 // AP Power

Var 0014, name APMaster, Link FSUIPC_INOUT, Offset $0278, Length 2 // Status of AP master switch
{
IF &APMaster = 1
{
&relay1 = 1
}
ELSE
{
&relay1 = 0
}
}

Var 0015, name Eng1N2, Link FSUIPC_INOUT, Offset $0896, Length 2
{
L0 = &Eng1N2 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
&Eng2N2servo = L2
}

Var 0016, name No2N1, Link FSUIPC_INOUT, Offset $0930, Length 2
{
L0 = &No2N1 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
}

Var 0017, name eng3N1, Link FSUIPC_INOUT, Offset $09C8, Length 2
{
L0 = &eng3N1 * 0.00606
L1 = L0 * 5.5
L2 = 345 + L1
&Eng3N1servo = L2

Boeing 747 Flyer
06-11-2010, 04:47 PM
Okay that's fanastic. So for an ASI gauge that runs through about 500 degrees, I would use a pot with a mechenical mechanism? Would I use the USBServos to interface?

Thanks,

Jack

Boeing 747 Flyer
06-11-2010, 04:59 PM
The gauge runs off differential air pressures. "Sucking" on the input increase the ASI, whilst "Blowing" on the input decreases the speed. Can this be interfaced?

Boeing 747 Flyer
06-11-2010, 05:59 PM
Right, I'm a little bit confused here. The gauge works off air pressures, can this still be interfaced?

Also ,does anyone have a circuit diagram for something like an ASI that moves about 500 degrees?

Thanks,

Jack

Boeing 747 Flyer
06-12-2010, 05:49 AM
Okay, I think I need to sort out the mechanical system first.

As I said, the gauge works off've ir pressures. If needs be, could I scrap this system and simply attacth a DC Motor with a Pot, and interface it that way?

Are there any circuit diagrams available for anything like this?

I think I can figure out the programming side of things later, I just need to know the actual mechanical connections between the USBServos Card and my Air-Pressured ASI Gauge, which moves through 500 degrees of movement.

Thanks alot,

Jack

737NUT
06-12-2010, 05:43 PM
Take out the air diaphram and associated parts. By using some gearing, you turn the shaft witha servoor a dc motor Servocity.com as all the stuff you need.

Boeing 747 Flyer
06-12-2010, 06:05 PM
Hi there,

Yes I'm taking out the air diaphram, it is a very strange system which cannot be interfaced in any way. I will just connect the needle to a servo. Also, what's interesting is the fact that there is a "U/C" flap which pops up and down when connected to a 5V power supply.

Anyway, lets say I purchased the USBServos Card. What else will I need to purchase? What will I need to buy from Servocity.com? What else should I know?

Also, will connecting a Servo and DC Motor direct to the Card work? I thought you mentioned something about limited 180 degree movement, etc.

Thanks very much,

Jack =)

Boeing 747 Flyer
06-14-2010, 01:54 PM
Okay, I think as I'm understanding this more and more I've boiled it down to some important questions...

- What EXACTLY do I connect to the USBServos Card, and, what attatched to what, etc?

- What motor/servo do I need to connect? There are thousands on Servocity, which one(s)?

Thanks,

Jack

fordgt40
06-14-2010, 03:31 PM
Jack

You need a servo not a motor.
You will need a servo that can either fit in the housing or easily be mounted to it, probably something like a Hitec HS-55
Check the full scale deflection of the needle against the servo movement range, it is likely that you will need to use gearing
Read the OC USBservos card manual as to how to hook up the servo, do not just plug it in as it is very likely that you will need to change over the servo leads and if you do not do this then it will blow up
Preferably only try the servo out by using a sioc programme first, else be very careful that the servo does not move under power to the full extent of its range as it could easily stall and burn out if it is not getting a position signal

David

Boeing 747 Flyer
06-15-2010, 05:29 AM
HI David,

You mention "using gearing"...

What does this mean exactly?

I understand how to use the IO Cards Servo testing software, this is no problem. It's more the mechanical side of things.

Also, the Hitec HS55 doesn't look lie it'll fit within my instrument. Is it possible to house the Servo BEHIND the instrument, and feed the needle movement with a small metal "Pole" attatched to the sevo?

Thanks, very much,

Jack =)

fordgt40
06-15-2010, 06:58 AM
Jack

If your ASI needle needs to move through 360deg and the max typical range of the servo is 180deg then you need to install gears such that for each deg of servo movment then the ASI needle moves 2 deg - ie a ratio of 2 to 1 or to put it another way you need twice the number of gear teeth on the servo shaft as is on the needle shaft. Follow this link for a practical example

http://www.737ng.co.uk/djb/brake_pressure_gauge.pdf

David

Boeing 747 Flyer
06-15-2010, 12:27 PM
I understand. If the Servo only moves 180 degrees,then you'll need to "multiply" its working efforts, by adding gears.

I think I understand the eletronic connections now. It is like this:

PC -> USBServos -> Servo (Hitec HS-55) -> Instrument

Is that correct?

Also, the testing software. On the interface, you can move the servo by either using the "sliding control" at the bottom, or using the manual entry of a number between 0-1024. I have a question about this... If I entered, say "5" into this box, would it move the servo to "position 5", or through a RANGE of 5 (eg 0-5)?

Thanks alot,

Jack

P.S: That gearing photo helped. Are there any methods to work out the number/size needed?

fordgt40
06-15-2010, 01:53 PM
Jack

PC -> USBServos -> Servo (Hitec HS-55) -> Instrument - yes
If I entered, say "5" into this box, would it move the servo to "position 5", or through a RANGE of 5 (eg 0-5)?
It will move to position 5 within the range of 0 to 1024

Are there any methods to work out the number/size needed - Only simple maths as outlined above, however, if the ratio is 2.5 to 1 then go for 3 to 1 on the gearing to give you extra needle travel as servos can be a bit jittery at their extremes of travel. Having decided on the ratio then find matching gears. If 3 to 1 then the gears should have 30/10 or 36/12 teeth respectively
David

Boeing 747 Flyer
06-15-2010, 02:16 PM
Right that's awesome.

Also, there are many different variants of the Hitec HS-55. Which one should I buy? There is a "mini" version, larger version... Etc.

fordgt40
06-15-2010, 03:04 PM
Jack

Whichever you think appropriate :)

David

Boeing 747 Flyer
06-15-2010, 03:59 PM
Jack

Whichever you think appropriate :)

David
Right okay, I'm just worried incase there are any mechanical/electronic differences I should look out for. Anything that won't be compatible I should be aware of?

Thanks,

Jack

fordgt40
06-15-2010, 04:17 PM
Jack

Only size and extent of rotation are relevant for this purpose. As advised, I use the Hitec HS-55 which as far as I am aware only comes in one sub micro size, not "mini and larger" as you suggested earlier

David

Boeing 747 Flyer
06-15-2010, 04:19 PM
Hiya,

If you type in Hitec HS-55 on Ebay you'll get loads of different Models called "HS-55"

Also, some versions say things like "0.18 / 0.14 sec @ 60deg"... Shouldn't that be 180 degrees?

fordgt40
06-15-2010, 06:03 PM
Jack

Sorry, but I would not use Ebay as an authority:)

I buy my servos from a local hobbyshop - safer!
No idea about "0.18 / 0.14 sec @ 60deg"... , means nothing to me

David

Boeing 747 Flyer
06-16-2010, 01:34 PM
Hiya David,

I ended up not getitng the HS-55, I spoke to a shop assistant and I told him the model name HS-55, and he gave me a different model but with very similar features.

Luckily, the one he gave me is much smaller than the HS-55, and easily fits within the ASI housing.

Next to master is the SIOC script. I will post a screenshot later today "labelling" what I think each section of the SIOC script means, then if I'm wrong could you steer me correct?

Thanks,

Jack

fordgt40
06-16-2010, 02:33 PM
Jack

Ok, will try!

David

Boeing 747 Flyer
06-16-2010, 04:44 PM
Hi Dave,

I've prepared this:

http://i822.photobucket.com/albums/zz146/Stratuspheric/USBServos.jpg

Am I correct?

Also, 737NUT mentioned a Pot for feedback... Is this needed?

fordgt40
06-16-2010, 05:15 PM
Jack

One comment - I think that the Type command should be Type 2 for a 1024 bit servo (could be wrong, but do not have the docs to hand)
The POSL POSC and POSR figures represent the servo values for the start, centre and finish of your needle movment. You can get these directly from the test programme. Alternatively, you can put in the default values of 0, 512, 1024 (provided the servo can move freely to these positions without stalling). In this latter case you would need to alter the programming to reflect that the start of the needle range is position say 300 instead of 0. Either way you will need to programme the movement to reflect the different scales eg ASI needle moves x amount against a servo range of y movement.

Also cannot guarantee which way the servo may move in relation to the input values - sometimes you have to change the code to cater for this

Edit - you do not need a pot as the servo has one internally

Good luck

David

737NUT
06-16-2010, 06:13 PM
A pot is only needed when using a DC motor and not a servo. :) Example, the VSI gauge i interfaced already had a DC motor and pot, i just wired them into a gutted servo and presto! A servo driven VSI guage that took less than hour to interface. Look for servo driven/electric only gauges.

Boeing 747 Flyer
06-17-2010, 01:12 PM
Okay, and one final request...

Could anyone supply an example SIOC script for an ASI that I could modify for my needs?

Thanks alot,

Jack

Boeing 747 Flyer
06-18-2010, 01:36 PM
Any ideas? Just an example ASi script that I could modify.

fordgt40
06-18-2010, 01:56 PM
Jack

Perhaps there are none out there, so you will have to get your hands dirty. I suggest you just take a gauge example, perhaps 737nut`s ones above, change the offset reference to the air speed parameter you want in FSUIPC and adjust the coding to suit your specific needs.

David

Boeing 747 Flyer
06-18-2010, 02:27 PM
Okay will do.

Just found out that the servo I purchased only moves 180 degrees. I take it this can still work if geared properly?

Var 0007, name ASI, Link USB_SERVOS, Output 1, PosL X, PosC X, PosR X, Type 2

^^^^^^^
Is the above script acceptable? Will I need to add anything? Also, Where I've put X... Does the number that goes here represent the minimum/maximum movements of the servo? If so, how will I find these?

fordgt40
06-18-2010, 03:23 PM
Jack

Most servos only move 170-180 deg hence the need for gearing.

I answered your question about X earlier, you can find the start, middle and finish points by running the IOTEST programme that you have and taking note of the readings -though you need a completed gauge to do this.

Yes, you need much more coding, see 737nut`s examples above, as earlier suggested

David

Boeing 747 Flyer
06-18-2010, 03:41 PM
Who is Jason?:p

Anyway, when you say run the IOTEST software, am I trying to find the mid/max/centre points of the GAUGE or the SERVO? Surely won't they just be the values of 0, 512, and 1024? Or is it different for each Servo? I know you have explained before but I'm a real novice on all this motorized know-how.

Also, I may have to contact Opencockpits regarding the script... Really not sure of what to do then. In 737NUT's examples the VSI line is only one line, and nothing else.

fordgt40
06-18-2010, 04:45 PM
Jack/Jason

I edited out the mistake earlier, sorry for the mixup:)

Forget the left centre and right values for the time being, you have a bigger challenge ahead of you! The SIOC code to make the gauge work is not just the one line referencing the servo, it is a whole collection of commands to read the ASI values from a FSUIPC offset, convert the values into a suitable numeric and scale the result to suit the ratio of movement between the servo and gauge face, then make the servo move. The single line you quote only sets the parameters for the servo - nothing else. You need to understand how to code in SIOC and I suggest that you try this site http://www.lekseecon.nl/ as well as downloading and the SIOC manuals from the OC site.

Even if you were fortunate enough to find a script, you would still need to tailor it significantly to suit your needs, hence the need to fully understand how SIOC commands work. I will try to find and post a simple gauge script (not ASI) to give you a starting point

Good luck

David

fordgt40
06-18-2010, 04:56 PM
Jack

Here is a very simple script

var 9004, name Servo4, Link USB_SERVOS, Output 4, PosL 1, PosC 511, PosR 1023, Type 2 // Servo Motor
Var 9005, name LeftDuctPress, Link FSUIPC_INOUT, Offset $5315, Length 2 // Duct Pressure * 10
{
L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364
}

This script defines the servo and the offset to get the gauge data
It then scales the data to suit the gauge range and then adds a value to position the needle at the beginning of the gauge

Please now follow my advice and links to understand how SIOC works before proceeding further

Regards

David

Boeing 747 Flyer
06-19-2010, 01:08 PM
Hi David,

Yes I've trawled through Nicos site in the past and found it very informative, unfortunately no SIOC Servo examples (I already know how to program in SIOC for things like push-buttons)

I've taken a look at your SIOC example.

First question - Why are there two variables if it is for one continous gauge?

Secondly, What are the lines "L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364" For, are these the scaling lines which define the gauge?

Apart from that, I can understand the rest of it. I think it is just trying to physically find the scaling and writing it in SIOC.

fordgt40
06-19-2010, 02:24 PM
Jack

Servo4 is the variable attached to the servo motor, so when that variable changes value the servo motor will move
Leftductpress is the variable collecting the actual value you need from flight sim

By way of further explanation

L0 = &LeftDuctPress / 1.5 is scaling the data to suit the needle range
&Servo4 = L0 + 364 - as the gauge needle travel does not match the servo, adding this number makes sure that when the data is zero, the needle is also at zero

David

Boeing 747 Flyer
06-19-2010, 02:49 PM
Right then, this is starting to make sense.

As you said, could I use the SIOC example you posted and tailor it to my specifications?

Is there something such as a "SIOC dictionary" that I could look up certain terms such as "l0" and "Length2"?

When you say scaling the data to suit the needle range, is that the 1.5 value which suceeds the forward slash?

I definitely understand the + 364 part though, as you say this is to match both gauges to zero (this means that the "real" gauge is +364 from the zero positon).

Thanks,

Jack

Thanks,

Jack

fordgt40
06-19-2010, 03:04 PM
Jack

yes
yes - download the sioc manuals from OC. By the way IO is actually ten in my example (the fsuipc offset provides the data times ten)
yes
yes

David

Boeing 747 Flyer
06-19-2010, 03:09 PM
Okay, I will download the manuals.

Does 1.5 mean that the movement is 1.5 times the sim movement or soemthing?

Boeing 747 Flyer
06-19-2010, 04:28 PM
Right. I am ready to modify the script into my needs, and I would appreciate if yo ucould evaluate it.

First of all, I need to know:

- How you get the "var" number

- How you get the "Length" number

- How to know what number to divide (in this case) LeftDuctPress by?

Thankfully though, I understand the following lines!

L0 = &LeftDuctPress / 1.5
&Servo4 = L0 + 364

The top line is defining what "L0" is, in this case LeftDuctPress/1.5 - The bottom line is defining what the value of Servo4 is, which is the formula of the top line + 364, which matches the "real" servo position of "0".

Correct?:)

fordgt40
06-19-2010, 06:56 PM
Jack

Sorry, but we cannot go fwd together on a "drip feed" basis. You need to demonstrate some effort into understanding SIOC - then I am happy to help. I am not an alternative to the manual. Trust that you will understand

David

iwik
06-19-2010, 08:23 PM
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

Boeing 747 Flyer
06-20-2010, 04:46 AM
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.

fordgt40
06-20-2010, 05:07 AM
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

Boeing 747 Flyer
06-20-2010, 05:20 AM
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.

fordgt40
06-20-2010, 06:01 AM
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

Boeing 747 Flyer
06-20-2010, 06:07 AM
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/zz146/Stratuspheric/Config_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

fordgt40
06-20-2010, 06:20 AM
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

kiek
06-20-2010, 06:32 AM
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.

Boeing 747 Flyer
06-20-2010, 06:36 AM
Okay Nico, I will try that.

Boeing 747 Flyer
06-20-2010, 06:47 AM
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.


// *****************************************************************************
// * 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?

kiek
06-20-2010, 06:53 AM
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

Boeing 747 Flyer
06-20-2010, 07:02 AM
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.

kiek
06-20-2010, 07:14 AM
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 ...


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 ... ;-)

kiek
06-20-2010, 07:21 AM
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 ;-)

Boeing 747 Flyer
06-20-2010, 08:59 AM
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.

kiek
06-20-2010, 09:19 AM
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 ;-)

kiek
06-20-2010, 09:21 AM
Is that correct?.
Yes it is.

Boeing 747 Flyer
06-20-2010, 09:26 AM
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?

kiek
06-20-2010, 10:03 AM
"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...

fordgt40
06-20-2010, 10:12 AM
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

Boeing 747 Flyer
06-20-2010, 10:35 AM
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:


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.

Boeing 747 Flyer
06-20-2010, 11:23 AM
I have further good news!

Just had a crack at making my own Servo Script, and hey presto! It complied sucessfully!

Take a look:


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
}

737NUT
06-20-2010, 09:24 PM
I have further good news!

Just had a crack at making my own Servo Script, and hey presto! It complied sucessfully!

Take a look:


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

Boeing 747 Flyer
06-21-2010, 02:56 PM
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?

fordgt40
06-21-2010, 03:21 PM
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

Boeing 747 Flyer
06-21-2010, 03:54 PM
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.

fordgt40
06-21-2010, 03:58 PM
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

kiek
06-21-2010, 04:26 PM
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/downloads.php?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

Boeing 747 Flyer
06-21-2010, 05:11 PM
Bingo!

I *think* the file is called "ATC_Definicion"... It lists all the inputs on the card.

kiek
06-21-2010, 05:25 PM
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. :-)