carlosheviad@gmail.com Posted February 9, 2021 Report Posted February 9, 2021 Good morning Pete If I send a value of -4096 to activate the reversals to offset 0x088C, I see that the value it actually receives is positive 61441, what am I doing wrong? thank you very much
John Dowson Posted February 9, 2021 Report Posted February 9, 2021 3 hours ago, carlosheviad@gmail.com said: If I send a value of -4096 to activate the reversals to offset 0x088C, I see that the value it actually receives is positive 61441, what am I doing wrong? How are you setting this value? What FS and version of FSUIPC are you using? And how are you reading the value? The maximum value of a 2byte signed integer is 32767 it looks like you are reading it wrong, maybe as an unsigned integer? The maximum value held in this offset should be +16384 (as described in the documentation).
carlosheviad@gmail.com Posted February 9, 2021 Author Report Posted February 9, 2021 Thanks Pete for the quick reply I am programming my cocpit for Prepard 3D V5 with FSuipc 6 with Sioc scripts, the positive values are correctly received, from 0 to 16384, but when passing the negative sign, (if I send -1 it receives 0), (if I send -2 it receives 65535 positives), (- 3 = 65532) Thanks Pete
John Dowson Posted February 9, 2021 Report Posted February 9, 2021 7 minutes ago, carlosheviad@gmail.com said: Thanks Pete for the quick reply Its John. not Pete... 8 minutes ago, carlosheviad@gmail.com said: but when passing the negative sign, (if I send -1 it receives 0), (if I send -2 it receives 65535 positives), (- 3 = 65532) As I said, how are you reading these values? Offset 088C is a 2 byte signed integer, and can therefore only hold values from -32768 to +32767. If you are seeing numbers larger than this, you are reading it as an unsigned 2 byte integer which has a range of 0-65535. You can verify this by logging the offset as both an S16 and an U16 using FSUIPC's offset logging.
carlosheviad@gmail.com Posted February 9, 2021 Author Report Posted February 9, 2021 Thanks again John, I was so anxious with the answer that I did not pay attention to who answered me, sorry, now I understand perfectly what is happening and I will try to remedy it Thank you
carlosheviad@gmail.com Posted February 9, 2021 Author Report Posted February 9, 2021 Indeed John, read with Fsuipc an S16 the value is correct, an U16 is not Thank you
Recommended Posts