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

P3D v4 Gauge loading in P3d v4

My first attempt was a gauge that was to be used in just one plane. I compiled it in 64 bit, using the gauges.h that came with the P3d v4 SDK, and then entered it into the dll.xml file, and entered the gauge in a popup window for the Beech Baron.. The gauge was supposed to return one simple integer value. It did not. I removed the gauge and the entry in the dll.xml file, and removed the call in the panel.cfg.

Then I thought just go to basics first, so I compiled the Cabin Comfort sample and the gauges.h, both of which came in the SDK. I entered it into the dll.xml file, and into the Baron panel.cfg file. I placed the dll file into the P3D v4 gauges folder. Just like the SDK instructions. Only zero values show up in the cabincomfort.xml gauge. So I removed the entry to the dll.xml file and made an entry into the gauges.cfg file, like people are discussing. Now No gauges will appear in the Baron, or the Mooney Bravo for that matter. Not even the default ones. I deleted the gauge from the gauges directory, and from the Baron panel.cfg file. And removed the entry from the gauges.cfg file. There are still no gauges in the Baron or Mooney.

This simulator is just giving me fits here

Hi,

It seems to me that you don't have a clear understanding of differences between a gauge.dll that is loaded through panel.cfg and a module.dll (like Cabin Comfort example) that is loaded with DLL.XML init file.
A gauge.dll must not be included in DLL.XML and a module.dll must not be loaded/referenced in panel.cfg.

P3D v4 SDK is correct :

Code:
[Window titles]
Window00=Main Panel
Window01=Radio Stack
Window02=GPS
Window03=Throttle Quadrant
Window04=Engine Gauges
Window05=Fuel Control
Window06=Electrical
Window07=Compass
Window08=Landing View
Window09=Outside Air Temp
Window10=Mini Panel
Window11=Cabin Add the line in bold to the [Window titles] section, though note that the Window number (Window11 in this case) may be different.
                              
//-- Cabin ---------------------------
[Window11]
size_mm=225,145
position=6
visible=1
no_luminous=1
gauge01=CabinComfort!CabinComfort, 0,0 Add this entire section to the configuration file. Change the Window number if necessary.

gauge01 is an XML gauge providing the front end for CabinComfort.dll module.

In short, the XML gauge goes defined in panel.cfg and the dll module in dll.xml

I see you have already figured out this. If you are interested I can talk about the internal differences between gauges and modules, in few words.

Tom
 
Last edited:
Tom,

Thanks for the input.

Yes I understand the difference between the two. In this case, I am trying to make the Cabin Comfort dll work, just as a test to build from. I have created dll modules before and made them work without problem in Flight Simulator X and older version of P3D.

My problem is I compiled the cabin comfort sample in 64 bit, and this time I used the command line to register it in P3D v4:

CD C:\FS\Prepar3D v4\
Prepar3D.exe "-Configure: Category=DLL, Operation=Add,FileLocation=Roaming,Title=Cabin Comfort,Path=C:\Programming\Cabin_Comfort.dll"


It made the entry in the dll.xml as expected. But the dll file still does not return any values. Just '0'. I even tried changing the function GetPropertyValue() to return a fixed number, and still I just get 0.

I do not understand why this simple thing does not work.

I have not tried to create a standard gauge yet (which I assume would have to be added to the gauges.cfg), but the panel now is set up to use the mixed mode method, where I am passing both 'L' values and string values to the XML gauge.

This is really frustrating. FS X was so easy by comparison.
 
Yes I understand the difference between the two.

Oh Ok. It's that this statement from you:

"...So I removed the entry to the dll.xml file and made an entry into the gauges.cfg file, like people are discussing...."

just confused me. Glad you are aware it is not possible to include Panel/Aircraft/Gauge Callbacks like those in Cabin Comfort example within typical gauges.

As for the reasons the module is not working for you, well, it should.
I'm sure you noticed now (x64) there are two versions of each (string) GetProperty and SetProperty functions; one with standard (LPCSTR* pszValue) parameter and the other with (LPCWSTR* pszValue)
You must use the sames as for x32, (LPCSTR* pszValue) ; the others must be present and "empty" (return false).

Besides, check that you have Visual C++ x64 Runtime version, 2015 and up.

Tom
 
I tried to get a Float value to work as well, but it still only returns zero. I also tried to get an 'L' value to work. Still no go.

I have the VS 2015 runtime installed. But I am compiling in VS 2008, so I would not think that would matter. Or is it simply not possible to make modules like Cabin Comfort and standard gauges to work with pre VS 2015 compilers? If it compiles, using the new gauges.h that Lockheed Martin provides, I would not think it would matter.

