Jump to content
The simFlight Network Forums

GFdisplay programming


 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.