FSDeveloper Community

Go Back   FSDeveloper Community > Microsoft Flight Simulator development > SimConnect > SimConnect

SimConnect Use this forum for all your SimConnect related discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06 Jun 2007, 10:34
FlapsOut FlapsOut is offline
  us-texas
Location: Houston
Join Date: May 2007
Posts: 75
SimConnect Weather

I was playing around, trying to learn more about the Weather calls in SimConnect and I came up with this little 'add-on' to facilitate discussion on the SimConnect FSX Weather API calls.

Note: This is written entirely in SimConnect using C# and .Net 2.0.

http://www.innergears.com/InnerGears.zip

I think it's useful for anyone wanting to learn more about FSX and their form of METAR information. I.E. What kind of data is available?

In another thread I was talking about a METAR translator, well... This uses and displays a sort of FSX METAR translator to learn from. It's also useful in-flight to see what weather conditions your in and winds at varying altitudes.

If you try it, I'd like to see if you note the same thing as I. When I first start FSX, the FSX weather returned is sometimes really basic and out-of-date (look at the METAR time-stamp), but then slowly becomes more complete. It's like weather stations within the aircraft range bubble get filled in quickly, but world-wide weather slowly gets added. Of course, a manual call to Jeppesen for a real-world-weather update fills in the aircraft range bubble more quickly and if I let the Flight Sim run for a couple hours, it gets hard to find an airport that doesn't have weather.

Anyway. About the program:

It's written as an external application, so if anything happens, it's not likely to take your FSX with it.

Start FSX first, then the application.
The application will minimize itself on startup, because it's just for debugging. The Add-On menu should appear in FSX for the actual testing/viewing.
If you exit FSX, the Weather Add-On should automatically end itself as well.

Ok, then once FSX is started and the Weather Add-On is started and assuming that everything is set-up correctly, you should see an 'InnerGears Weather' menu item. It will be under FSUIPC if you have FSUIPC for FSX installed.

There are two items in the sub-menu.

NOAA Weather: which will popup a window allowing you to enter a known NOAA Weather ICAO, like KIAH (my favorite) This will link to a Web-Service I wrote a long time ago, and which sits on my Server in California. And, it will return a standard METAR line from NOAA. If you pull the window downward, you will see a translation of the METAR into plain English. I'm a METAR noob, so I need the translation. Notice also the Opacity up/down control which allows you to see through the control, in case you want to use it in-flight.

The other sub-menu option is:
FSX Weather: FSX Weather has two interesting buttons.
One calls for the Nearest Weather, and lets FSX figure out where you are and the nearest reporting weather station. Kinda kool.
The other button allows you to type in any ICAO in the World (like NOAA Weather) but uses the FSX Weather API to get the Weather METAR. At the bottom I display the Actual FSX METAR line that FSX gives me, and then like NOAA Weather, if you pull down the Window, you should see a translation of the FSX METAR into plain English. Like NOAA Weather, there is also an Opacity control.

Try entering in an ICAO (Airport code) near you and far away. See the Data update gaps?
Then try moving your aircraft to another airport in the world, do a weather update (FSX: World/Weather/Real-World Weather) and look at the data again.

Anyway, I'd like to hear what you think about FSX Weather and meanwhile, I'm going to go see if I can make another sub-menu item to alter the FSX METAR and feed it back in. Kind of like Active Sky.

FlapsOut

Last edited by FlapsOut; 06 Jun 2007 at 10:40.
Reply With Quote
  #2  
Old 06 Jun 2007, 13:45
FlapsOut FlapsOut is offline
  us-texas
Location: Houston
Join Date: May 2007
Posts: 75
New Discoveries in Weather

Now this is kind of interesting.

I was looking at the WeatherCreateStation API call and I added another sub-menu item called "New Weather Station".