If this is a problem I could certainly upgrade to the newest Visual Studio, which now is VS 2017. Since I am using 2008 I should probably be thinking about that anyway. I just hate the headaches making legacy code work in new versions of VS. I assume that VS 2017 would work, and it is not "VS 2015 or nothing" if the compiler really is an issue.

Do you think the compiler is the issue with a non-SimConnect gauge?
 
You are correct, the version of VS does not matter; the exception being if you are compiling against SimConnect.lib for P3Dv4. Then you must use VS2015.
 
I was not following up on this due to a death in the family.

Hate to keep bringing this up, but I have tried everything. I compiled the Cabin Comfort sample in 64 bit using Visual Studio 2017. I entered it into the dll.xml file using the configuration command line, as outlined in the Lockheed Martin website:

Code:
"C:\FS\Prepar3D v4\Prepar3D.exe" "-Configure: Category=DLL, Operation=Add, FileLocation=Roaming, Title=Cabin Comfort, Path=C:\FS\Prepar3D v4\Velox\Drivers\Cabin_Comfort.dll, Active=True"

It shows up in the dll.xml file like so:

Code:
<?xml version="1.0" encoding="UTF-8"?>

<SimBase.Document Type="AceXML" version="4,1">
    <Descr>AceXML Document</Descr>
    <Launch.Addon>
        <Name>Cabin Comfort</Name>
        <Path>C:\FS\Prepar3D v4\Velox\Drivers\Cabin_Comfort.dll</Path>
    </Launch.Addon>
</SimBase.Document>

I call the cabin comfort xml file in the aircraft and all I get is this:

Cabin.jpg


I have even tried putting fixed numerical values in the dll for bank angle, etc., like '21', for example. All I get are zeros.

Is it possible that the cabin comfort sample is just plain wrong and will not work in P3d V4 like it did in previous versions.

This is driving me nuts. I need a dll file that can send string values to an XML gauge. But this does not seem to be able to communicate with the simulator at all.

!??!
 
Have you checked the ContentErrors.txt file that is saved when exiting Prepar3D (providing you have enabled content checking)?

Just yesterday I tried adding a known-to-work .dll to the DLL.XML file and guess what? P3D can't find it!
[error.8]
error=Gauge file not found: XMLTools64!LocalVarsLogger
I've tried dropping a copy of the virgin DLL.XML file in the other two places P3D looks, AppDate/Local and P3D root to no avail... o_O
 
Problem was nothing seems to work unless you use VS 2015. Compiling with VS 2017 will not work. Perhaps it would with some extensive configurations, but its not worth the trouble. I just download VS 2015 and compiled it, without any changes. Works fine.

I am rather flabbergasted that it would not work with the newest version of Visual Studio.
 
Well, when L-M developed the P3Dv4.x SDK, VS 2017 was apparently not yet generally available. So the header files in the SDK were aimed towards VS 2015.
 
Dai, I am about 2.6 light years behind the times with gauge coding as I've spent the past six years primarily poly-bending and performing systems integration in the models.

As a result, I have no idea what is on those two pages is supposed to be corrected. If you'd like to author a précis on the error(s) in the SDK, I'd be delighted to forward such to the L-M Prepar3d team. :wave:
 
I think this will do as a bug report?

Code:
In the Mixed Mode sample, where it instructs you to copy across the panel.cfg file for the Mooney Bravo, if you do this then all of the 2D windows disappear. 
This appears to be because the panel.cfg file in the mixed mode sample has far more windows assigned to it than the default panel in P3D. Instead, just add 
the following lines to the existing panel.cfg file:

Under [Window Titles] add

Window06=Cabin

Above [vcockpit01] add

//-- Cabin -------------------------------------------------
[Window06]
size_mm=225,145
position=6
visible=1
no_luminous=1
gauge01=CabinComfort!CabinComfort,  0,0

Finally, when you start P3D make sure that all of the Mooney Bravo’s VC windows are turned OFF. If you do not, the Cabin Comfort gauge will not appear.
 
Thanks, I'll report this verbatim to the P3D team so they can correct the SDK text.
 
One of the guys in my team at work was recently in LMCO Orlando and needed to talk to the P3D guys. Of course, he had to wind me up - first I find a free access pass for a P3D package left on my computer keyboard, then when he got back from his next assignment he took great pleasure in telling me that they let him have a go in the 6DOF F35 training sim!! I've told him he's off teh Christmas card list 4evah :mad:
 
Oh my! What a cruel and wicked thing by which your ex-compatriot chose to torture you! :rotfl:

NOTE: I just checked the forum at Prepar3D and Rob McCarthy replied with "Thanks" and that it will be corrected in the next SKD release. :wave:
 
Last edited:
Back
Top