Page 3 of 74 FirstFirst 12345671353 ... LastLast
Results 21 to 30 of 737
  1. #21
    300+ Forum Addict
    Join Date
    Feb 2008
    Location
    Krefeld, Germany
    Posts
    318
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    If you need the full servo way for the gauge than you hav 0-255, as sample my Flap gauge needs 10-235.
    The scale value is the 08C8 offset, you can use FSInterrogate2std to find out the value.

    Stefan

  2. #22
    300+ Forum Addict RobiD's Avatar
    Join Date
    Sep 2007
    Location
    Gold Coast, Australia
    Posts
    430
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    FsAdmin gives me the values for the full travel around the rpm gauge as 9-197.

    Used FSInterogate (hopefully used it correctly);

    With engine stopped 08C8 Engine Scaler read in the 16bit buffer: 5660
    in the Factored Buffer: 5660

    With engine at full rpm 08C8 Engine Scaler read in the 16bit buffer: 10829
    in the Factored Buffer: 10829

    Hope this is what you mean.

    Thanks
    David

  3. #23
    300+ Forum Addict
    Join Date
    Feb 2008
    Location
    Krefeld, Germany
    Posts
    318
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    hi,

    i think you have to use calibrate funktion from the V2.
    As a fast solution you can try to divide the RMP by 10.

    int x = (val * eng1scaler / 65536)/10;

    That isn磘 synchron to the scale, but better then the fast movements on low rpm.

    Stefan

  4. #24
    300+ Forum Addict RobiD's Avatar
    Join Date
    Sep 2007
    Location
    Gold Coast, Australia
    Posts
    430
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi Stefan,

    V2 dll is possibly going to be release mid June, so only a couple of weeks away.

    Do you know what the correct syntax in context would be for the Calibrate function for when it is released.

    I will try the /10 option and see how is works. Can I change this number higher or lower in order to make small adjustments?

    Thanks
    David

  5. #25
    300+ Forum Addict
    Join Date
    Feb 2008
    Location
    Krefeld, Germany
    Posts
    318
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi,
    yes you can adjust that with small changes.
    Dirk didn磘 arnswer at the moment so i don磘 know about a release date, but mid june sounds good.

    Part of the V2 Doku
    Calibrate
    Syntax int Calibrate (int val, CALTAB* t, int count)
    Sometimes it is necessary to convert a value from fsuipc into a special output value.
    Think about servo applications, where the scale of a gauge is nonlinear or the servo
    itself requires some corrections.
    This function interpolates a value out of a table which you can supply. You can add an
    arbitrary number of points to the table.
    The input value must be in ascending order!
    Example Example 1:
    the input values from 10-250 are interpolated to 0-16000
    CALTAB t[] = { {10, 16000},{ 250, 0} };
    int x = Calibrate (50, t, sizeof(t)/sizeof(LITAB));
    Example 2:
    An fsbus control (C_XY) sends a value from 10 to 220. You translate it
    into an output value from 0 to 16000.
    void EventCallback (int oid, int v)
    {
    static CALTAB t[] = { {10, 0}, {40, 3000}, {70, 5800},
    {100, 8500}, {130, 11000}, {160, 14000},
    {190, 15000}, { 220, 16000} };
    switch (oid)
    {
    case C_XY:
    Fsrite (FS_CTRL, Calibrate(v, t, ;
    break;
    }
    }
    Regardes,
    Stefan

  6. #26
    300+ Forum Addict RobiD's Avatar
    Join Date
    Sep 2007
    Location
    Gold Coast, Australia
    Posts
    430
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi Stefan,

    How would I write the Calibrate function into my code in the .h file, I think I need to use this example:

    CALTAB t[] = { {10, 16000},{ 250, 0} };
    int x = Calibrate (50, t, sizeof(t)/sizeof(LITAB));


    Where is it placed in relation to my existing code:


    void
    cbEnginerpm (int oid, int val, double dval)
    {
    switch (oid)
    {
    case FS_ENGINE1RPMScaler:
    eng1scaler = val;
    break;
    case FS_ENGINE1RPM:
    int x = (val * eng1scaler / 65536)/10;
    FsbusWrite (C_RPMSERVO, x);
    break;


    If I work this out, (with your help of course) when V2 is release, I should be able to integrate this into whatever code I have already written.

    Thanks again,
    David

  7. #27
    300+ Forum Addict
    Join Date
    Feb 2008
    Location
    Krefeld, Germany
    Posts
    318
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi,

    it is a little bit more to do.
    I give you an example from my working Flap Gauge.

    Code:
    	case FS_FLAPSINDICATORLEFT:
    		{
    			static CALTAB FLAPIndicator[] = {
    				{100,20},{420,63},{830,95},{2050,115},{4100,134},{6150,148},{10250,162},{12290,180},{16390,200}
    		};
    		val = Calibrate (val, FLAPIndicator,9);
    		FsbusWrite (CAO_Flaps, val);
    		}
    		break;
    The Array build you can also put outside the case funtion.
    The importen Step is to find out the records ({100,20}), an a scale of RPM i would do 8 to 12 pears for a smooth needle.
    How you do that??
    Put a print funtion in the code with the RPM (value of x) than you let everything run. Than you the the RMP on DosBox and can write down some needle positions.
    sample:
    RPM=1500
    Servo position of 1500RPM in your gauge=120
    you have a record of {1500,120}

    As last delete the Print funktion.

    Regards,
    Stefan

  8. Thanks RobiD thanked for this post
  9. #28
    300+ Forum Addict RobiD's Avatar
    Join Date
    Sep 2007
    Location
    Gold Coast, Australia
    Posts
    430
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Thanks Stefan, that gives me a good idea of how it works.
    The old method has worked well as the actual gauge is virtually the same as the screen when I devide by 17.

    I have now progress to the IAS but of course nothing ever goes smooth. From what I can tell, I have followed everything from the example you gave me and also the examples with the dll and I'm getting:
    gauges.cpp(6) : error C3861: 'MakeFsObject': identifier not found

    Hope you don't mind me posting the code. I know it's is probably something simple that I am just overlooking repeatedly.

    gauges.h


    #ifndef
    __GAUGES_H__
    #define __GAUGES_H__
    void cbGaugesBuildObjects();
    void cbGauges (int oid, int val, double dval);
    void BuildFsuipcObjects(void);
    #endif


    gauges.cpp

    #include
    "stdafx.h"
    void cbGaugesBuildObjects()
    {
    MkFsbusObject (BTP_A_OUT,C_IASSERVO,
    "IASGauge",cbGauges,25,80);
    MakeFsObject (FS_IAS,
    "IASGauge",cbGauges, 0x02BC, 4, TP_I32, FS_QUICK);
    }
    staticint IAS;
    void cbGauges (int oid, int val, double dval)
    {
    double dbl;
    int x;
    switch (oid)
    {
    case FS_IAS:
    if (IAS != (val/12)
    {
    IAS = val / 128;
    }
    x = 250 - IAS;
    x = x < 40 ? 40 : x;
    FsbusWrite(C_IASSERVO, x);
    break;
    }
    }


    cockpit.cpp

    #include
    "stdafx.h"
    #include
    #include

    int _tmain(int argc, _TCHAR* argv[])
    {
    int v = GetFsbusDLLVersion ();
    if (v < 100)
    {
    printf (
    "Program requires Fsbus DLL version 1.0.0 or higher\r\n");
    return 1;
    }
    CheckIn();
    FsConnect();
    FsbusOpen(
    "COM1");

    // TODO: add functions to create the fsbus software objects
    cbLLSwitchboardBuildObjects();
    cbEngineBuildObjects();
    cbMagnetoBuildObjects();
    cbEnginerpmBuildObjects();
    cbGaugesBuildObjects();

    printf (
    "press any key to exit ...\r\n");

    while (!_kbhit())
    FsbusMux(500);

    CheckOut();
    return 0;
    }


    stdafx.h


    #pragma
    once
    #include
    "targetver.h"
    #include
    #include


    // TODO: reference additional headers your program requires here
    #include
    #include"fsbus.h"
    #define OID_LLSWITCHBOARD_GROUP (1 << OID_CONTROL_BITS)
    #include"switchboard.h"
    #define OID_MAGNETO_GROUP (10 << OID_CONTROL_BITS)
    #include"magneto.h"
    #define OID_ENGINE_GROUP (2 << OID_CONTROL_BITS)
    #include"engine.h"
    #define OID_ENGINERPM_GROUP (11 << OID_CONTROL_BITS)
    #include"enginerpm.h"
    #define C_RPMSERVO OID_ENGINERPM_GROUP + 0
    #define FS_ENGINE1RPM OID_ENGINERPM_GROUP + 1
    #include"gauges.h"
    #define OID_GAUGES_GROUP (15 << OID_CONTROL_BITS)
    #define FS_IAS OID_GAUGES_GROUP +3
    #define C_IASSERVO OID_GAUGES_GROUP +0


    Hope you have time to check it out.

    Thanks again.
    David


  10. #29
    300+ Forum Addict
    Join Date
    Feb 2008
    Location
    Krefeld, Germany
    Posts
    318
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by RobiD View Post
    From what I can tell, I have followed everything from the example you gave me and also the examples with the dll and I'm getting:
    [SIZE=1]gauges.cpp(6) : error C3861: 'MakeFsObject': identifier not found
    No problem, it is:
    MakeFsObject (FS_IAS,"IASGauge",cbGauges, 0x02BC, 4, TP_I32, FS_QUICK);
    right is:
    MakeFsObject (FS_IAS, 0x02BC, 4, TP_I32, FS_QUICK);

    The part of ""IASGauge",cbGauges" you need in V2 not V1.

    Regards,
    Stefan

  11. #30
    300+ Forum Addict RobiD's Avatar
    Join Date
    Sep 2007
    Location
    Gold Coast, Australia
    Posts
    430
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Tried that and got the same error.
    Any other thoughts?

    Thanks
    David

Page 3 of 74 FirstFirst 12345671353 ... LastLast

Similar Threads

  1. Fsbus CDK
    By flyandre in forum General Builder Questions All Aircraft Types
    Replies: 4
    Last Post: 12-27-2014, 12:58 PM
  2. Need Help Getting My FSBUS NG I/O Going Again..
    By JBRoberts in forum I/O Interfacing Hardware and Software
    Replies: 14
    Last Post: 03-21-2010, 01:38 PM
  3. Fsbus ng io
    By Davral in forum I/O Interfacing Hardware and Software
    Replies: 0
    Last Post: 01-10-2009, 10:38 PM
  4. Fsbus 2.4.3
    By Anderson/SBSP in forum I/O Interfacing Hardware and Software
    Replies: 9
    Last Post: 11-30-2008, 04:25 PM
  5. Help FSBUS
    By cesarfsim in forum I/O Interfacing Hardware and Software
    Replies: 2
    Last Post: 10-26-2008, 02:23 PM

Tags for this Thread