Jump to content
The simFlight Network Forums

Goksel Sunar

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by Goksel Sunar

  1. Dear paul ,

    now work :)

     

    function PFuelCutOffSwitch()
      
       testVar = ipc.readUD(0x66C0)

    n = ipc.readLvar('L:Eng1_FuelCutOffSwitch')
         

        if logic.And(testVar,1) == 1 then    
     
        if   n==0  then
           ipc.writeLvar('L:Eng1_FuelCutOffSwitch',1)
        end

            end
    if logic.And(testVar,1) == 0 then
        if   n==1  then
        ipc.writeLvar('L:Eng1_FuelCutOffSwitch',0)
        end
     end

        
     end
     
    event.offset('66C0','UD', 'PFuelCutOffSwitch')

     

    Thank you a thousand times,

    how many times I have read pdf files, but  I've missed.

     

    I have one final question with your permission.

     

    how can I define this offsets in .net . I did like the  lights example  but  did not again :)

     

    lua code

     

    event.offsetmask(0x66C0, 8,'UD', 'Fuel_Pump')
    event.offsetmask(0x66C0, 256,'UD', 'Beacon_Light')
    event.offsetmask(0x66C0, 1024,'UD', 'Strobe_Light')

     

    c# code

     

    private Offset<BitArray> Lights = new Offset<BitArray>(0x66C0,2);

     

    // on

     

     FSUIPCConnection.Process();
                lights.Value[1] =true ; // I was   [0]...[8] I tried it a one to eight.

     

    //off

     

    FSUIPCConnection.Process();
                lights.Value[1] =false ; // I was   [0]...[8] I tried it a one to eight.

  2. Hi,

     

    I was able to write a working example code. But ,I am not sure is this the right way .

    I create a while loop in the Lua code  . Because ,I could not find a way to continuous control of the offset value.

     

    II think when the offset value is changed , automatically trigger control for it self.  am i wrong ?

     

    Because , as the first example , I do what you say , and  open the log screen and I saw the offset value changing from csharp code but nothing happened in simulation.

     

     

     

    If can  you   review  code  and write a comment , I would be hapy :)

     

     

     

    Lua Code :

     

    function PFuelCutOffSwitch(param)    

        n = ipc.readLvar('L:Eng1_FuelCutOffSwitch')

        if param == 1  and  n==0  then
           ipc.writeLvar('L:Eng1_FuelCutOffSwitch',1)
        end

        if param == 0  and  n==1  then
        ipc.writeLvar('L:Eng1_FuelCutOffSwitch',0)
        end
        
    end
     

    event.offset('0x66C0','UD', 'PFuelCutOffSwitch')

    while 1 do

    testVar = ipc.readUD(0x66C0)
    if logic.And(testVar,1) == 1 then
    PFuelCutOffSwitch(1)
    end

    if logic.And(testVar,1) == 0 then
    PFuelCutOffSwitch(0)
    end


    end

     

     

    csharp code

     

    private Offset<int> Pitot_HEAT = new Offset<int>(0x66C0);

     

    //ON

    FSUIPCConnection.Process();
                Pitot_HEAT.Value=1;
     

    //OFF

    FSUIPCConnection.Process();
                Pitot_HEAT.Value=0;
     

  3. Hi

     

    I create one lua file and assign to F6 key  in the "FSUIPC Options and  Settings"  windows and ,  if I hit F6 key in the simulation , this is working good now. 

     

    Lua Code :

     

    function Pitot_HEAT()
        
        testVar = ipc.readUD(0x66C0)
        if logic.And(testVar,1) == 1  then
                ipc.control(65858,1)
            else
                ipc.control(65858,0)
        end
    end

    event.offset(0x66C0, 'UD', 'Pitot_HEAT')

     

    I am writing c# windows forms application and , I want to access this offset and change value .

     
    I wrote this code but did not get results.

     

    c# Code:

     

    private Offset<int> Pitot_HEAT = new Offset<int>(0x66C0)

     

    //ON

     Pitot_HEAT.Value=1;
     //OFF

    Pitot_HEAT.Value=0;

     

     

     

    thank you for your interest.

     

    Goksel

     

     

     

  4. Hi ,

     

    I have a , Flight Simulator X and accelaration pack  installed in c:\fsx folder and registred copy of  fsuipc version 4.947c  on windows 8.1 pro.

     

    I copy these files to the modules directory,

     

    record to csv.lua

    ipcDebug.lua

    display_vals.lua

     

    and edit  fsuipc.ini  file.

     

    [Auto]
    1=display_vals
    2=ipcDebug
    3=record to csv

    [LuaFiles]
    1=display_vals
    2=ipcDebug
    3=record to csv

     

    I run the fsx but nothing hapend.

     

    What I'm missing or what's missing. Please help me.

     

    best regards

     

    Goksel

     

     

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.