Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello all,

I'm currently trying to sync FSX weather between a master PC and a client IG and am having a few issues with things not working.

It's seemingly simple and I'm sure I'm just missing some FSX settings or a step or two in the process.

Anyway what I'm doing:

- Reading the METAR string out of the master by reading 2048 bytes from 0xB800

- Changing the ICAO (in this case YMML) to GLOB inside the string so as to make the settings global (have also tried leaving the ICAO intact)

- Sending the string over the network the the client and writing the 2048 bytes to 0xB000

After this, a loading screen appears on the client, seemingly loading new weather settings, but after loading the weather remains the same.

I've also tried reading 1024 bytes from 0xC400 and writing them to 0xC800 with the same result. And also setting the string using SimConnect, again same result.

Is there possibly a setting in FSX that could be overriding my weather sets? It mentions in the FSUIPC documentation that there's a facility provided to force FSX into global-only weather, but doesn't explain much more.

Does anyone have any ideas?

Posted

- Reading the METAR string out of the master by reading 2048 bytes from 0xB800

You need to follow the procedure for the "New weather Interface" and deal with the offsets in the CCxx area first -- the string you read there will otherwise be whatever is happening to be read. Or is that what you want? Are you getting the strings you think you should have?

- Changing the ICAO (in this case YMML) to GLOB inside the string so as to make the settings global (have also tried leaving the ICAO intact)

For GLOB weather to have a good effect (a repeatable effect) when writing, you need first to put the sim into Global weather mode. Have you done that? There's a facility for this in the NWI. It only needs doing when you start your interface.

Sending the string over the network the the client and writing the 2048 bytes to 0xB000

Hmm. You may need to change some of it. Unfortunately the read and write formats for FSX METARs aren't the same. I think they were programmed by different people without much liaison! Devil of a job for me to sort out when I was programming this stuff. We did get agreement from the FSX team that they would put it all right in a subsequent SimConnect update (at the beginning they promised updates for SimConnect every few months!!!).

The only definitions of the peculiar METAR formats they use are in the SimConnect SDK. If you have the Deluxe FSX you have that on the DVD. Else I would recommend the ESP one instead, it is better cross-referenced and the details are the same (ESP == FSX+Acceleration, less some aircraft and missions and things).

You are also using an FSUIPC4 facility which, to my knowledge, nobody else has actually tried since I implemented it during the FSX Beta period, over two years ago. As I think is still noted, it isn't tested well. Maybe you can turn on the Weather Logging in FSUIPC so we can see what is happening? I'd be glad to make it work if it isn't already.

Also, SimConnect logging could be useful -- it shows the actual Metar strings going back and forth too.

After this, a loading screen appears on the client, seemingly loading new weather settings, but after loading the weather remains the same.

A Loading screen? What sort of "loading" is going on? That normally only happens if the time is being changed, things like that.

The weather might be unchanged because either the Global mode hasn't been set, or, if you are writing a specific WX station, because it is slow in being interpolated with the other station weather around. You really would be best setting Global mode. Or it might be unchanged because the string formatting is wrong. The log may show an error, or the SimConnect log might.

I've also tried reading 1024 bytes from 0xC400 and writing them to 0xC800 with the same result.

There's a protocol to follow to write weather via the NWI. Just reading and writing it straight isn't enough. Aren't you referring to the (admittedly skimpy) NWI documentation -- the little TXT file and the header?

Considering the weird complexities of the METAR strings, you'd probably get further using the parametric NWI -- and in fact that would be compatible with FS9 too (so you could, at a pinch, copy weather from one to the other).

Is there possibly a setting in FSX that could be overriding my weather sets? It mentions in the FSUIPC documentation that there's a facility provided to force FSX into global-only weather, but doesn't explain much more.

Ah, you are not looking in the NWI documents, then. Check the chat about protocols and sending commands in the TXT file, and you will find the Header defines the NW_GLOBAL value for setting that mode.

Regards

Pete

Posted

Ah I see now, NWI seems like the way to go. I've educated myself.

A few questions about the process...

1. When setting the weather dynamics to zero, the readme mentions that I should write 0 first, then the command. As I understand it the whole structure has to be written at once, so does this mean I should set the uDynamics variable in the structure, write it, then set the uCommand variable, write it again, then do a process call?

2. Should I write the NW_CLEAR command every time I set the weather, or only once at application startup? Is this the same for NW_EXACT?

3. When reading out a weather structure, it mentions writing the chICAO and uSignature variables before reading, should these be written to the write area at 0xC800 or to the read area at 0xCC00?

Thanks for your help on this one, unfortunately I'm not onsite at the simulator to be able to write this stuff on the fly so I'm trying to nail everything down before I head out there!

Posted

1. When setting the weather dynamics to zero, the readme mentions that I should write 0 first, then the command. As I understand it the whole structure has to be written at once, so does this mean I should set the uDynamics variable in the structure, write it, then set the uCommand variable, write it again, then do a process call?

