Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete

I would like to use offset 0BC2 for displaying the elevator trim.

I read already some posts about it.

My question is how do I write this correctly.

(FSTRIM+16384)*20/32768

For example:

D1.1=0BC2 U16 (+16384)*20/32768 ///??????

Do I have a U16 here?

Is the syntax here correct for adding and multiplying?

Many thanks

Gilles

Posted

I would like to use offset 0BC2 for displaying the elevator trim.

What would the elevator trim actually look like, displayed? Most trim gauges are simple a marker moving up and down against a scale. How would you do that in a GoFlight device?

My question is how do I write this correctly.

(FSTRIM+16384)*20/32768

Oh, I see. You want to show it as a number from 0 to 20?

D1.1=0BC2 U16 (+16384)*20/32768 ///??????

Do I have a U16 here?

Is the syntax here correct for adding and multiplying?

No and No.

Pretty much every part is wrong. 0BC2 is wrong, you missed off the X. And it's a 16-bit signed number not unsigned, so it would be S16 not U16. Please check the examples in the documentation. I don't think any of the arithmetic part is correct -- I don't know where you are reading that. And you've omitted the D... parameter to tell it how to display the result.

I really don't remember much at all about GFdisplay -- I've not had any GF displays here for 18 months and din't use them for a while before that. But I'm pretty sure the facilities i provided were nowhere near as sophisticated enough to perform three arithmetic operations at all.

Let me look at my own documentation a mo' ...

... well, it says there, explicitly in black and white, in relation to the *n multiplier and /n divisor facilities that "Only one of each, at most, is allowed—you have to combine multipliers and combine divisors if you need more."

And there's no sign of any facility to add a number to anything anywhere. Where did you read that?

The only thing I can think of is that you split the values into two parts, using a Condition -- if the value is <0 then divide by -(16384/10) or -1638.4 (I'm afraid I don't recall whether decimal places are used -- if not you'll need to approximate slighly by using -1638).

Similarly if the value is >=0 divide by 1638.4 (or 1638).

Please check through the documentation like I've just had to. Each part is documented. Just put them together. You'll need one condition now, and two lines for the display.

Regards

Pete

Posted

Thanks, you helped me a lot with that.

I think it should be then:

D1.1=x0BC2 S16 *20/32768 D02

I never know where to find the information whether it

is a U8, S8, U16, S16,.....

Where do I find that?

There is no need for adding anything, I did not correctly understand

what was meant in an earlier post

Many thanks

Gilles

Posted

D1.1=x0BC2 S16 *20 /32768 D02

Ok, but that gives -10 to +10 not 0 to 20. Is that okay? To get 0 to 20 you'd need the condition to split off negatives and positives, as I said.

I never know where to find the information whether it

is a U8, S8, U16, S16,.....

Where do I find that?

There's a list in the text, in the part using the GF166 as the example, and of course in the ful specification 9Appendix 1), under the heading "Value Types".

The text is meant to be read and the examples followed, the Appendix is the reference, the definition.

Regards

Pete

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.