Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete

I should indicate IAS from PMDG737NGX offset $6524 (4) in my homecockpit. The value comes out in flt32 format. I should send it to my IAS/MACH display as an integer from 100 to 340. Up to now I did not find an easy way to do that, because I am not really familiar with floating point variables and its conversions. Can you recommend me some procedure? Thanks a lot for help.

Urs

Posted
6 minutes ago, Alpin-Flier said:

I should indicate IAS from PMDG737NGX offset $6524 (4) in my homecockpit. The value comes out in flt32 format. I should send it to my IAS/MACH display as an integer from 100 to 340. Up to now I did not find an easy way to do that, because I am not really familiar with floating point variables and its conversions. Can you recommend me some procedure?

In what language?

Are you sure the IAS is not also available in the normal place even for PMDG aircraft? I'm sure PMDG stll actually use the flight simulation part of FS, they don't only use it as a graphic display vehicle. Take a look at 02BC which is an integer x 128.

Pete

 

Posted

The displays of my MCP are driven by SC-Pascal, which is a derivate of original Pascal. There is a definition for real variables called "single", that could correspond to FLT32:

"A real variable is the one that contains decimals. Depending on the range, it can be negative or not;  Single          1,5E-45  to   3,4e38    bytes 4   "

But when I try to send the flt32 value as single to the display, there is shown only some rubbish. Not very astonishing because there are different definitions for floating point variables.

Then I had a look to 02BC, but this seems to be the actual air speed of the plane, not the preset one in the mode control panel that I need. 

Best regards

Urs

 

Posted
1 hour ago, Alpin-Flier said:

The displays of my MCP are driven by SC-Pascal, which is a derivate of original Pascal. There is a definition for real variables called "single", that could correspond to FLT32:

"A real variable is the one that contains decimals. Depending on the range, it can be negative or not;  Single          1,5E-45  to   3,4e38    bytes 4   "

But when I try to send the flt32 value as single to the display, there is shown only some rubbish. Not very astonishing because there are different definitions for floating point variables.

I don't know Pascal at all, but in C/C++ and I think even Basic, just copying the number to a variable of the other type will convert it for you. Of course you lose any factions, so in C/C++ I would do:

int myias = origias + 0.5;

or, to stop warnings from the compiler,

int myias = (int) (origias + 0.5);

This latter trick is called "coercion".

There must be a way of doing it in Pascal. it maybe by using a function. Don't you have any references? Otherwise isnt there a support forum for your product or language?

1 hour ago, Alpin-Flier said:

Then I had a look to 02BC, but this seems to be the actual air speed of the plane, not the preset one in the mode control panel that I need. 

Ah, sorry. You'd didn't say in your first post that it was an MCP value. That's different for sure with PMDG.

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.