No. Writing it as one structure, in one Write, would work. But a lot of folks use languages which don't support structures very well, and Write things separately. I don't mean separate Process calls (which would work, but is slow and rather dangerous in case something else intervenes). If separate writes are used, since the requests are processed in order when received (via the Process call), then Parameters for Commands always need writing first.

Writing it all as one structure averts any of that complication, but makes your code a little more complex, to work with structures. That's all.

2. Should I write the NW_CLEAR command every time I set the weather, or only once at application startup? Is this the same for NW_EXACT?

No. If you Clear the weather every time you'll get horrible flashing weather effects on screen. Ugh.

If this is for FSX only, setting Global weather mode should be enough, but it is probably a good idea to CLEAR as well, to start off with a blank canvas, as it were.

For FS9 it is more complex. Unless you CLEAR every time all FS9 weather develops into Localised weather, and then GLOB fails to change it. In FS9 there's no "GLOBAL" mode. The only sure way to control FS9 weather for continuing periods is to write all of the nearby Weather stations.

If you aren't worried about FS9, it is easier. Just set GLOBAL mode -- added especially by Microsoft after our complaints about not being able to pre-determine weather properly for training purposes.

3. When reading out a weather structure, it mentions writing the chICAO and uSignature variables before reading, should these be written to the write area at 0xC800 or to the read area at 0xCC00?

Read area, of course. All the Read interaction is done in the Read area, all the Write interaction is done in the Write area. Both may be happening simultaneously. You may not even be the only program doing these things at the same time!

Regards

Pete

  • 2 months later...
Posted

Hi,

I am also trying to set the Global weather, but I am not able to succed.

I am using FSUIPC 4.50 and fsx.

Below is the FSUIPC log details.

Can you please help me?

Rajan

********* FSUIPC4, Version 4.50 by Pete Dowson *********

Reading options from "D:\Program Files\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.ini"

User Name="Kusumba Sridhar"

User Addr="kusumba@tell-e.com"

FSUIPC4 Key is provided

WideFS7 Key is provided

Running inside FSX (using SimConnect Acc/SP2 Oct07)

Module base=61000000

Wind smoothing fix is fully installed

DebugStatus=255

62 System time = 15:16:17

62 FLT UNC path = "\\VIS-CENTRE\Flight Simulator X Files\"

62 FS UNC path = "D:\Program Files\Microsoft Games\Microsoft Flight Simulator X\"

1000 LogOptions=00000000 00000001

1000 SimConnect_Open succeeded: waiting to check version okay

3266 Running in "Microsoft Flight Simulator X", Version: 10.0.61637.0 (SimConnect: 10.0.61259.0)

3266 Initialising SimConnect data requests now

3266 FSUIPC Menu entry added

3312 \\VIS-CENTRE\Flight Simulator X Files\cessna.FLT

3312 D:\Program Files\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\C172\Cessna172SP.AIR

18828 Aircraft="Cessna Skyhawk 172SP G1000"

18828 System time = 15:16:35, Simulator time = 07:12:07 (02:12Z)

19391 Advanced Weather Interface Enabled

84531 Weather Mode now = Custom

103016 Weather Mode now = Global

212016 LogOptions changed, now 00000000 00000005

221609 WRITE0 C800, 1024 bytes: 05 00 01 00 00 00 00 00 47 4C 4F 42 00 00 01 00 ........GLOB....

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 40 06 00 00 E8 03 00 00 ........@.......

221609 1F 00 00 00 03 00 00 00 E8 03 00 00 00 00 64 00 ..............d.

221609 D0 07 00 00 00 00 64 00 B8 0B 00 00 00 00 64 00 ......d.......d.

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 ................

221609 A0 0F B9 0B 00 00 06 01 00 00 E8 03 00 01 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................

221609 WRITE0 0239, 1 bytes: 20

221609 WRITE0 023B, 1 bytes: 05 .

221609 WRITE0 023E, 2 bytes: 18 1F ..

221609 WRITE0 0248, 2 bytes: 02 00 ..

Posted

I am also trying to set the Global weather, but I am not able to succed.

I am using FSUIPC 4.50 and fsx.

Below is the FSUIPC log details.

Can you please help me?

The log extract you provided only shows you sending the NW_GLOB command 5 in the first 16-bit word at C800) to FSUIPC, which merely changes the weather mode to Global (which it was in any case as you see). In order to actually set any weather you have to send it in an NW_SET, NW_SETEXACT or one of the equivalent _PENDING commands!

Anyway, I really cannot spend all the time needed to decode the binary data. Can you please enable Weather logging in FSUIPC, which will show things more clearly. I'm sure you'll see what you are doing yourself then. If you want further help also please tell me what weather you are trying to set, and what results you see which you think are wrong.

Regards

Pete

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.