Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

I'm quite new to IPC, and i'm wondering if anybody knows how to read the CDU offsets of the QOTS2 v3 because the documentation only gives me the offsets.

I only want to read the left CDU (5400-57FF) for now, but i'm only getting some weird formatted gibberish from IPC.....

I'm running FSUIPC 4.974b with FSX:SE

 

Best regards and thanks before,

Fabian Gallinat

Posted
1 hour ago, the.gamer112 said:

how to read the CDU offsets of the QOTS2 v3 because the documentation only gives me the offsets.

Did you enable CDU broadcasts as instructed in the Offsets PDF?

As with most all of the offsets populated from PMDG aircraft, the format of the data is documented by PMDG, not by us (it is their aircraft after all).  This would be in the .h document referenced right at the start of the Offsets PDF.

Pete

 

 

Posted
5 minutes ago, Pete Dowson said:

Did you enable CDU broadcasts as instructed in the Offsets PDF?

Yup

6 minutes ago, Pete Dowson said:

As with most all of the offsets populated from PMDG aircraft, the format of the data is documented by PMDG, not by us (it is their aircraft after all).  This would be in the .h document referenced right at the start of the Offsets PDF.

I know, but since i'm using FSUIPC offset, for which the documentation in this case unfortunately are unclear I hoped you could help me out.

(My biggest issue is the formatting)

I assume this is the part I should get my info out of?

 

struct PMDG_747QOTSII_CDU_Cell
{
    unsigned char    Symbol;            
    unsigned char    Color;                    // any of PMDG_747QOTSII_CDU_COLOR_ defines
    unsigned char    Flags;                    // a combination of PMDG_747QOTSII_CDU_FLAG_ bits
};

// 747QOTSII CDU Screen Data Structure

#define CDU_COLUMNS    24
#define CDU_ROWS    14

struct PMDG_747QOTSII_CDU_Screen
{
    PMDG_747QOTSII_CDU_Cell Cells[CDU_COLUMNS][CDU_ROWS];    
    bool Powered;                            // true if the CDU is powered
};

 

I tried reading the offset at 4500 as str and this is the rawstring my function returns:

\x00\x00 \x00\x00N\x00\x00 \x00\x00N\x00\x00 \x00\x00N\x00\x00 \x00\x00N\x00\x00 \x00\x00N\x00\x00-\x00\x00<\x00\x00 \x00\x00 \x00\x00I\x00\x015\x00\x00I\x00\x015\x00\x00I\x00\x015\x00\x00G\x00\x015\x00\x00G\x00\x015\x00\x00-\x00\x00I\x00\x00 \x00\x00 \x00\x00R\x00\x011\x00\x00R\x00\x011\x00\x00R\x00\x011\x00\x00P\x00\x011\x00\x00P\x00\x011\x00\x00-\x00\x00N\x00\x00 \x00\x00 \x00\x00S\x00\x01\xb0\x00\x00S\x00\x01\xb0\x00\x00S\x00\x01\xb0\x00\x00S\x00\x01\xb0\x00\x00S\x00\x01\xb0\x00\x00-\x00\x00D\x00\x00 \x00\x00 \x00\x00 \x00\x002\x00\x00 \x00\x002\x00\x00 \x00\x002\x00\x00 \x00\x002\x00\x00 \x00\x002\x00\x00-\x00\x00E\x00\x00 \x00\x00 \x00\x00L\x00\x016\x00\x00C\x00\x016\x00\x00R\x00\x018\x00\x00L\x00\x018\x00\x00R\x00\x018\x00\x00-\x00\x00X\x00\x00 \x00\x00 \x00\x00 \x00\x00.\x00\x00 \x00\x00.\x00\x00 \x00\x00.\x00\x00 \x00\x00.\x00\x00 \x00\x00.\x00\x00-\x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x003\x00\x00 \x00\x002\x00\x00 \x00\x003\x00\x00 \x00\x003\x00\x00 \x00\x003\x00\x00-\x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00-\x00\x00 \x00\x00 \x00\x00P\x00\x00 \x00\x00W\x00\x00 \x00\x00W\x00\x00 \x00\x00W\x00\x00 \x00\x00W\x00\x00 \x00\x00W\x00\x00-\x00\x00 \x00\x00 \x00\x00O\x00\x00 \x00\x000\x00\x00 \x00\x000\x00\x00 \x00\x000\x00\x00 \x00\x000\x00\x00 \x00\x000\x00\x00-\x00\x00 \x00\x00 \x00\x00S\x00\x00 \x00\x000\x00\x00 \x00\x000\x00\x00 \x00\x000\x00\x00 \x00\x000\x00\x00 \x00\x000\x00\x00-\x00\x00 \x00\x00 \x00\x00 \x00\x00 \x00\x00'

