Page 23 of 74 FirstFirst ... 131920212223242526273373 ... LastLast
Results 221 to 230 of 737
  1. #221
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    239
    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

    Yep your right it does work i got it to work with my COM1 display

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

    Now broadcast the comand (CID 0) and all Displays will react.

    Stefan

  3. #223
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    239
    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

    thats what im doing and it works great. Now every thing will turn off when the power to them turns off.

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

    Can you show me how you did this.

    When I turn my master avionics switch off, in the software, all the radio stack go out, by my actual radio stack stays lit.

    I'd like to also do this with my battery switch, when I turn the battery switch off in the cockpit, all the gauges ie: fuel, oil pump, fuel pump etc all turn off on the screen, but in my cockpit, the air core gauges do not turn off as they should.

    Appreciate the help from all as always.

    David

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

    Here you have my function.

    Code:
    MkFsObject(FS_BUSVOLT,"", EventHandler,  0x2834, 8, TP_DBL,  FS_NORMAL)
    
    case FS_BUSVOLT:
    		// send the voltage information as a percent value
    		// to all controllers with command 131.
    		int spannung =   (val * 100 / 24);
    		if (spannung != SpannungSave)
    		{
    			FsbusWriteFmt3 (0, 131,spannung);
    			SpannungSave=spannung;
    		}
    		break;
    The Servos you have to drive by your self.

    Stefan

  6. #226
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    239
    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

    in my .CPP i put this but this is the Offset for the Avionics but you can change it to the main Battery one if you want

    Code:
    #include "stdafx.h"
    
    void BuildRadiostackObjects ()
    {
    	
    	MkFsObject(FS_BUSVOLT, "BUSVOLTS", cbBusvolt, 0x2850, 8, TP_I64, FS_QUICK);
    }
    
    void cbBusvolt (int oid, int val, double dval)
    {
    	switch (oid)
    		{
    			case FS_BUSVOLT:
    			FsbusWriteFmt3 (0, 131, val * 100 / 24 );
    				
    		}
    }

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

    Thanks guys, I'll put it in the code and see how it goes.

    I'll let you know.

    David

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

    Finally got the time to test out the code.

    Here what is happening.

    When I start FSX, the displays (in my cockpit) are lit even though the cockpit is cold and dark in the software (there must be a syncronize command somewhere to add in).

    As I go through the start up sequence, I turn the avionics on and the displays start flashing on and off.

    When I start the engine, the displays go out.

    When I stop the engine, displays start flashing again.

    When I turn the avionics switch off, displays go off (this part is working well)

    Any ideas on what I need to tweak?

    Do you want me to post the code from the .cpp file this code is in?

    Ah, I'd do it anyway:

    Code:
    #include "stdafx.h"
    
    void cbVoltmetersBuildObjects()
    {
    	MkFsbusObject (BTP_A_OUT,C_FUELLEFT,"Left Fuel Gauge",cbVoltmeters,27,86);
    	MkFsbusObject (BTP_A_OUT,C_FUELRIGHT,"Right Fuel Gauge",cbVoltmeters,27,84);
    	MkFsbusObject (BTP_A_OUT,C_OILPRESSURE,"Oil Pressure Gauges",cbVoltmeters,27,87);
    	MkFsbusObject (BTP_A_OUT,C_OILTEMP,"Oil Temp Gauges",cbVoltmeters,27,85);
    	MkFsbusObject (BTP_A_OUT,C_MAINBUSAMPS,"Main Bus Amp Gauge",cbVoltmeters,27,83);
    	MkFsbusObject (BTP_A_OUT,C_FUELPRESSURE,"Fuel Pressure Gauge",cbVoltmeters,27,82);
    	
    	MkFsObject(FS_FUELLEFTMAINLEVEL,"Left Fuel Gauge",cbVoltmeters, 0x0B7C,4,TP_I32,	FS_NORMAL);
    	MkFsObject(FS_FUELRIGHTMAINLEVEL,"Right Fuel Gauge",cbVoltmeters, 0x0B94,4,TP_I32,	FS_NORMAL);
    	MkFsObject(FS_GENERALENGINE1OILPRESSURE,"Oil Pressure Gauge",cbVoltmeters,0x3B60,8,TP_DBL,FS_NORMAL);
    	MkFsObject(FS_ENGINE1OILTEMP,"Engine Oil Temp Gauge",cbVoltmeters,0x08B8,2,TP_I16,FS_NORMAL);
    	MkFsObject(FS_MAINBUSAMPS,"Main Bus amp Gauge",cbVoltmeters,0x282C,8,TP_DBL,FS_NORMAL);
    	MkFsObject(FS_FUELPRESSURE,"Fuel Pressure Gauge",cbVoltmeters,0x3868,8,TP_DBL,FS_NORMAL);
    	MkFsObject(FS_BUSVOLT, "BUSVOLTS", cbVoltmeters, 0x2850, 8, TP_I64, FS_QUICK);
    }
    
    void cbVoltmeters (int oid, int val, double dval)
    {
    	switch (oid)
    	{
    	case FS_GENERALENGINE1OILPRESSURE:
    		{
    			val=(val / 41);
    			
    			static CALTAB OILPRESSUREGauge[] = {
    				{0,255},{127,200},{255,0}
    			};
    			val = Calibrate (val, OILPRESSUREGauge,3);
    			FsbusWrite (C_OILPRESSURE, val);
    		}
    		break;
    
    		case FS_FUELLEFTMAINLEVEL:
    		{
    			static CALTAB FUELLEFTMAINGauge[] = {
    				{0,255},{4194304,155},{8388608,0}
    			};
    			val = Calibrate (val, FUELLEFTMAINGauge,3);
    			FsbusWrite (C_FUELLEFT, val);
    			
    		}
    		break;
    
    		case FS_FUELRIGHTMAINLEVEL:
    		{
    			static CALTAB FUELRIGHTMAINGauge[] = {
    				{0,255},{4194304,155},{8388608,0}
    			};
    			val = Calibrate (val, FUELRIGHTMAINGauge,3);
    			FsbusWrite (C_FUELRIGHT, val);
    			
    		}
    		break;
    
    	case FS_ENGINE1OILTEMP:
    		{
    			static CALTAB OILTEMPGauge[] = {
    				{0,255},{25000,0}
    			};
    			val = Calibrate (val, OILTEMPGauge,2);
    			FsbusWrite (C_OILTEMP, val);
    		}
    		break;
    
    	case FS_MAINBUSAMPS:
    		{
    			
    			static CALTAB MAINBUSAMPSGauge[] = {
    				{-60,255},{0,177},{60,0}
    			};
    			val = Calibrate (val, MAINBUSAMPSGauge,3);
    			FsbusWrite (C_MAINBUSAMPS, val);
    		}
    		break;
    
    	case FS_FUELPRESSURE:
    		{
    			static CALTAB FUELPRESSUREGauge[] = {
    				{0,255},{10,230},{16,200},{40,0}
    			};
    			val = Calibrate (val, FUELPRESSUREGauge,4);
    			FsbusWrite (C_FUELPRESSURE, val);
    		}
    		break;
    
    	case FS_BUSVOLT:
    		{
    			FsbusWriteFmt3 (0, 131, val * 100 / 24 );
    		}
    	}
    
    }
    Thanks
    David

  9. #229
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    239
    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

    I dont see any Displays in your code what Displays are you talking about?

    Trevor

  10. #230
    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 Trevor,

    I've only copied the code for the voltmeters.cpp
    The code for the displays are in various other relevant .cpp files

    The displays I have programmed are:

    Nav1 & Nav1 stby
    ADF
    XPNDR
    MCP

    all 7 seg led displays.
    The code for most of it is in this thread as Stefan has helped me with just about all of it.

    Another thing, if I turn the master battery switch off, the 7seg displays also go out as they should.

    So I just can't get them to stay lit (stop flashing) when everything is turned on and engine not running and to stay lit (not turn off) when engine is started.

    Hope I'm explaining myself clearly.

    Thanks
    David

    PS. I'm going to try Stefan's code for this later today and see how that goes.

    Code:
    MkFsObject(FS_BUSVOLT,"", cbVoltmeters,  0x2834, 8, TP_DBL,  FS_NORMAL)
    
    case FS_BUSVOLT:
    		// send the voltage information as a percent value
    		// to all controllers with command 131.
    		int voltage =   (val * 100 / 24);
    		if (voltage != VoltageSave)
    		{
    			FsbusWriteFmt3 (0, 131,voltage);
    VoltageSave=voltage;
    		}
    		break;

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