Page 4 of 7 FirstFirst 1234567 LastLast
Results 31 to 40 of 70
  1. #31
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    Who is Jason?

    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.

  2. #32
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    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

  3. #33
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    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

  4. #34
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    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.

  5. #35
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    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

  6. #36
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    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

  7. #37
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    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

  8. #38
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    Okay, I will download the manuals.

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

  9. #39
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    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?

  10. #40
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Interfacing a Basic ASI Gauge

    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

Page 4 of 7 FirstFirst 1234567 LastLast

Similar Threads

  1. Interfacing an Exhaust Gas Temperature Gauge
    By Mike.Powell in forum Interfacing Real Aviation Parts
    Replies: 8
    Last Post: 11-30-2011, 07:07 AM
  2. Looking for some basic help??
    By Robert Byrne in forum General Builder Questions All Aircraft Types
    Replies: 4
    Last Post: 12-22-2010, 05:48 AM
  3. FSBUS Dll and Visual Basic
    By Anderson/SBSP in forum I/O Interfacing and Hardware
    Replies: 10
    Last Post: 02-20-2010, 11:37 PM
  4. USB basic help
    By Redbirdman in forum Computer Hardware Setup
    Replies: 6
    Last Post: 03-18-2009, 05:44 PM
  5. 737 OHD Systems basic IRS logic
    By eudoniga in forum PMSystems
    Replies: 5
    Last Post: 06-09-2008, 03:42 AM