Page 17 of 74 FirstFirst ... 71314151617181920212767 ... LastLast
Results 161 to 170 of 737
  1. #161
    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

    Re: Progamming help with FSBus dll

    Not sure what you mean.

    Here is my OID details for these lights:

    #include"indicatorlights.h"
    #define OID_INDICATORLIGHTS_GROUP (3 << OID_CONTROL_BITS)
    #define C_LEDOUTERMARKER OID_INDICATORLIGHTS_GROUP +1
    #define C_LEDMIDDLEMARKER OID_INDICATORLIGHTS_GROUP +2
    #define C_LEDINNERMARKER OID_INDICATORLIGHTS_GROUP +3
    #define FS_INNERMARKER OID_INDICATORLIGHTS_GROUP +4
    #define FS_MIDDLEMARKER OID_INDICATORLIGHTS_GROUP +5
    #define FS_OUTERMARKER OID_INDICATORLIGHTS_GROUP +6

    If I comment out the outermarker code, it compiles ok (the outermarker light is on at present and paused)


    If I change FS_OUTERMARKER to +7 the error is 103, if I change it to +8, the error is 04, so it has something to do with FS_OUTERMARKER

  2. #162
    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

    Re: Progamming help with FSBus dll

    My error again. I was writing to FS_OUTERMARKER instead of C_LEDOUTERMARKER.

    Now it compiles and I'll test it.

    And of course, now it works.

    Thanks for your patience with my learning.

    Regards
    David

    PS I will soon start on the MCP. I will try to use Rob's code without change other than changing the Eventhandler format.

  3. #163
    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

    Re: Progamming help with FSBus dll

    Started on the MCP now.

    Set up Rob's code and made some minor formating changes as usual.

    Everything seems to work ok except for the AP_Altitude. Seems lots of people have trouble with this one.

    This is what Rob has and I've added the FsWrite as it wasn't writing to FSX.

    If I use the software knob with the mouse, my Display increments in 100's but does this:

    00000
    00100
    00200
    3300
    3400
    00500
    00600
    3070

    I'll stop there but you get the idea.

    If I use the physical rotary, it trys to move on the display will go to 100, 200 and then 00000 again. In the software, it won't move up, but will go down from 00000 to 99900 99800 and then 00000

    Here's Robs code:
    Code:
    
    case C_RALTITUDE:
    //EventHandler(S_RHEADING, 0, 0); // sound rotary
    Altitude += val * 10000 / 100; // val can be >1 or <-1
    // printf("Altitude %d\n", Altitude);
    FsbusWrite(C_DALTITUDE, Altitude);
    FsWrite(FS_AP_ALTITUDE, Altitude); // to cockpit display
    break;
    
    Do you have any thoughts on this.

  4. #164
    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

    Re: Progamming help with FSBus dll

    Hi,
    please donīt use Robs code so much it isnīt finished.
    Look to the FSUIPC SDK then you see the error.

    My code:
    Code:
    	case CR_APALT:
            apalt += val*100;
    		if (apalt < 0)
    			apalt = 0;
    		if (apalt > 39000)
    			apalt = 39000;
            FsbusWrite (CD_APALT, apalt);
            FsWrite(FS_AP_ALTITUDE, apalt*19975);
            break;
    define apalt als static int on top.

    Stefan

  5. #165
    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

    Re: Progamming help with FSBus dll

    Hi Stefan,

    Thanks again, you're a life saver.

    I don't really have a lot of choice for using Rob's code, as I have no other reference to use, and as I don't really know how to code (or rather, I am learning as I'm going), I have no other starting point.

    So I hope you can understand how helpful it has been that you have been so willing to help me.

    I will change to code and see how it goes.

    Gratitude,
    David

  6. #166
    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

    Re: Progamming help with FSBus dll

    Wow, there are a lot of errors in Rob's code. I've commented out pretty well everything after this piece of code and it what you have given me increments well. A few minor problems, but usable. Only problem is FSX is not writing to Fsbus.
    If I change the altitude in the software, my display doesn't update.

    There appears to be other sections of code later on that is also writing to FS_AP_ALTITUDE. When I don't comment this out, the display doesn't increment properly.


    This is probably a big ask, but if you have a working sample of a complete MCP code, would you share it with me?

    It would save lots of questions.

  7. #167
    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

    Re: Progamming help with FSBus dll

    Hey Stefan,

    Do you know if there is going to be a simple key type card like the old FSbus.

    I need more space for switches and it seem a waste to build an entire DIO board just for switches. I still have my old Key card, I guess it's is of no use with FSbus dll v2.

    Also, I was looking at the pcb layouts with the V2, and in the display pcb, there are about 6 different tabs down the bottom with some very interesting layouts for ... I'm not sure. Can you tell me what they are for (other than the obvious 6 pack and display cards).

    Thanks
    David

  8. #168
    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

    Re: Progamming help with FSBus dll

    hi,

    This is probably a big ask, but if you have a working sample of a complete MCP code, would you share it with me?
    Yes i have code for you but i only share the Rotarys and ther backway. The switches and LED you can make by your self. The reason for that isnīt i donīt what give you the code, I donīt have the code. All my code samples are from my VasFmc projekt and the Switches talk direkt to VasFmc and not to FSX.

    Code:
    case CR_APHEADING:
            aphdg -= val;
            if (aphdg > 360)
                aphdg = 1;
            if (aphdg < 1)
                aphdg = 360;
            x = (aphdg * 65536 - 180) / 360;
            FsbusWrite (CD_APHEADING, aphdg);
            FsWrite(FS_AP_HEADING, x);
            break;
    
    case FS_AP_HEADING:
    	aphdg=(val+1)*360/65536;
    	if (aphdg == 0)
                     aphdg = 360;
            FsbusWrite (CD_APHEADING, aphdg);
            break;
    
    case CR_APALT:
            apalt += val*100;
    		if (apalt < 0)
    			apalt = 0;
    		if (apalt > 39000)
    			apalt = 39000;
            FsbusWrite (CD_APALT, apalt);
            FsWrite(FS_AP_ALTITUDE, apalt*19975);
            break;
    
    case FS_AP_ALTITUDE:
            apalt =  (val / 19975);
            FsbusWrite (CD_APALT, apalt);
            break;
    
    case CR_APVSpeed:
            apvspeed += val*100;
    		if (apvspeed < -7600)
    			apvspeed = -7600;
    		if (apvspeed > 6000)
    			apvspeed = 6000;
    		FsbusWrite (CD_APVSpeed, apvspeed);
            FsWrite(FS_AP_VS, apvspeed);
            break;
    
    case FS_AP_VS:
    	apvspeed =  val ;
    	FsbusWrite (CD_APVSpeed, apvspeed);
            break;
    
    case CR_APCours:
            apvcours -= val;
            while (apvcours > 360)
                apvcours -= 360;
            while (apvcours <= 0)
                apvcours += 360;
            FsbusWrite (CD_APCours, apvcours);
            FsWrite(FS_NAV1OBS, apvcours);
            break;
    
    case FS_NAV1OBS:
            apvcours =  val;
            if (apvcours == 0)
                apvcours = 360;
            FsbusWrite (CD_APCours, apvcours);
            break;
    
    case CR_APSpeed:
    	apias -= val;
    	if (apias < 100)
    		apias = 100;
    	if (apias > 340)
    		apias = 340;
    	FsWrite(FS_AP_AIRSPEED, apias);
    	FsbusWrite (CD_APSpeed, apias);
    	break;
    
    case FS_AP_AIRSPEED:
    	apias = val;
    	FsbusWrite (CD_APSpeed, apias);
    	break;
    For Switches and LED you have enough experiance, to find the right solution.
    Also you can use Robs code, that looks ok.


    I need more space for switches and it seem a waste to build an entire DIO board just for switches.
    I donīt think so, DIO is to 80% input. If you calculate there are only 2€ (3US$) for the Outs and analog part. That is to low to make a new PCB with ONLY inputs.

    Your second question i donīt understand, can you make a drawing of the part? (use the pictures from the docu, or Robs page)

    Stefan

  9. #169
    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

    Re: Progamming help with FSBus dll

    First of all, Thank you for the code.

    I understand what you are saying about the cost of building a DIO as compared to just the input part. I guess it's more about the space or size of the board, but that's ok, I have all the parts to make another one.

    Lastly, the pcb layouts:

    If you open the pcb folder under the main FSbus dll folder, then open dsp_7.lay in sprint-Layout, at the bottom of the window you will see tabs named: Platine 1, Platine 2, Platine 3, Platine 4, Platine 1 (yes, another 1), Platine 6, AD, Platine 1 (yes, yet another 1).

    The first 1 through 4 are specifically for the 6 pack and the singles, and the 7 digit led cards.

    The remainder I have never seen before but they have me curious. The second Platine 1 looks like it is an ATC switch panel with microswitches (numbers 1 to 0 type of keypad)

    The third Platine 1 looks like a mounting card for 6 slide potentiometers. Any idea what they all are?

    David

  10. #170
    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

    Re: Progamming help with FSBus dll

    No idea, btw. i look for the first time in that file.

    Stefan

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