Results 1 to 9 of 9
  1. #1
    767 builder edo17982's Avatar
    Join Date
    Jun 2008
    Location
    Milano, Italy
    Posts
    76
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Eng Low oil press indicator

    Hi Nico I wrote a code to make the L and R oil press indicators working. The only thing is that the reference variable is an FSUIPC one and I observed that the rate with which the oil pressure increase and decrease in the lvld panel is different. Also the specific leveld failure of the oil pressure leak won't influence the fsuipc var while the standard FS failure of oil press drop will do. Maybe you can improve it? Other than that it works just fine

    Code:
    Var 9001, name L_Eng_OilPress, Link FSUIPC_IN, Offset $3B60, Length 8
    {
      IF &ColdAndDark = 1
      {
        &O_LEng_Oil = 0
      }
      ELSE
      {
        IF &TestMIP = 1
        {
        &O_LEng_Oil = 1
        }
        ELSE
        {
          L0 = &L_Eng_OilPress / 144
          IF L0 <= 15
          {
            &O_LEng_Oil = 1   
          }
          ELSE
          {
            &O_LEng_Oil = 0    
          }
        }
      }
    }
    
    Var 9002, name R_Eng_OilPress, Link FSUIPC_IN, Offset $3AA0, Length 8
    {
      IF &ColdAndDark = 1
      {
        &O_REng_Oil = 0
      }
      ELSE
      {
        IF &TestMIP = 1
        {
        &O_REng_Oil = 1
        }
        ELSE
        {
          L0 = &R_Eng_OilPress / 144
          IF L0 <= 15
          {
            &O_REng_Oil = 1   
          }
          ELSE
          {
            &O_REng_Oil = 0    
          }
        }
      }
    }
    
    Var 9003, Name O_LEng_Oil, Link IOCARD_OUT, Device 1, Output 18
    Var 9004, Name O_REng_Oil, Link IOCARD_OUT, Device 1, Output 28

  2. #2
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    246
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Eng Low oil press indicator

    Im doing FSBUS but the Oil Press offset for each Eng works just fine for me and seems like they are 4 or 2 bits but i could be wrong. if you want i can post my code a little bit later.

    Trevor

  3. #3
    767 builder edo17982's Avatar
    Join Date
    Jun 2008
    Location
    Milano, Italy
    Posts
    76
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Eng Low oil press indicator

    Thank I'd appreciate. I saw that there is more than 1 var that is linked to an engine oil press. I tried all but this one is the one closest to the leveld panel behaviour.

  4. #4
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    246
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Eng Low oil press indicator

    Mine is to make LED lights to turn on and off.

    Here is my cpp

    Code:
    #include "stdafx.h"
    #include "mainpanel.h"  
    
    extern void MainpanelBuildObjects()
    {
    	MkFsbusObject(BTP_D_OUT,  C_L_OIL_PRESS_LOW,	"OID", EventHandler, 30, 6);
    	MkFsbusObject(BTP_D_OUT,  C_R_OIL_PRESS_LOW,	"OID", EventHandler, 30, 5);
    
    	MkFsObject(FS_L_OIL_PRESS_LOW,			"OID", EventHandler, 0x08BA, 2, TP_UI16, FS_QUICK);
    	MkFsObject(FS_R_OIL_PRESS_LOW,			"OID", EventHandler, 0x0952, 2, TP_UI16, FS_QUICK);
    }
    
    extern void MainpanelSync()
    {
    	int usTmp;
    
    	FsReadDirect(0x08BA, 2, &usTmp);
            EventHandler(FS_L_OIL_PRESS_LOW, usTmp, 0);
    
    	FsReadDirect(0x0952, 2, &usTmp);
    	EventHandler(FS_R_OIL_PRESS_LOW, usTmp, 0);
    
    }
    
    extern void MainpanelEventHandler(int oid, int val, double dval)
    {
        switch (oid)
        {
    		case FS_L_OIL_PRESS_LOW:
    				if (val <17199)
    				FsbusWrite (C_L_OIL_PRESS_LOW, 1);
    				if (val >17200)
    				FsbusWrite (C_L_OIL_PRESS_LOW, 0);
    			break;
    
    		case FS_R_OIL_PRESS_LOW:
    				if (val <17199)
    				FsbusWrite (C_R_OIL_PRESS_LOW, 1);
    				if (val >17200)
    				FsbusWrite (C_R_OIL_PRESS_LOW, 0);
    			break;
    
    }
    Here is my h

    Code:
    #ifndef __MAINPANEL_H__
    #define __MAINPANEL_H__
    
    enum _mainpanel {
                     C_L_OIL_PRESS_LOW = (GROUP_MAINPANEL * OBJECTS_PER_GROUP),
    				 C_R_OIL_PRESS_LOW,
    				 FS_L_OIL_PRESS_LOW,
    				 FS_R_OIL_PRESS_LOW
    };
    
    
    #endif /* __MAINPANEL_H__ */
    Hope that helps but again this is for FSBUS

    Trevor

  5. #5
    767 builder edo17982's Avatar
    Join Date
    Jun 2008
    Location
    Milano, Italy
    Posts
    76
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Eng Low oil press indicator

    did you use a divider for the vars 08BA and 0952? I did same try but at the value 17199, according to fsuipc offset list, correspond a value of 55 PSI... in the leveld the light comes on when you have a press lower than 16 PSI which should correspond at a value of 5000 in FSUIPC... In my code, during the spoolup the light goes off synchronized to the leveld one. During spooldown, the reference var of fsuipc decrease its value much more faster than the leveld panel does, so the light comes on way before the one of the panel as according to FSUIPC var, the press is below 16 PSI, but according to leveld panel it's still around 40PSI. Hope I wrote clear enough

  6. #6
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    246
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Eng Low oil press indicator

    i think i get what your saying.... Mine is for a King Air B350 andi would spool up and then when the light turns on i would then pause it and see what the value is and then write that down and used it and it works GREAT.

    Trevor

  7. #7
    767 builder edo17982's Avatar
    Join Date
    Jun 2008
    Location
    Milano, Italy
    Posts
    76
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Eng Low oil press indicator

    What I thought then...that Var works perfectly with normal FS aircrafts or those which uses the standard offset to establish the press, but I think that leveld team modeled it differently. Thanks anyway man!

  8. #8
    150+ Forum Groupie


    388TH_A's Avatar
    Join Date
    Nov 2008
    Location
    Medford, Oregon (USA)
    Posts
    246
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Eng Low oil press indicator

    and also for every aircraft the the Oil Press will be different

    Trevor

  9. #9
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Eng Low oil press indicator

    Hi Eduardo,
    Quote Originally Posted by edo17982 View Post
    Maybe you can improve it? Other than that it works just fine

    Yes I can . Not about the Oilpressure itself, but about how you drive your leds..
    In your script the OilPresure led will not take part in a Test MIP lights action. Also if the cockpit changes to and from Cold And Dark State your code will not work.
    You have to define a special subroutine that takes care of the ledcontrol. This subroutine should be called as well in the body of the FSUIPC variable as in a so-called Refresh variable that is trigggered by lekseecon when there is a state change or a lights test change.

    Here it is:


    Code:
    Var 9001 name L_Eng_OilPress Link FSUIPC_IN Offset $3B60 Length 8
    {
      CALL &OutLEngOilP
    }
    
    
    Var 9002 name OutLEngOilP Link Subrutine
    {
      IF &ColdAndDark = 1
      {
        &O_LEng_Oil = 0
      }
      ELSE
      {
        IF &TestMIP = 1
        {
          &O_LEng_Oil = 1
        }
        ELSE
        {
          L0 = &L_Eng_OilPress / 144
          IF L0 <= 15
          {
            &O_LEng_Oil = 1   
          }
          ELSE
          {
            &O_LEng_Oil = 0    
          }
        }
      }
    }
    
    Var 999
    {
      CALL &OutLEngOilP
    }

Similar Threads

  1. Break Press gauge from OC
    By Air Canada in forum General Builder Questions All Aircraft Types
    Replies: 4
    Last Post: 07-15-2010, 12:47 PM
  2. Press for current HDG/CRS
    By Tomlin in forum Computer Hardware Setup
    Replies: 5
    Last Post: 06-30-2008, 01:58 PM
  3. SYS3 board and Eng oil press
    By 767300 in forum I/O Interfacing Hardware and Software
    Replies: 0
    Last Post: 04-17-2008, 05:09 PM
  4. Press Panel annunciators
    By Olympic260 in forum PMSystems
    Replies: 9
    Last Post: 01-15-2008, 03:01 AM