English Rebel Posted April 20, 2013 Report Posted April 20, 2013 I read the FAQ but am still not sure I understand how the parameter values work. For instance I have a MFD with 6 buttons that are connected to a Pokeys card. JET45 software documentation shows that the offset for these buttons is 73F8. It also shows that the bit for button 1 is 0 though button 6 for which the bit is 5. So in FSUPIC I click the button and it is recognized as a Joystick button. I select Offset Setbit from the drop down list enter x73F8 and x0 for the parameter. I do the same for the button release and select Offset Clrbit with the same offset and parameter. I repeated this for the remaining five buttons progressively using x02 through x05 for the parameters but they didn't work. By trial and error I found that the following parameters worked: Button 1: x01 Button 2: x02 Button 3: x04 Button 4: x08 Button 5: x10 Button 6: x20 Now I would like to know why this works as it will assist me with understanding what I have done instead of fumbling around in the dark until I find the right answer. By the way on another panel where the software documentations says the offset is 73D5 and the bit is 7 I found that x40 worked for the parameter. Logically it would seem that the correct progression should have been 01, 02, 04, 08, 16, 32, etc. but maybe I am confusing this with something else. Thanks Alan
Pete Dowson Posted April 20, 2013 Report Posted April 20, 2013 Now I would like to know why this works as it will assist me with understanding what I have done instead of fumbling around in the dark until I find the right answer. By the way on another panel where the software documentations says the offset is 73D5 and the bit is 7 I found that x40 worked for the parameter. Logically it would seem that the correct progression should have been 01, 02, 04, 08, 16, 32, etc. but maybe I am confusing this with something else. Bits in a byte are normally numbered from 0 to 7, with bit 0 being "worth" 1 (2^0 = 1) up to bit 7 worth 128 (2^7 = 2 x 2 x 2 x 2 x 2 x 2 x 2 = 128). If you "found" "bit 7" is 0x40 (which is 64, hex 40 = 4 x 16 + 0 = 64) then whatever you are reading is numbering bits from 1 instead of 0, which is very non-standard. The FSUIPC SetBits and ClrBits controls allow you to set and clear one OR MORE bits all at the same time. The parameters for them are NOT "bit numbers" but numerical values providing the 'masks' (as they are called) of bits to be set, or cleared. So, as an example: x55 (or decimal 85), which = 0 1 0 1 0 1 0 1, means bits 0, 2, 4, and 6. So such a 'mask' will set or clear all those 4 bits. It is much more flexible (i.e. more powerful) to use masks in this way rather than bit numbers, which can only specify one bit. Please also see the FAQ on numbers, bits etc. Pete
English Rebel Posted April 20, 2013 Author Report Posted April 20, 2013 Pete I did read the FAQ but with my limited computer knowledge am still confused. Can you explain why the values I entered work? If there is a logic to them, then (as a mechanical engineer) I can grasp the concept. Thanks Alan
Pete Dowson Posted April 20, 2013 Report Posted April 20, 2013 I did read the FAQ but with my limited computer knowledge am still confused. Can you explain why the values I entered work? If there is a logic to them, then (as a mechanical engineer) I can grasp the concept. sorry, I am completely unable to explain any more simply than saying what I said. Bit 0 is the bit worth 1, bit 1 is the bit worth 2, and so on., Each higher bit is worth twice the previous one, so the top bit in a byte, bit 7, is 128. how else can I explain it? Try a simply maths course. Try 2 x 2 = 4, 2x 2 x 2 = 8 ... etc. It is that easy, really! surely much easier than learning how to use flight simulator at all? Pete
Aviation BoSs Posted July 22, 2013 Report Posted July 22, 2013 Hi, i'm building my full b744 cockpit, i need a little help as my progress is on, how to code an offset to read the output data as a reaction of a/c ?
Pete Dowson Posted July 22, 2013 Report Posted July 22, 2013 Hi, i'm building my full b744 cockpit, i need a little help as my progress is on, how to code an offset to read the output data as a reaction of a/c ? No need to post the same thing 3 times. I deleted the extra ones. I'm afraid I don't know what you mean by your question. Offsets are places in memory where data is stored for reading or writing. What do you want to do? And what do you mean by "reaction of a/c"? Pete
Aviation BoSs Posted July 23, 2013 Report Posted July 23, 2013 Well, sorry for that not enough clear phrase of the question, what i mean by the question regarding offsets; i pressed a button(input) for the landing gear comes down, but it's stuck(reaction of the A/C(aircraft) and it's the output via FSX up on that specific input that controlling landing gear handle) so in such case of building simulator cockpit i have to put that LED as indicator which monitering the state of landing gear position , in order to do that, i have to have know the offset to read the state of landing gear position(up/down/if stucked either) and here is my question, for ex. I got the an offset as You pleasent mention them,how would be the code to connect fsx and read back the state of landing gear position for me to make it as a LED indicator in my side of microcontroller interface board, regardless that hardware side, how would an example of writing a code(any language) to read back the state of whatever the system as outputs? sorry for delay
Pete Dowson Posted July 23, 2013 Report Posted July 23, 2013 i pressed a button(input) for the landing gear comes down, but it's stuck(reaction of the A/C(aircraft) and it's the output via FSX up on that specific input that controlling landing gear handle) so in such case of building simulator cockpit i have to put that LED as indicator which monitering the state of landing gear position , in order to do that, i have to have know the offset to read the state of landing gear position(up/down/if stucked either) and here is my question, for ex. I got the an offset as You pleasent mention them,how would be the code to connect fsx and read back the state of landing gear position for me to make it as a LED indicator in my side of microcontroller interface board, regardless that hardware side, how would an example of writing a code(any language) to read back the state of whatever the system as outputs? You need to download the FSUIPC SDK (Software Development Kit), and see the documentation and examples. Also look at Paul Henty's .NET DLL interface which makes things much easier if you are using a .NET language. Regards Pete
Aviation BoSs Posted July 23, 2013 Report Posted July 23, 2013 Fine, thank you :) kindly regards Morgan
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now