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.