PDA

View Full Version : Negative V/S on LCD Display



Stephan Schwarz
12-18-2013, 09:52 AM
Hi Jean Luc,

I have one question regarding displaying the V/S on an LCD. I read the offset 0x73C7 from FSUIPC and multiple it with 100. For positive rates this works fine. But as soon as I have negative rates the values are wrong (f.e. -100 is shown as 25500, -200 is shown as 25400 etc.).

Do you have any hint for me?

Regards,
Stephan

jeehell
12-18-2013, 11:21 AM
Hi,

did you use a signed byte variable?

JL

Stephan Schwarz
12-18-2013, 12:08 PM
I dont think so. How can this be used?

jeehell
12-18-2013, 12:13 PM
Depends on how you access the offset...
Do you use SIOC, directly FSUIPC built-in features or else??

Stephan Schwarz
12-18-2013, 12:47 PM
The Software is Called ArcazeFSUIPCConnector, Reading the values directly from FSUIPC.

jeehell
12-18-2013, 01:00 PM
In that case I cannot help you much more as I have no knowledge of this software.
However, I believe you must be able to choose the number of bytes of the variable to read in that software. You have to select a size of one byte. If you can select a signed or unsigned type, you need to use a signed type, as you can get negative values.
You should ask the community around your hardware solution.

JL

Stephan Schwarz
12-18-2013, 05:32 PM
I was afraid you would say that :-)

Anyway, I have tried to ask the Arcaze community, buit until now without a result. I have attached a screenshot, which shows the software that allows a BCD mode and "masking" the bytes.

Maybe you may take a lok at it?

Thx,
Stephan
8463

jeehell
12-18-2013, 05:59 PM
Well I guess you could expect I do not have that enough free time to add support for ALL hardware out there...
I'm sorry but your picture is unreadable for me: in German and too small at the same time...

However if you can mask bits or do some simple maths on the value, there are ways to translate an unsigned integer to a signed one:
-If you mask the bit N°7 (counting from 0) you'll always get the absolute value.
-If you can subtract 256 to the value IF the value is at or above 128, then you also get the absolute value.
Then you find a way to put a '-' sign in front of it...

Regards,
JL

Stephan Schwarz
12-19-2013, 03:35 AM
Great I will try this today in the evening. Is there a documentation where I could have found this on my own?

And thank you once again for your great support.

Regards
Stephan

jeehell
12-19-2013, 04:39 AM
Hi

My user guide states it is a one byte integer. As for the signed part, I thought it was obvious the V/S requires the negative part...
For the rest, google has it all.

Regards,
JL

Stephan Schwarz
12-20-2013, 02:40 AM
Now I got it working using the maths formula (masikng the 7th bit did not work for any reason). Appreciate your kind support!