• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Getting a C variable to XML

Messages
206
Country
unitedkingdom
Hi folks,

Is there a simple way to get a C variable into XML? I know the names / types of some shared C variables from a 3rd party gauge (Integrated Simavionics ISG1) on my panel and I would really like to be able to use them in my XML gauges to show current waypoint, distance, track etc etc... Unfortunately I don't have any experience in C coding or gauges so I don't know if I'm even asking a valid question here!

Cheers,
Geoff
 
I suspect you've considered this, but what about going directly to the gps module for these variables? In your application, that might be easier than going from C ++ to XML.

Bob
 
I suspect you've considered this, but what about going directly to the gps module for these variables? In your application, that might be easier than going from C ++ to XML.

Bob

Unfortunately not that simple. The ISG1 route is not the same as that in the FS9 GPS. In most cases if a flight plan has been loaded the enroute ones are the same but I also want to be able to see the SID and STAR waypoints and these are not in the GPS flight plan...

Geoff
 
I also want to be able to see the SID and STAR waypoints and these are not in the GPS flight plan...

right .... not in a stock fs9gps flight plan. I'm not familiar with ISG1, but I guess it handles all the navigation, that is, it replaces the gps.dll module? Is that correct? Does it also have its own database separate from the stock FS one?
 
Last edited:
right .... not in a stock fs9gps flight plan. I'm not familiar with ISG1, but I guess it handles all the navigation, that is, it replaces the gps.dll module? Is that correct? Does it also have its own database separate from the stock FS one?

That is correct. It has a navigation database that is updated through Navigraph and provides a basic LNAV (drives the FS AP Heading) and VNAV functionality. By it's nature it is somewhat generic but I have tweaked it to work very nicely in my B712 panel...
In the documentation it has some shared XML variables and some shared C variables. I have been using the shared XML vars to control the VNAV and LNAV modes, however, the waypoint ID and distance details are only available in C vars.
I suppose my basic question is whether there is a simple function in C to export an L: variable that can be read by an XML gauge. If so, then I'll try and cobble something together (after learning how to do it). If it's hard to do, then I'll not bother because it would probably be beyond my beginners skills!!

Geoff
 
Geoff, what you want can be done, but only within the same gauge that's creating/updating the C variables...

...meaning it cannot be done unless you have their source code. :(
 
Geoff, what you want can be done, but only within the same gauge that's creating/updating the C variables...

...meaning it cannot be done unless you have their source code. :(

Oh well, so if I was writing a C gauge I could use the shared variables (that is explicit ally why they are there) but I cannot take the value and send it to an XML variable? That's a shame. I can't read the variable into one of my own (like (A:var,xxx) (>L:myvar,xxx) in XML) and then output it somehow?

Thanks for the information.

Geoff
 
Custom C variables are not "unversally global" by default. They are only available within the gauge in which they are created, unless the coder has explicitly "exposed" them via an memory offset pointer.

While that may well be what "they" did, without further information from the gauge coder, I couldn't begin to guess whether or not they did... :o
 
Oh well, so if I was writing a C gauge I could use the shared variables (that is explicit ally why they are there) but I cannot take the value and send it to an XML variable? That's a shame. I can't read the variable into one of my own (like (A:var,xxx) (>L:myvar,xxx) in XML) and then output it somehow?
Thanks for the information.
Geoff

If your C gauge was reading a shared variable from the ISG1 module, there would be nothing to stop you from from assigning the value read to an XML LVar. Does the ISG1 unit come with documentation on the variables it can share with other C gauges?

Doug
 
Custom C variables are not "unversally global" by default. They are only available within the gauge in which they are created, unless the coder has explicitly "exposed" them via an memory offset pointer.

While that may well be what "they" did, without further information from the gauge coder, I couldn't begin to guess whether or not they did... :o

Ok, I probably didn't make that clear. In the documentation for the ISG1 gauges there are some shared XML and C vars listed. It is those that I want to use...

From the documentation:

Server:
The server gauge allows 3rd party ‘client' gauges to read some of the values held by the ISG FMS. The panel.cfg entries are as follows
GaugeXX=ISG1!Server, 1,1,1,1
Below are the shared variables 3rd party ‘client' gauges can access.

C++ gauge shared variables.

isg_active PUINT32 Flag indicating ISG1 servergauge is active and hosting theFMC data (1 - active)
isg_act_wpt_id PVOID Identifier the current active flightwaypoint (text)

Etc etc...

Geoff
 
If your C gauge was reading a shared variable from the ISG1 module, there would be nothing to stop you from from assigning the value read to an XML LVar. Does the ISG1 unit come with documentation on the variables it can share with other C gauges?

Doug

Good to hear, I thought it should be possible. I replied above with a sample from the documentation.

Next question is can you post an example syntax for that?

Now I'm off to find some documentation to teach myself the basics of C gauges..!

Cheers,
Geoff
 
Last edited:
Good to hear, I thought it should be possible. I replied above with a sample from the documentation.

Next question is can you post an example syntax for that?

Now I'm off to find some documentation to teach myself the basics of C gauges..!

Cheers,
Geoff

Geoff,

Before you head down the path of trying to learn how to build C gauges, why don't you ask Ernie if he would be willing to add XML variables for the data you are looking for...

Doug
 
Geoff,

Before you head down the path of trying to learn how to build C gauges, why don't you ask Ernie if he would be willing to add XML variables for the data you are looking for...

Doug

I've asked on the FSBuild forum a while ago and he said he might in a future update. However, having just had a quick look at some example C source codes and having a better idea of how much time learning that might take, I will contact him again and ask.
Perhaps he would consider writing a small gauge to just make the variable 'transfer' that I am looking for...

(if not, I might just put it up on the project recruiting forum because I guess it wouldn't actually be that hard or time consuming for someone who knew what they were doing!)

Geoff
 
Last edited:
Back
Top