Page 1 of 4 1234 LastLast
Results 1 to 10 of 737

Hybrid View

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

    Progamming help with FSBus dll

    Hi everyone,

    Can anyone give me an example of the coding for a servo (RPM gauge) in FSBus dll.

    If I can find an example, I should be able to replecate for the rest of my gauges.

    Need coding for: examplerpm.h, examplerpm.cpp, the entry in main cockpit.cpp and stdafx.h file.

    Any help would be appreciated.

    Thanks
    David

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

    Hi David,

    i make a untested sample for you, how to make your own Software please look to the Documentation page 22-24.
    I dont know what RPM you mean. In the sample i use APU_RPM (0B54)

    examplerpm.h
    Code:
    #ifndef __EXAMPLERPM_H
    #define __EXAMPLERPM_H
    
    #define OID_EXAMPLERPM_GROUP		(10 << OID_CONTROL_BITS)
    // any OID_xxx_GROUP should have a unique number, left shifted by OID_CONTROL_BITS 
    
    // declaration of all (max 32) objects of this group
    #define C_RPMSERVO		OID_EXAMPLERPM_GROUP + 0
    #define FS_APURPM		OID_EXAMPLERPM_GROUP + 1
    
    
    // declare the functions in the corresponding .cpp file
    void BuildEXAMPLERPMObjects();
    void cbEXAMPLERPM (int oid, int val, double dval);
    
    #endif
    examplerpm.cpp
    Code:
    #include "stdafx.h"
    
    void BuildEXAMPLERPMObjects()
    {
    	MkFsbusObject (BTP_A_OUT,C_RPMSERVO, 16, 80); //Servo ports are 80-87
    	MakeFsObject(FS_APURPM, 0x0B54, 4, TP_UI32,  FS_NORMAL);  //the TP_UI32 is maybe wrong it must be a FLT32
    }
    
    void cbEXAMPLERPM (int oid, int val, double dval)
    {
    
    	switch (oid)
    	{
    	case FS_APURPM:
             int x = val * 2,55;   //Servo need 0-255 as value, fo an other RPM you need a new caluculation
    	   FsbusWrite (C_RPMSERVO, x);
    	break;
    	}
    }
    additional to the given stdafx.h
    Code:
    examplerpm.h
    additional to the given parts of the cockpit.cpp
    in funktion _tmain
    Code:
     BuildEXAMPLERPMObjects();
    in funktion EventCallback
    Code:
    case OID_EXAMPLERPM_GROUP:
                 cbEXAMPLERPM (oid, val, dval);
    	break;
    I hope that helps a little bit.

    Regards,
    Stefan

  3. #3
    300+ Forum Addict RobiD's Avatar
    Join Date
    Sep 2007
    Location
    Gold Coast, Australia
    Posts
    432
    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,

    Fantastic, I really appreciate the time you have taken in this reply.

    The RPM I am referring to is the tachometer in a General Aviation plane, say a cessna or the such.

    I am using the servo board for this and it has a cid 25, RID 8

    I tried a couple of times to code this and was getting an 'object out of range' error message with '(80 - 87)' as you have indicated in the code.

    I will give your code a try and see if I can get it to work.

    Once again, I really appreciate your help.

    Regards
    David

  4. #4
    150+ Forum Groupie
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    227
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi David,

    Have you tried CID 25 RID 80.
    RID 80 is the first connector and 87 the last connector of the Servo board.

    Best regards

    Jan Geurtsen

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

    Wow, I didn't get that in the servo board documentation.

    Thank you.

    David

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

    hi,
    that is right. You can find it in the dll Docu part MakeFsbusObjekt.

    Regards,
    Stefan

  7. #7
    New Member
    Join Date
    Jun 2010
    Location
    Russia
    Posts
    4
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Progamming help with FSBus dll

    Hi!
    I also made modules for fsbus dll 2009, but the stepper motor module works only from the "Admin". What is the problem? How to solve it?

    Sorry for my English =)

  8. #8
    New Member
    Join Date
    Aug 2012
    Location
    Poland
    Posts
    3
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Progamming help with FSBus dll

    Hi Everyone
    I need some help with programming fsbus dll. I'm trying to programming master caution button, master fire warn button and sixpack in fsbus dll, but I can't find fsuipc offsets for this. Did anyone can help me find it? Or maybe someone write program for sixpack and could share it with me?

  9. #9
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Oct 2012
    Location
    Poland
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Progamming help with FSBus dll

    Hello, How to read RID for LED's ? On I/O Board? 0-63 are buttons that i can check button RIDs in FSBUS Admin... How about Output and LEDs?

  10. #10
    75+ Posting Member
    Join Date
    Jan 2012
    Location
    Bexleyheath,Kent UK
    Posts
    102
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Progamming help with FSBus dll

    Hi wozinakair

    I am struggling with that too. (at least in the ifly 737) for the default aircraft. the offsets (addresses) can be monitored in FS Interrogate. ...

    The theory being....see which address changes when the led on screen lights and use that address in your ini file for the airplane (in my case its b737ng_glareshield.ini assuming you are using the CDK)
    here's a bit of the file I mean. (again this is not my work Rob Van Djik gets all the credit ....check his site out)

    you are intersted in the entries "DOUT" (digital out)


    'FSBUS Basic (DA 2006/2007)
    'B737NG - Glareshield
    'R.F. van Dijk (intro)
    '
    'COCKPIT COMPONENTS - MCP
    '-------------------------------------------------------------------------------
    'C NAME TYPE CID RID FLAGS P1 P2 P3
    '-------------------------------------------------------------------------------
    C, CDCourseL, DISPLAY, 13, 0, LEADZERO, 3, 3, 0
    C, CDCourseR, DISPLAY, 16, 0, LEADZERO, 3, 3, 0
    C, CDIas, DISPLAY, 14, 0, , 4, 2, 0
    C, CDHeading, DISPLAY, 15, 0, LEADZERO, 3, 3, 0
    C, CDAltitude, DISPLAY, 17, 0, LEADZERO, 5, 1, 0
    C, CDVertSpeed, DISPLAY, 18, 0, , 0, 0, 0
    C, CRCourseLR, ROTARY, 3, 44, , 0, 0
    C, CRIas, ROTARY, 3, 60, , 0, 0
    C, CRHeading, ROTARY, 3, 62, , 0, 0
    C, CRAltitude, ROTARY, 3, 56, , 0, 0
    C, CRVertSpeed, ROTARY, 3, 58, , 0, 0

    C, CSFlightDirL, SWITCH, 3, 43, TOGGLE, 0, 0
    C, CSFlightDirR, SWITCH, 10, 58, TOGGLE, 0, 0
    C, CSATArmed, SWITCH, 3 , 42, NEGEDGE|TOGGLE, 0, 0
    C, CSN1, SWITCH, 3, 16, NEGEDGE|TOGGLE, 0, 0
    C, CSSpdHld, SWITCH, 3, 49, NEGEDGE|TOGGLE, 0, 0
    C, CSSpdIntv, SWITCH, 3, 46, NEGEDGE|TOGGLE, 0, 0
    C, CSChangeOver, SWITCH, 3, 47, NEGEDGE|TOGGLE, 0, 0
    C, CSVNav, SWITCH, 3, 32, NEGEDGE|TOGGLE, 0, 0
    C, CSLNav, SWITCH, 3, 34, NEGEDGE|TOGGLE, 0, 0
    C, CSLvlChg, SWITCH, 3, 18, NEGEDGE|TOGGLE, 0, 0
    C, CSHdgLock, SWITCH, 3, 19, NEGEDGE|TOGGLE, 0, 0
    C, CSVorLoc, SWITCH, 3, 33, NEGEDGE|TOGGLE, 0, 0
    C, CSApp, SWITCH, 3, 20, NEGEDGE|TOGGLE, 0, 0
    C, CSAltHld, SWITCH, 3, 21, NEGEDGE|TOGGLE, 0, 0
    C, CSAltIntv, SWITCH, 3, 39, NEGEDGE|TOGGLE, 0, 0
    C, CSVertSpdHld, SWITCH, 3, 48, NEGEDGE|TOGGLE, 0, 0
    C, CSCMDA, SWITCH, 3, 36, POSEDGE, 0, 0
    C, CSCMDB, SWITCH, 3, 38, POSEDGE, 0, 0
    C, CSCWSA, SWITCH, 3, 35, POSEDGE, 0, 0
    C, CSCWSB, SWITCH, 3, 37, POSEDGE, 0, 0
    C, CSAPDiseng, SWITCH, 3, 50, NEGEDGE, 0, 0

    C, CLFlightDirL, DOUT, 3, 00, , 0, 0
    C, CLFlightDirR, DOUT, 3, 00, , 0, 0
    C, CLMastFlightL, DOUT, 10, 33, , 0, 0
    C, CLMastFlightR, DOUT, 10, 44, , 0, 0
    C, CLATArmed, DOUT, 3, 8, , 0, 0
    C, CLN1, DOUT, 3, 07, , 0, 0
    C, CLSpdHld, DOUT, 3, 06, , 0, 0
    C, CLVNav, DOUT, 3, 5, , 0, 0
    C, CLLNav, DOUT, 3, 1, , 0, 0
    C, CLLvlChg, DOUT, 3, 4, , 0, 0
    C, CLHdgLock, DOUT, 3, 3, , 0, 0
    C, CLVorLoc, DOUT, 3, 2, , 0, 0
    C, CLApp, DOUT, 3, 15, , 0, 0
    C, CLAltHld, DOUT, 3, 14, , 0, 0
    C, CLVertSpdHld, DOUT, 3, 13, , 0, 0
    C, CLCMDA, DOUT, 3, 9, , 0, 0
    C, CLCMDB, DOUT, 3, 10, , 0, 0
    C, CLCWSA, DOUT, 3, 12, , 0, 0
    C, CLCWSB, DOUT, 3, 11, , 0, 0
    C, CLAPDisengL, DOUT, 10, 53, , 0, 0
    C, CLAPDisengR, DOUT, 10, 54, , 0, 0
    'ACCUMULATOR - MCP
    '-------------------------------------------------------------------------------
    'A NAME MIN MAX FLAGS
    '-------------------------------------------------------------------------------
    A, ACourse, 1, 360, WRAPAROUND
    A, AIas, 0, 500,
    A, AMach, 0, 99,
    A, AHeading, 1, 360, WRAPAROUND
    A, AAltitude, -100, 50000,
    A, AVertSpeed, -5000, 5000,







    but the offsets dont match the format with the ifly planes....I think its probably the different programming languages involved.......probably wrong on that .




    or have I miss understood your question?

    John
    Old, tired & broke (shouldn't be allowed out really)

Page 1 of 4 1234 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