Jump to content
The simFlight Network Forums

oneaokguy

new Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Seattle

oneaokguy's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Conversation Starter Rare
  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. Follow-up question on the values I should expect for each engine pump. It was my understanding from documentation that a value of 1=on and 0=off should be expected for each but I'm getting the following Pump1 - 0=off and 1=on Pump2 - 0=off and 2=on Pump3 - 0=off and 4=on Pump4 - 0=off and 8=on The On value seems wrong since we are dealing with one bit, so I must have an error again in my understanding and my logic for displaying the value after switch is on I'm using the following display code to see the value for each pump before and after flipping switch in FSX using the earlier ipc.read and logic.and code, the full function is listed below. ipc.display(Pump2,3) Full Function function Eng2_Fuel_Pump_On() Pump2=ipc.readUB(0x3125) Pump2x=logic.And(Pump2, 0x2) ipc.display(Pump2x,1) ipc.sleep(3000) ipc.control(66341) ipc.sleep(3000) Pump2a=ipc.readUB(0x3125) Pump2z=logic.And(Pump2a, 0x2) ipc.display(Pump2z,5) end As I shared earlier, I'm new in thinking on binary terms and I was trying to understand the highlighted example to better understand this logic routine, but I'm not understanding why the below holds true and may be where my error lies in thinking I can display this value. Are you able to explain why those two binary values = 0010? I'm I somehow adding bits when I am displayng the value for each pump?
  2. Thanks, I had totally missed the logic library and needed that missing piece. Let me add that logic and see if I have any follow-up questions. As an aside, my documentation might be outdated and this might have already been corrected, but the callout on my FSUIPC Offset cheat sheet for 3125 looks wrong and should read 2^3 for engine #4 which makes more sense now with 8 bit address. If that has not been updated, suggest it be amended.
  3. I'm new to using offset and counting in binary, so my issue may be my full understanding of Hexidecimal and bits work. I'm trying to read the status of Fuel pump in FSX. with aircraft with 4 engines and I beleive that I am getting cthe orrect results when using offset 3104 which only appies to one engine as follows n=ipc.readUB(3104). I'm getting expected result of 1= on and 0 = off. My quetion is surrounding using same logic but now with offset 3125. My understanding which may be flawed, is that memory location 3125 is an 8 byte location and I think that bit location 1 (2^0) has engine one information, bit location 2 (2^1) has engine two information, bit location 4 (2^2) as engine three information and finally bit location 16 (2^4) has engine four information? My questions are: My inital thought above was that I am dealing with an 8 byte memory location, but my engine 4 logic (2^4) is calculating a bit 16 location so I think my logic is flawed, how I'm I thinking wrong? How do I fill out the ipc.readUB(offset) when only wanting one specific bit location? I think I need to use a mask, but not sure syntax to use? For engine three for example, would it be n=ipc.readUB(3125&04)? I'm I correct that I should expect to to get the same results as offset 3104 for each engine of 1= on and 0 = off? Thanks
×
×
  • 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.