Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello Mr Dowson,

Having solved most of the problems in my Cockpit, there still is one that I can't . I work with IOCards, maybe you know them. With the programming language I was able to make the annunciator lights work in my Lear45 pit.

There is one however that I cannot get to work properly, and it is the emergency battery. To set a warning light on, I need to be able to read out the voltage from the battery, so that when the voltage drops below 11 volts in my case, I can tell IOCards to turn on the warning light.

To do that I need an Offset code.

I can monitor the voltage with the Simkits Digital Davtron Clock, and in my screenpanel there is also a gauge that warns for low battery.

In the second, unsupported (i know, unsupported) table in the Programmer's Guide there are some Offsets I could use, like 2834 BATTERY_VOLTAGE, or 2840 MAIN_BUS_VOLTAGE.

With one of these I hoped to be able to monitor the battery voltage.

With SIOC, the programming language of IOCards i added a check for the voltage:

Var 0050, name LED26, Link IOCARD_OUT, Output 26 // emergency Battery

Var 0051, Link SUBRUTINE // Battery Status Check

{

IF V0049 = 1 (is a subroutine for the test button that makes all my annunciators light up)

{

&LED26 = 1 (is the emergency battery Led)

}

ELSE

{

IF V0052 <= ??? (Is the needed value to activate the LED)

{

&LED26 = 1

}

ELSE

{

&LED26 = 0

}

}

}

Var 0052, Link FSUIPC_IN, Offset $2834, Length 1 // Battery Voltage

{

CALL V0051 // Calculate Changes & Monitor Check Button

}

But when I read out the binary and decimal values for one of these offsets while the battery is discharging to determine what value to fill in at the line where it now says <=???, it fluctuates tremendously, from 3 to sometimes way over 300 (decimal values, give or take), and it keeps doing that.

So the led comes on now and then, when I set the value to 11 volts (more like flickering).

This doesn't work, and therefore I was hoping you could help me with an Offset code that does what I need, maybe you can add Offset 2834 to the supported list?

There surely must be more builders that can put that to good use?

Best Regards,

Jaap Both

The Lear45 Project

TESTED SOME MORE.......

Do you by any chance know where Offset $2866 is for? It is not in your list or Project Magenta's list but it seems to work. I use it with a size of 1.

With running engines I get a decimal value of 40, which is 12 volts on my panel. When I shut down the engines, and start draining the battery, the value drops very slowly to 37 at which point my panel indicates 11 volts and the warning light illuminates. Eureka! When I restart the engines, the value slowly climbs until it reaches 40 again, and stays there.

I only hope this offset does not interfere with anything else on my panel...

Posted

In the second, unsupported (i know, unsupported) table in the Programmer's Guide there are some Offsets I could use, like 2834 BATTERY_VOLTAGE, or 2840 MAIN_BUS_VOLTAGE.

Supported, now, actually. I thought they were among those I moved to the first table? If not they will be in the next update. There's quite a lot of "unsupported" data which is being provided by FSX via SimConnect, so I can safely assume it will be okay for the foreseeable future. ;-)

With one of these I hoped to be able to monitor the battery voltage.

Yes, the double floating point value at 2834 is what you need.

Var 0052, Link FSUIPC_IN, Offset $2834, Length 1 // Battery Voltage

I don't know what that is supposed to mean, but if you are trying to read it as a 1 byte integer you will get it wrong. It is an 8-byte (64-bit to be precise, floating point number, a "double" in C/C++ terms).

Do you by any chance know where Offset $2866 is for? It is not in your list or Project Magenta's list but it seems to work. I use it with a size of 1.

It is listed of course -- 2866 is part of the 8-byte (64-bit) value at 2860, the "hot battery bus voltage". You are not reading the list correctly at all I'm afraid. You are simply taking a small part of a large number. Again, I've no idea what your size of 1 means, but 2866 isn't an offset of anything at it stands, but part way through.

All those variables labelled "FLOAT64" are 64-bit floating point numbers, at the offsets given. I'm afraid I cannot predict what you will get if you take small bits of 64-bit numbers!

Regards,

Pete

Posted

Supported, now, actually. I thought they were among those I moved to the first table? If not they will be in the next update. There's quite a lot of "unsupported" data which is being provided by FSX via SimConnect, so I can safely assume it will be okay for the foreseeable future. ;-)

OK that's great. Work is never done.....

I use the listings from the SDK on your site. It is in the list of variables for FS2000 with a Token ID of 752, Float64 right? Well then I just don't know how to feed this data to SIOC, but that's not your problem. I'll have to ask the developers of SIOC.

Var 0052, Link FSUIPC_IN, Offset $2834, Length 1 // Battery Voltage

I don't know what that is supposed to mean, but if you are trying to read it as a 1 byte integer you will get it wrong. It is an 8-byte (64-bit to be precise, floating point number, a "double" in C/C++ terms).