The window that popsup allows you to enter an new ICAO (anything you like as long as it's not an existing weather station), A descriptive name, and the Latitude, Longitude and Altitude of your new weather station.

To understand the Latitude, Longitude and Altitude variables (not knowing how to calculate them yet), I added a button, so the text boxes will be filled in wherever you aircraft is at the time.

Try going to an airport that you KNOW does not have a weather station, like some po-dunk lil airport like U09.
Create a weather station there. I called it U09 with a description of 'Ft. Belnap Agency'.

Then close the window and check out the nearest weather station or enter 'U09'. You have your own little weather station and can feed it data!

I bet you could even put one out at sea and presto! Hurricane weather!

Download using the same link as above (new version of the .zip).
I'm changing it from time to time.

Hey, I bet this would be cool for mission creators too. Hmmm, Missions...

FlapsOut

Last edited by FlapsOut; 06 Jun 2007 at 13:50.
Reply With Quote
  #3  
Old 06 Jun 2007, 18:45
FlapsOut FlapsOut is offline
  us-texas
Location: Houston
Join Date: May 2007
Posts: 75
Code Frags

Unlike some peeps?

I have no problem sharing code, so if anyone needs a Code Frag on how to do this stuff?

Please let me know

Maybe? We can make a really kool weather program right here on FSDev.

FlapsOut
Reply With Quote
  #4  
Old 07 Jun 2007, 00:21
FlapsOut FlapsOut is offline
  us-texas
Location: Houston
Join Date: May 2007
Posts: 75
Add Weather to Stations

Hmmm,

I worked with Adding Weather to a Station. Docs say, just give a valid METAR and the weather will be added by the METAR Header to the correct station...

In other words, if my METAR starts with "KIAH...". It should all be good.

Problem, Some weather takes, and some is just ignored...Try a Blowing DustStorm...Does not work. >.<

I dunno what the prob is yet, so I didn't update the .zip.

I can have a Clear Sky and say KIAH +TSRA, and suddenly? It rains from a clear Blue Sky...dunno.

It Seems to switch to Custom Weather when I do that tho...thats a plus. Kind of like when Active Sky takes over...AS6 for noobsters

But, I do NOT see proper cloud switching, etc...

Another thing. You would think that with my other Add-On, that goes to any World Station and Gets the FSX METAR? That you could copy and paste that METAR into your nearest weather station...But?

It tells you 'INVALID METAR"! But? If you delete the &A altitude info directly after the ICAO Code? I.E. "KIAH&A340 ...etc" and change it to "KIAH ...etc"? Everything is taken and works fine...hmmm

FSX Weather Set? Not ready for Prime-Time?

One last detail...If I go and get the REAL METAR from NOAA Weather? It ALWAYS accepts it with no problem...go figure.

FlapsOut
Reply With Quote
  #5  
Old 07 Jun 2007, 00:26
FlapsOut FlapsOut is offline
  us-texas
Location: Houston
Join Date: May 2007
Posts: 75
On 2nd thought

I know...I was disappointed with the Set Weather on Station, but on the other hand...If anyone wants me to update my .zip file and help me figure out whats wrong?

Let me know...

Thanks,
FlapsOut
Reply With Quote
  #6  
Old 07 Jun 2007, 04:48
Horst18519's Avatar
Horst18519 Horst18519 is offline
  germany
Location: Kiel (EDHK)
Join Date: Apr 2005
Posts: 2,197
Send a message via ICQ to Horst18519
Ok, that is fascinationg information.

First of all I'd be interested how difficult it would be to create such a tool and how to do it.

Then, is it possible now to create new weather stations or is it not? I'd apreciate any progress on your work.
__________________
Regards, Thorsten

FSDeveloper moderator :: Wiki :: Downloads
My projects: flyways :: forum
Reply With Quote
  #7  
Old 07 Jun 2007, 05:35
Pete Dowson Pete Dowson is offline
  unitedkingdom
Join Date: Sep 2006
Posts: 315
Quote:
Originally Posted by FlapsOut View Post
Another thing. You would think that with my other Add-On, that goes to any World Station and Gets the FSX METAR? That you could copy and paste that METAR into your nearest weather station...But?

It tells you 'INVALID METAR"! But? If you delete the &A altitude info directly after the ICAO Code? I.E. "KIAH&A340 ...etc" and change it to "KIAH ...etc"? Everything is taken and works fine...hmmm
Unfortunately the METAR format for READING weather from FSX is not the same as that for WRITING it. This was a big source of complaint during Beta and FSUIPC weather facilities development, and Microsoft agreed it all needs sorting. But it isn't a high priority for them compared with other stuff, as you can, of course, work around it.

If you look at the METAR documentation in the SimConnect SDK you will see some of the extensions and so on added.

Quote:
One last detail...If I go and get the REAL METAR from NOAA Weather? It ALWAYS accepts it with no problem...go figure.
Because the METAR input to FSX has to accept standardised METARs from the Jeppesen/Microsoft weather service. The provision of METARs as output from FSX is new code added in FSX, replacing internal facilities using tabulated binary data which FSUIPC could use quite happily before FSX.

Regards

Pete
Reply With Quote
  #8  
Old 07 Jun 2007, 05:41
Pete Dowson Pete Dowson is offline
  unitedkingdom
Join Date: Sep 2006
Posts: 315
Quote:
Originally Posted by Horst18519 View Post
Then, is it possible now to create new weather stations or is it not?
Yes, it is just as documented in the SimConnect SDK. It was requested so that controllable real weather could be created in areas of the world bereft of weather stations. Otherwise the default interpolation between extremely distant stations can give very strange results, and at times gives up and reverts to default "global" settings which are then not only completely wrong but can cause drastic sudden changes -- the smoothing is lost.

These things were a problem in FS9 and before but could be overcome by the direct control over local wind, pressure and visibility provided through the likes of FSUIPC. Such direct control is not possible in FSX -- at least it isn't currently, though I am hopeful for the future.

ASX uses the weather station creation facility nicely to deal with ocen weather, to provide proper coverage for transAtlantic and transPacific flights, for example.

Regards

Pete
Reply With Quote
  #9  
Old 07 Jun 2007, 05:46
Horst18519's Avatar
Horst18519 Horst18519 is offline
  germany
Location: Kiel (EDHK)
Join Date: Apr 2005
Posts: 2,197
Send a message via ICQ to Horst18519
Thanks for that info, Pete. As I'm no coder I'll have to wait what you guys can do with it.
__________________
Regards, Thorsten

FSDeveloper moderator :: Wiki :: Downloads
My projects: flyways :: forum
Reply With Quote
  #10  
Old 07 Jun 2007, 17:55
BASys's Avatar
BASys BASys is offline
  scotland
Location: EGNL, Barrow-in-Furness, Cumbria, UK
Join Date: May 2006
Posts: 1,162
Hi Folks

Flapsout -
Finally got round to having a play with this, excellent work.

Works nicely for creating very localised weather.



However,
and I understand this is an FS issue,
transitions from one area to another, are instant.

i.e.
Setting localised self created wx station
to be heavy rain, & limited visibility (2miles),
then fly towards IRL airport,
with RWW, hot, unlimited vis, & sunny.

Visibility clears instantly on moving into the next cell.

Travelling in the opposite direction,
I can see clearly for miles,
the next instant,
I'm in whiteout conditions.



Rate at which weather changes over time,
apparently has no effect here,
i.e.
doesn't affect cell boundaries.



Is there any way of smoothing transitions ?



PS
How do we delete any self created test weather stations ?

EDIT
Stations are not persistent,
and disappear when innergears session is closed.


ATB
Paul
__________________

ODG Preview

I've never felt so frustrated,
died so frequently/spectacularly/or needlessly,
yet had so much fun, in a long time.

Flight's Landing Challenges

FLIGHT - Earn your wings !

Last edited by BASys; 08 Jun 2007 at 07:40.
Reply With Quote
  #11  
Old 08 Jun 2007, 16:04
FlapsOut FlapsOut is offline
  us-texas
Location: Houston
Join Date: May 2007
Posts: 75
Hi BaSys

I've observed the same things that you described.

If I understand FSUIPC correctly, I think that Peter Dowson has weather-smoothing already built into FSUIPC. You might ask him about that?

Also, remember that the program isn't a fully functional application, but rather one to play with, test, and most importantly have a point of reference when we discuss, in this case, the Weather calls to the API. It's not even a Beta, it's just a 'test-bed'.

There is of course, an API call to delete stations that you made, and by the way, it can ONLY delete stations that you made. However, if you leave the Application then the temporary stations go away anyway.

Now, if someone wants to take any of this and expand it into a working application? Then, I'd more than will to help.

In the meatime, now that I kinda understand the weather calls, I'm playing with the Facilities API calls to see what they can (and cannot) do.

Which is the subject of my next Thread.

FlapsOut
Reply With Quote
  #12  
Old 19 May 2009, 19:34
PittsburghLever PittsburghLever is offline
  us-washington
Location: Redmond
Join Date: May 2009
Posts: 15
Hi FlapsOut,

Is the source code still available? I realize that I am reviving a very old thread, but still hoping

Thanks,
Reply With Quote
  #13  
Old 11 Jul 2009, 06:59
Tim_A's Avatar
Tim_A Tim_A is offline
  england
Join Date: May 2007
Posts: 511
I've just started pulling weather data from FS for my flight planner. In the process I'm translating it back as closely as I can to "proper" METAR format, although some of the subtleties of the real METAR are lost (is there any way of determining fog and mist conditions - FG and BR, other than guessing from the visibility and temp-dewpoint spread?)

The main problem I'm having though is with weather outside the range bubble. Very often the destination airport will be out of range and so won't return any data. Is there a way of forcing FS to read the weather, or if I wait long enough, will FS get to it eventually?

Obviously knowing the destination weather is quite important to the planning process, and if FS isn't going to come up with t he goods, I'll need to resort to something like NOAA (can NOAA also deliver TAFs?)

Finally, can FS be made to identify the nearest weather station to a given lat/long? Obviously it can return the nearest weather, but if that's not available, and my destination happens not to be a weather station in its own right, it'd be handy to know the nearest.

Thx
Reply With Quote
  #14  
Old 11 Jul 2009, 09:48
Pete Dowson Pete Dowson is offline
  unitedkingdom
Join Date: Sep 2006
Posts: 315
Quote:
Originally Posted by Tim_A View Post
The main problem I'm having though is with weather outside the range bubble. Very often the destination airport will be out of range and so won't return any data. Is there a way of forcing FS to read the weather, or if I wait long enough, will FS get to it eventually?
As far as I know, the FS weather download downloads everything there is. Aren't you finding that? Of course, external weather programs may not, unless you feed them the plan.

Quote:
Finally, can FS be made to identify the nearest weather station to a given lat/long? Obviously it can return the nearest weather, but if that's not available, and my destination happens not to be a weather station in its own right, it'd be handy to know the nearest.
Use "SimConnect_WeatherRequestObservationAtNearestStati on" As described, this is used to send a request for the weather data from the weather station nearest to the specified lat/lon position. You can read the ICAO ID of the station in the response.

Regards

Pete
Reply With Quote
  #15  
Old 12 Jul 2009, 00:06
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by Tim_A View Post
The main problem I'm having though is with weather outside the range bubble. Very often the destination airport will be out of range and so won't return any data. Is there a way of forcing FS to read the weather, or if I wait long enough, will FS get to it eventually?


Thx
Although the RANGE bubble has a Max size, I believe you can set its Center with a Lat / Long setting. This would allow you to set the range way below max, which might also help with speed of response ??

Geoff
Reply With Quote
  #16  
Old 12 Jul 2009, 05:49
Tim_A's Avatar
Tim_A Tim_A is offline
  england
Join Date: May 2007
Posts: 511
My test case is a direct route from Bergen ENBR to Inverness EGPE. (330nm). I'm calling WeatherRequestObservationAtNearestStation (this is using the Managed code wrapper in C#), and passing the lat/lon of the airport reference points. With the plane at Bergen, I get back the local weather, but for Inverness I get a WEATHER_UNABLE_TO_GET_OBSERVATION exception. Similarly, with the plane at Inverness, I get the Scottish weather and the exception for Norway.

Even after half an hour, I still get the exception for the destination airport.

Code:
13:51:26 
PLAN WX OBSERVATION: %sENBR&A50 111131Z 28003KT&D304NG 200V360 02511KT&A864LG 02511KT&A1778NG 02512KT&A2693NG 03114KT&A3607NG 03520KT&A5436NG 35828KT&A7265NG 00232KT&A9094NG 35927KT&A10313NG 35414KT&A11837LG 80KM&B-1550&D2312 1ST025&ST001FLMN000N 18/11 08/00&A864 06/00&A1778 00/-2&A2693 -5/-13&A3607 -17/-32&A5436 -30/-37&A7265 -44/-49&A9094 -49/-49&A10313 -46/-49&A11837 Q1003 @@@ 30 8 25 11 | 60 6 25 11 | 90 0 25 12 | 120 -5 31 14 | 180 -17 35 20 | 240 -30 358 28 | 300 -44 2 32 | 340 -49 359 27 | 390 -46 354 14 |
Edit: Now that's bizarre: I just went into FS and looked at the map view. Mousing over both airports I couls see the weather for both places in the tooltips. So I thought, well, FS *definitely knows* the weather for both... So I tried it again in my prog, and both stations came up. Yesterday they didn't, and nothing has changed...

Last edited by Tim_A; 12 Jul 2009 at 06:50.
Reply With Quote
  #17  
Old 12 Jul 2009, 06:53
Pete Dowson Pete Dowson is offline
  unitedkingdom
Join Date: Sep 2006
Posts: 315
Quote:
Originally Posted by Tim_A View Post
My test case is a direct route from Bergen ENBR to Inverness EGPE. (330nm). I'm calling WeatherRequestObservationAtNearestStation (this is using the Managed code wrapper in C#), and passing the lat/lon of the airport reference points. With the plane at Bergen, I get back the local weather, but for Inverness I get a WEATHER_UNABLE_TO_GET_OBSERVATION exception. Similarly, with the plane at Inverness, I get the Scottish weather and the exception for Norway.

Even after half an hour, I still get the exception for the destination airport
Hmm. Strange. I've never had that sort of problem. Mind you, I've not used FSX's own downloaded weather for a long time, only ASV6.5 then ASX and now ASA.

Can you read the destination weather via the weather map (in the weather menu's dialogue)? If not, that suggests it isn't being downloaded. If you can, but SimConnect won't supply it, that suggests some sort of bug.

Please also try my WeatherSet2 program. You can read weather for any ICAO or Lat/Lon through that. It uses FSUIPC4, of course, which in turn uses SimConnect just like you.

I'm loading up FSX without ActiveSky right now, to have a look myself.

Regards

Pete
Reply With Quote
  #18  
Old 12 Jul 2009, 07:10
Pete Dowson Pete Dowson is offline
  unitedkingdom
Join Date: Sep 2006
Posts: 315
Quote:
Originally Posted by Pete Dowson View Post
I'm loading up FSX without ActiveSky right now, to have a look myself.
Okay. I loaded FSX, starting at my default location EGCC. Told it to download real weather. Ran WeatherSet2, asked for weather at EGCC -- it matched what FSX was giving me. Fine.

Asked WeatherSet2 to give me weather for JFK. It did. Not the same as EGCC and not "default" either. Looked in FSX's weather map at JFK -- the data all matched. I also saw that all other other weather stations in the neighbourhood had their own distinct weather too. This was whilst my aircraft was still parked at EGCC.

So, I thought maybe it's to do with the weather at a Lat/Lon, so I chose something a ways from KJFK and entered its Lat/Lon in Weatherset2. It came up with another distinct weather, which, when I checked, matched reasonably an interpolation of what FSX said on its map.

Now WeatherSet2 doesn't use the "Nearest Station" call to Simconnect, only the Weather At and ICAO, and the Interpolated weather, so it may be that there's a bug in that Nearest Station call only.

I suggest you get the weather for your destination using the Interpolated call. If the call I suggested is broken, I'm not sure how you can get the nearest WX station except by scanning the list yourself, working it out from the Lat/Lons. Alternatively, pretend the airport does have its own ATIS and use its ICAO id. This is what some other programs do, like, for instance, RC I think.

Regards

Pete
Reply With Quote
  #19  
Old 12 Jul 2009, 13:28
Tim_A's Avatar
Tim_A Tim_A is offline
  england
Join Date: May 2007
Posts: 511
Thanks Pete. Had to "enjoy the sunshine" with the family this afternoon, so haven't investigated further yet. I think your first comment today and my edit must have crossed, and that answered your question -- in Map view (and also the load weather dialog) I was able to see weather at both departure and destination airports, and the call in my program returned both stations.

I haven't changed my program, so I don't know why it should be different today, unless the act of looking at the map (which I hadn't done before) acted as a trigger.

I'll take a look at your WeatherSet2, and I'll also try the Interpolated weather call.

Active Sky is injecting its weather into FS, so if that's running, the only difference should be that the METAR data has come from AS's server rather than the FS/Jeppesen server, yes? It may well be doing lots of fancy things with additional levels of complexity, but a call to WeatherRequestObservation... should still get me back something recognisable (I hope) Anyhow, I wanted to have things all tickety boo with the default wx before playing around with the fancy stuff!

Thanks again

Tim
Reply With Quote
  #20  
Old 12 Jul 2009, 15:13
Pete Dowson Pete Dowson is offline
  unitedkingdom
Join Date: Sep 2006
Posts: 315
Quote:
Originally Posted by Tim_A View Post
... unless the act of looking at the map (which I hadn't done before) acted as a trigger.
I made sure I read the weather in WeatherSet2 before looking it up in the weather map, so I don't think that's the case.

I have noticed in the past that FSX's downloaded weather isn't always complete.

Quote:
Active Sky is injecting its weather into FS, so if that's running, the only difference should be that the METAR data has come from AS's server rather than the FS/Jeppesen server, yes?
Yes. But in my experience ActiveSky's downloads are a lot more consistent than FS's own.

Regards

Pete
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Simconnect with Multiplayer - Collection RADIUS & Gamespy Name Geoff_D SimConnect 21 24 Mar 2011 05:19
Weather Generation Jetliner Mission Development 20 09 Jun 2007 01:52
Ideas for Dialog / GUI Features in SimConnect DocMoriarty SimConnect 1 08 Jan 2007 18:06
SimConnect and weather Neutron SimConnect 1 01 Dec 2006 13:22
About FSX and SimConnect? guodah SimConnect 3 10 Oct 2006 03:04


All times are GMT -4. The time now is 05:13.

Kirsch designed by Andrew & Austin


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.