Posted
2 hours ago, the.gamer112 said:

since i'm using FSUIPC offset, for which the documentation in this case unfortunately are unclear I hoped you could help me out.

I have never used the facilities. The offset validity was checked for me by actual PMDG aircraft users, which i am not.   All FSUIPC does is receive the complete lot of data from the PMDG code, via Simconnect, and i map it with no change, no editing, directly into the offsets areas. I then spent a lot of time working out where that placed everything in FSUIPC memory. I don't know what most of it is, that's defined by PMDG.

This is as a simple service to PMDG users wanting to interface hardware and so on to their aircraft. In the past many aircraft mafers have actually done this themselves directly, using offset space assigned when they applied.

If the documentation provided by PMDG is not enough (and it is a bit flimsy I agree), remember it was written by programmers for programmers. I'm sure folks over in the PMDG forum might help clarify terms you are unfamiliar with. If you ask specific questions about it here I could halp i expect. But you need to refer to the PMDG document and work out what it is you don't understand.

2 hours ago, the.gamer112 said:

I tried reading the offset at 4500 as str and this is the rawstring my function returns:

Your data shows it isn't being read as a "string" because strings are terminated by zeros (your \x00). 

You need to match what you read to whatever the PMDG aircraft supplies.  It isn't all strings. In your program you need to use what the PMDG document provides, in other words this, from your message above (I don't have the original file to check):

 

struct PMDG_747QOTSII_CDU_Cell
{
    unsigned char    Symbol;            
    unsigned char    Color;                    // any of PMDG_747QOTSII_CDU_COLOR_ defines
    unsigned char    Flags;                    // a combination of PMDG_747QOTSII_CDU_FLAG_ bits
};

// 747QOTSII CDU Screen Data Structure

#define CDU_COLUMNS    24
#define CDU_ROWS    14

struct PMDG_747QOTSII_CDU_Screen
{
    PMDG_747QOTSII_CDU_Cell Cells[CDU_COLUMNS][CDU_ROWS];    
    bool Powered;                            // true if the CDU is powered
};

Then read the correct number of bytes into a struct PMDG_747QOTSII_CDU_Screen which you've defined, length  sizeof(struct PMDG_747QOTSII_CDU_Screen).

Only then might you make any sense of it.

I'm afraid I am of no help regarding the data itself. I've never used any PMDG aircraft. I can only advise about programming, and then only in C.

Pete

 

 

Posted
3 hours ago, Pete Dowson said:

I'm afraid I am of no help regarding the data itself. I've never used any PMDG aircraft. I can only advise about programming, and then only in C.

Oh, I see. Thanks for giving me somesort of direction Pete.

I'll see what PMDG can do for me then.

Have a nice day 😉

Posted
On 5/22/2019 at 8:17 PM, Luke Kolin said:

Do you have the right encoding? These are 16-bit unicode characters IIRC.

The way to request it out of IPC is (in lua):

text, powered = ipc.readStruct("5400","1215STR")  --read 1215 character string from offset 5400 (Left CDU)

 

after decoding from unicode-escape the text is formatted as followes:

symbol(as string), color(hex), flags(x01, x02 or x04 not sure if combinations possible)

so, as an example:

0\x00\x01 would show a small 0 in default color (green on monochrome screen, white on LCD)

F\x02\x04 would show a normal F in dark green (dark because of the x04 flag, inop/unavailable)

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.