In the list of Codes for FS2002/2004 the first column shows the offset code number, the second column shows the size, that's the Length in the above sentence and that is what Sioc asks to provide. Because there is no "size" listed in the FS2000 list, I just guessed and took 1 for Length....

sioc1.jpg

Do you by any chance know where Offset $2866 is for? It is not in your list or Project Magenta's list but it seems to work. I use it with a size of 1.

It is listed of course -- 2866 is part of the 8-byte (64-bit) value at 2860, the "hot battery bus voltage". You are not reading the list correctly at all I'm afraid. You are simply taking a small part of a large number. Again, I've no idea what your size of 1 means, but 2866 isn't an offset of anything at it stands, but part way through.

All those variables labelled "FLOAT64" are 64-bit floating point numbers, at the offsets given. I'm afraid I cannot predict what you will get if you take small bits of 64-bit numbers!

I can find value 2860 in the list for FS2000:

2860 HOT_BATTERY_BUS_VOLTAGE 757 FLOAT64 Yes

but then how is one supposed to know what else is in this? That is what I don't understand from the FS2000 list. I am no programmer, and don't know much about all this, but I do want to build and use the codes, so I hope you will apologize me for my Ignorance.

I will post a question in the Open Cockpit forums about how to feed data from the FS2000 list in to SIOC.

Thanks for your effort.

Regards Jaap Both

Posted

I use the listings from the SDK on your site. It is in the list of variables for FS2000 with a Token ID of 752, Float64 right?

Yes. "Float64" means "floating point 64 bit". It's the unit name used by FS in the same FS SDK that the Names and the Token IDs come from. That'll all be revised -- the whole of that second table will be deleted, most of the values moved into the main part. This is thanks to support for those being made "official" by Microsoft in FSX.

Since you are using the SDK (which isn't from "my site" BTW, but from Enrico Schiratti's "Dowson" page), you should also have found in there the program called "FSInterrogate" which not only shows you all these values, live, but also enables you to view them all in all supported formats, including "float64".

Additionally, you may like to look at the Logging options tab in FSUIPC options. On the right-hand side there's a facilitiy to monitor any offset, and again one of the units you can choose is "FLT64". These facilities are documented in the Advanced User's guide for FSUIPC. When you are investigating values you can get from FS it is useful to know about these things.

In the list of Codes for FS2002/2004 the first column shows the offset code number, the second column shows the size, that's the Length in the above sentence and that is what Sioc asks to provide.

But "size" is a relative term. For example, just 1 64 bit floating point number is actually 8 times longer than 1 8 bit integer ("byte"). For all I knew your line for "SIOC" may have been using bytes, words, double words or 654-bit values -- all are valid units.

Because there is no "size" listed in the FS2000 list, I just guessed and took 1 for Length....

If it needs size in bytes, then you need to know that the size is determined by the type of value: FLOAT64 is a 64-bit floating point value. 64 bits is 8 x 8 bits, so 8 bytes.

I can find value 2860 in the list for FS2000:

2860 HOT_BATTERY_BUS_VOLTAGE 757 FLOAT64 Yes

but then how is one supposed to know what else is in this?

There's NOTHING else in "this". It's a 64-bit floating point number!! There's only the 64 bits of that number in it! Your question makes no sense, sorry.

That is what I don't understand from the FS2000 list. I am no programmer, and don't know much about all this, but I do want to build and use the codes, so I hope you will apologize me for my Ignorance.

I'm afraid the FSUIPC SDK is aimed squarely at programmers. That's what "software development kit" means -- a kit for programmers doing software development. From what you say it seems to me that this "SIOC" stuff must also be aimed at folks with some technical experience? Or is their documentation just not up to scratch?

Please take a look at the tools I do provide. Play with FSInterrogate for starters, look at the various values it reads. I'm sure you'll learn a lot.

I will post a question in the Open Cockpit forums about how to feed data from the FS2000 list in to SIOC.

It isn't just that list -- browse through the values in the main list. There are plenty of "double" floating point values there too. and some of the values in the "FS2000" list are BOOL (32-bit), BOOL16 (16 bit), SINT16 (16 bit), etc. The list is simply one derived originally from the Gauges SDK for FS2000, to which some offsets have been mapped.

As I said, I'm integrating most of those into the main list. But this won't change what sorts of numbers they are.

Regards,

Pete

Posted

Okay Mr Dowson, thanks.

Especially the first part of your explanation makes some things clear.

I will certainly start with FSInterrogate, also the logging tables are a good second ( i have already been reading some of it).

It is clear that the SDK is for programmers, because of all the terms and numbers one needs to know about before starting, but when it comes to cockpit building I am a persistant little bugger, and want to learn all I can, because it is my dream to have made something by myself (Ok, most of it...). Built by trial and error if need be!

It isn't so bad already, if I may say so myself.

If you are interested, the link to my site is here

And thanks for making this possible!

Regards, Jaap Both

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.