Jump to content
The simFlight Network Forums

What FSX or Prepar3D versions can support to write Viewpoints?


Recommended Posts

Hello Sir,

 At present, I am using FSX DVD for Windows XP and your FSUIPC 4.

We want to use our simulator through FSUIPC to interface FSX or

Prepar3D  and FSX or Prepar3D are  just as  the Visual Scenery.

Questions: What versions FSX or Prepar3D, can we write our

simulator Latitude, Longitude, Altitude, Pitch, Bank, Heading values

through FSUIPC to pass these Latitude, Longitude, Altitude, Pitch, Bank,

Heading as Viewpoints Values to FSX or Prepar3D?  

   THANKS!

 

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

2 hours ago, yindengxie said:

At present, I am using FSX DVD for Windows XP and your FSUIPC 4.We want to use our simulator through FSUIPC to interface FSX or Prepar3D  and FSX or Prepar3D are  just as  the Visual Scenery.

Questions: What versions FSX or Prepar3D, can we write our simulator Latitude, Longitude, Altitude, Pitch, Bank, Heading values through FSUIPC to pass these Latitude, Longitude, Altitude, Pitch, Bank, Heading as Viewpoints Values to FSX or Prepar3D?

You've posted this in different forms all over the place. And the answer is:

None.

Why a "viewpoint"? A viewpoint is detached from the aircraft! You can control those things for the aircraft -- the user aircraft! Surely that is what you want really? That's what other programs using DSX/P3D visuals do for an external simulator.

But really I think you ought to investigate the provisions made by Lockheed-Martin for just such operations, through their software Development Kits (SDKs). That would be much more efficient. FSUIPC is a compatibilty layer for older programs -- why not move forward?

Pete

 

Link to comment
Share on other sites

Dear Mr. Pete Dowson,

   Thank you very much for your supports for my question!

   I clarify my question  as follows:

  We  have our  simulators and  just want to use FSX or P3D  as  the Visual Scenery.

  Questions: Is it possible that we  send (write) our simulator output values: Latitude,

  Longitude, Altitude, Pitch, Bank, Heading through your FSUIPC  to FSX or P3D?

  THANKS! 

 

 

Link to comment
Share on other sites

3 hours ago, yindengxie said:

We  have our  simulators and  just want to use FSX or P3D  as  the Visual Scenery.

Yes, I understood that.

3 hours ago, yindengxie said:

Questions: Is it possible that we  send (write) our simulator output values: Latitude,    Longitude, Altitude, Pitch, Bank, Heading through your FSUIPC  to FSX or P3D?

Yes, but not a "viewpoint". You set the user aircraft to those values. you simply do not have the user aircraft cockpit displayed, so you only get scenery!

As I said, Lockheed-Martin do provide methods for you to do exactly as you wish, and using that interface might be more efficient than using a middle-man like FSUIPC.

But if you want to use FSUIPC, please refer to the Offsets Status document, part of both the SDK and the documentation installed for you in the FSUIPC documents subfolder in"Modules".  Check offsets 0x0560 to 0x0580 inclusive. Write to those as frequently as necessary for smooth movement.

Pete

 

 

Link to comment
Share on other sites

Dear Mr. Pete Dowson,

   Thank you very much for your detailed explanation!

  I am now using your FSUIPC-SDK-C program to write  our simulator 

 Longitude, Altitude, Pitch, Bank, Heading through your FSUIPC 

offsets 0x0560 to 0x0580 to FSX,  to make  scenery smooth movement.

 If there are any questions, I expect to get your help and supports.

   VERY MANY THANKS!    

Link to comment
Share on other sites

Dear Mr. Pete Dowson,

    Today  I use  your FSUIPC 4 to read  0x560 Latitude and 0x568 Logitude from FSX , the  values OK!

However,    I can not  write  values to 0x560 Latitude and 0x568 Logitude to FSX .  In other words,

I can not change (set) values to 0x560 Latitude and 0x568 Logitude to FSX . I request you to help me.

THANKS! 

Link to comment
Share on other sites

2 hours ago, yindengxie said:

 I can not  write  values to 0x560 Latitude and 0x568 Logitude to FSX .  In other words,

I can not change (set) values to 0x560 Latitude and 0x568 Logitude to FSX . I request you to help me.

Yes you can. Many programs do it quite successfully.

2 hours ago, yindengxie said:

I request you to help me.

I cannot debug your program from here. I've no idea what you are doing wrong.

Pete

 

Link to comment
Share on other sites

When you said you couldn't write the Latitude/Longitude, did you mean that literally? Or did you mean you tried writing to them and they didn't change? How do you tell that they didn't change? If by watching where the aircraft is, try first putting the Sim into SLEW mode. (I really cannot remember if that is necessary or not. but i don't think so). Oh, try logging ipc writes (option in FSUIPC Logging tab), thenshow the Log file to see what it thinks is happening.

Sorry, I don't have time to write programs for people. Why not show me what you've written and I'll see if I can spot the error?  Or, if you are having difficulty with the example in the SDK, why not use Paul Henty's .Net DLL? Please see the subforum above about that. It aimes to make programming the FSUIPC interface easier.

To demonstrate that, indeed, you can do exactly what you want, please see the Example LUA plugins ZIP file in your FSUIPC Documents folder. The pair "MasterClient.lua" and "SlaveServer.lua" are a demonstration of linking two PCs running FS by LAN, and having one mimic the other. The line in SlaveServer:

    -- now write it all in one structure write
    ipc.writeStruct(0x0560,"3DD", lat, lon, alt, "2SD", pitch, bank, "1UD", hdgT)


writes Lat, Lon, Alt, Pitch, Bank and Heading all in one go, as you should be able to do. And that's a simple script!

Pete

 

Link to comment
Share on other sites

Dear Mr. Pete Dowson,

  Good Morning!

 After your help and support,  my simulator can send Latitude, Longitude, Altitude, Pitch, Bank, Heading

through your FSUIPC to FSX.  It seems work well.  Now I want to use P3D Version 4 for your FSUIPC5.  

Question:  I do not want to use WideServer and WideClient.  Is it possible that I only install  FSUIPC5,  not 

install and register WideServer and WideClient?   THANKS!     

 

Link to comment
Share on other sites

4 hours ago, yindengxie said:

I do not want to use WideServer and WideClient.  Is it possible that I only install  FSUIPC5,  not 

install and register WideServer and WideClient?

WideFS is only for accessing FSUIPC from a networked PC instead of the sim PC. Of course you don't need to buy it if you don't need to do that.

And WideServer is built into FSUIPC4 and FSUIPC5. The separate WideServer.DLL only applies to FS3 and before (i.e. FS2004 and earlier).

Pete

 

Link to comment
Share on other sites

Dear Mr. Pete Dowson,

  Thank you very much for your help!

  Now I have the following questions to request your support:

  1)  Can I write Day, Night, Dawn, Dusk, Snow, Rain, Cloud base, Visibility to your FSUIPC to set scenery weather situations?

 2)  During the scenery is moving,  the scenery screen is always to display " Simulator Pause, Press P key will continue ",

     Can I remove the  message: " Simulator Pause, Press P key will continue " ?

        Thanks!

 

 

  

 

Link to comment
Share on other sites

1 hour ago, yindengxie said:

Can I write Day, Night, Dawn, Dusk, Snow, Rain, Cloud base, Visibility to your FSUIPC to set scenery weather situations?

You can set the time, but I don't think you can just do general settings such as !Day, Night, Dawn, Disk"

For weather, the only safe way is to set the complete META in pretty much standard format. You can try using the other interfaces FSUIPC provides, but the results are not always guaranteed. And you'd need to set global Weather mode and set the weather change slider to zero to prevent the weather you set from being changed.

1 hour ago, yindengxie said:

During the scenery is moving,  the scenery screen is always to display " Simulator Pause, Press P key will continue ",

Why is it doing that? Are you pausing the simulator? Just setting the position etc doesn't pause the sim.

Are you using P3D4? Text messages on screen can be inhibited via the user options. Or you can change them in the main sim CFG file.

Really what you want to do can be done more efficiently using the SimConnect interface directly. FSUIPC was only ever intended to provide compatibility with previously written programs before SimConnect was designed (with my cooperation i should add) back in 2005.  As a layer on top of Simconnect, It is still used a lot for relativel;y trivial things, and to read inforation from the sim, but your application sounds rather more ambitious.

Pete

 

Link to comment
Share on other sites

Dear Mr. Pete Dowson,

At present, I am working on FSX and your FSUIPC for the weather, and

I have the following questions to request your help:

1) Offset B000 is METAR format (Text) and Offset C000 is NWI (Binary),

   which is the better to write weather to your FSUIPC?

 2)  The following program is sometimes work, sometime not.

if (Visibility == 1)  
     sprintf(TxBuffer,"EDDF 1SM");
 else if (Visibility == 2)  
     sprintf(TxBuffer,"EDDF 2SM");
 else if (Visibility == 4)  
     sprintf(TxBuffer,"EDDF 4SM");
 else if (Visibility == 8)  
     sprintf(TxBuffer,"EDDF 8SM");
 else 
     sprintf(TxBuffer,"EDDF 20SM");
     

 if (FSUIPC_Write(0xB000, strlen(TxBuffer)+1, (void *)TxBuffer, &dwResult)) FSUIPC_Process(&dwResult);

3) The following program is not work, what is my wrong?

 if (Visibility == 1)  
     sprintf(TxBuffer,"EDDF R18/P600FT");
 else if (Visibility == 2)  
     sprintf(TxBuffer,"EDDF R18/P800FT");
 else if (Visibility == 3)  
     sprintf(TxBuffer,"EDDF R18/P1000FT");
 else if (Visibility == 4)  
     sprintf(TxBuffer,"EDDF R18/P1200FT");
 else if (Visibility == 5)  
     sprintf(TxBuffer,"EDDF R18/P1400FT");
 else 
     sprintf(TxBuffer,"EDDF R18/P2000FT");

 if (FSUIPC_Write(0xB000, strlen(TxBuffer)+1, (void *)TxBuffer, &dwResult)) FSUIPC_Process(&dwResult);

4) Where can I get the METAR standard decode for your FSUIPC?

-------------------------------------------------------------------------------------------------------------------

   Thank you very much for your courteous attention.  

    Dengxie 

 

Link to comment
Share on other sites

1 hour ago, yindengxie said:

1) Offset B000 is METAR format (Text) and Offset C000 is NWI (Binary),

   which is the better to write weather to your FSUIPC?

Either is okay. The METAR is more direct and sets all apects at once. The binary method can just set some aspects leaving others as they are. FSUIPC's other weather interfaces just translate the binary data into P3D METAR form, reading the existing weather first to fill in any gaps.

There's actually no other way then the METAR strings of setting weather via SimConnect.

The METAR has extensions over the normal one you will have reference to on the Web. To make full use of the METAR facilities you'd need to refer to the SimConnect reference inthe P3D SDK http://www.prepar3d.com/SDKv4/sdk/simconnect_api/simconnect_api_overview.html#APIReference

Scroll down to find the functions where a METAR is sent to set weather observations. There will be a link there to where the format and extensions are defined. FSUIPC sends acording to that spec. (Note that I seem to remember that they start with a date/time reference, before the ICAO. For global weather you set ICAO "GLOB"., but any local weather overrides that locally, so for gloabal weather you need to clear all weather first. There is a global mode you can set through FSUIPC (not via a METAR though).

Oh, and I don't remember ever seeing a format like EDDF R18/P2000FT. What is that supposed to mean?

Pete

 

Link to comment
Share on other sites

14 minutes ago, yindengxie said:

Pete EDDF R18/P2000FT. What is that supposed to mean? 

Dengxie: EDDF for Frankfort ICAO, Runway 18 and RVR 2000 FT.

Ah, yes. Found in the P3D reference:

Use one of the following two formats: 
RDD/VVVVFT
RDD/XXXXVYYYYFT

where
DD = Runway ID (1-6 characters)
VVVV = Visual range in feet. May have P (above maximum) or M (below minimum) prefix (following the slash). 
XXXX = Varying minimum range in feet.
YYYY = Varying maximum range in feet.

Thanks. I've never seen it before but I should have remembered from way back. I'm afraid I can't actually confirm whether it works or not in P3D.

Meanwhile, here's a more direct reference to the SimConnect format for METARs:
http://www.prepar3d.com/SDKv4/sdk/simconnect_api/references/world_functions.html#SimConnect_WeatherRequestInterpolatedObservation

Be aware, though, that I found that, for the extensions, the format for READING the weather METARs is not the same as when WRITING it! If you enable weather logging in FSUIPC, the log will show lots of METARs being read and how I'm interpreting them. You can also see METARs you are writing -- useful if you use the NWI binary to see the METAR that FSUIPC puts together.

I'm afraid that I've not developed the FSUIPC weather interface and its operation for many years now (it dates back to the early FSX versions, 2006), mainly because the third party weather programs like Active Sky have become so good directly interfacing to SimConnect themselves. I'm sure they are doing a better job that I. (You can probbly see the METARs a third party program is sending by using SimConnect logging).

If FSUIPC was still the main way for applications to control P3D weather I'd probably investigate using the PDK weather API, instead of SimConnect. However, that would be a big job and not worth it given the existing applications.

Pete

 

 

Link to comment
Share on other sites

Dear Mr. Pete Dowson,

Sorry! I have to request your help.

I am working on FSX and your FSUIPC,  not P3D.

I have spent a lot of time to try FSUIPC Weather.

Now basically, I can change the visibility. But I try to many ways for RVA as following programs,

Frankfort EDDF-07C Runway, no  RVA changes.

sprintf(TxBuffer,"GLOB EDDF R07C/0500FT"); 

 if (FSUIPC_Write(0xB000, strlen(TxBuffer)+1, (void *)TxBuffer, &dwResult)) FSUIPC_Process(&dwResult);

sprintf(TxBuffer,"GLOB EDDF R07C/0500V1000FT"); 

 if (FSUIPC_Write(0xB000, strlen(TxBuffer)+1, (void *)TxBuffer, &dwResult)) FSUIPC_Process(&dwResult);

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

I have  read your many answers to the FSUIPC Weather questions,  and also I have not found a solution.

So I request you to help me the RVR .   THANKS, PETE!

 

Link to comment
Share on other sites

Pete,

Yesterday you sent me the METAR  (SimConnect) for Prepar3D,  however,

I am now working on FSX for RVA. If it is convenient for you that I hope

you can send me the METAR for RVA of FSX. I have not any FSX METAR

for RVA, just looking up Internet, try, try, try,......  FSX RVA. THANKS!

Link to comment
Share on other sites

53 minutes ago, yindengxie said:

I can change the visibility. But I try to many ways for RVA as following programs,

Frankfort EDDF-07C Runway, no  RVA change

I really don't know what you expect FSX to do for the RVA. Isn't that just sureface visibility? As I said before, it isn't anything I've come across in relation to Flight Sims.

Can you set it (independently of visibility?) in the Weather Menus of the Sim. I think all the SimConnect facilities do is let you set whatever you can set in the menu.

15 minutes ago, yindengxie said:

Yesterday you sent me the METAR  (SimConnect) for Prepar3D,  however,

I am now working on FSX for RVA. If it is convenient for you that I hope

you can send me the METAR for RVA of FSX. I have not any FSX METAR

I think all that part of the P3D SDK is the same as that of FSX.  I don't think they've done much in the way of changes to the weather system. 

17 minutes ago, yindengxie said:

just looking up Internet, try, try, try,..

Did you try searching for "FSX SDK"? All the SDK information, including all of SimConnect's facilities, are of course in the SDK. So you need to download the SDK! Doesn't that semm the logical thing for you to try try try? After all, the P3D information is in the P3D SDK, as I told you and gave a link to!

Pete

 

Link to comment
Share on other sites

Hello Pete,

In your FSX SDK, I found the NewWeather.h as follows, have you

NewWeather.c program as example program? THANKS!

// Wind structure (size 16 bytes)
typedef struct _NewWind
{    
 unsigned short UpperAlt;    // Metres
 unsigned short Speed;        // Knots
 unsigned short Gust;           // Max gust speed difference, knots
 unsigned short Direction;    // usual 65536 = 360 units
 unsigned char  Turbulence;    // 0-4
 unsigned char  Shear;           // 0-3
 unsigned short Variance;    // direction variability, same units as Direction
 unsigned short SpeedFract;    // 1/65536ths of Knots, for more accurate vector calcs
 unsigned short GapAbove;   // Metres
 //This is the gap from the top of surface altitude to first layer's base
 //GapAbove is ignored in layers other than the surface layer, and needs
 //FSUIC 4.748 or 3.998k minimum. 
} NewWind;

//Visibility structure (size 8 bytes)
typedef struct _NewVis
{    
 unsigned short UpperAlt;    // Metres
 signed short   LowerAlt;    // Metres
 unsigned short Range;        // in 1/100ths sm
 unsigned short Spare;
} NewVis;

// Cloud structure (size 16 bytes)
typedef struct _NewCloud
{    
 unsigned short UpperAlt;    // Metres
 unsigned short LowerAlt;    // Metres
 unsigned short Deviation;    // Metres
 unsigned char  Coverage;    // Octas, 0-8
 unsigned char  Type;        // 1-10
 unsigned char  Turbulence;    // 0-4
 unsigned char  Icing;        // 0-4
 signed short   PrecipBase;    // Metres
 unsigned char  PrecipType;    // 0-2
 unsigned char  PrecipRate;    // 0-5
 unsigned char  TopShape;    // ?
 unsigned char  Spare;
} NewCloud;

// Temperature structure (size 8 bytes)
typedef struct _NewTemp
{    
 unsigned short Alt;    // Metres
 short Day;                // Degrees C
 short DayNightVar;        // Degrees C
 short DewPoint;        // Degrees C
} NewTemp;

// Pressure structure (size 4 bytes)
typedef struct _NewPress

 unsigned short Pressure;    // 16 x mb
 short Drift;                 // ? Maybe
} NewPress;

// Structure mapped to FSUIPC offsets
// C000, C400, C800 and CC00
typedef struct _NewWeather
{                                                           // Read Read Writ Read
 unsigned short uCommand;           // C000 C400 C800 CC00
 unsigned short uFlags;               // C002 C402 C802 CC02 // Not used until FSX - see below
 unsigned int ulSignature;           // C004 C404 C804 CC04
 char chICAO[4];                          // C008 C408 C808 CC08
 unsigned short uDynamics;       // C00C C40C C80C CC0C // 0=none, 4=extreme
 unsigned short uSeconds;           // C00E C40E C80E CC0E // FSX only -- see below
 double dLatitude;                        // C010 C410 C810 CC10 // LLA zero for GLOB or unknown ICAO
 double dLongitude;                     // C018 C418 C818 CC18
 int nElevation;                              // C020 C420 C820 CC20 // metres * 65536
 unsigned int ulTimeStamp;       // C024 C424 C824 CC24 // mSecs since start of session
 NewPress Press;                   // C028 C428 C828 CC28
 NewVis Vis;                       // C02C C42C C82C CC2C // Base Vis -- for upper Vis layers see 
 int nTempCtr;                       // C034 C434 C834 CC34 // Number of temperature layers
 NewTemp Temp[24];                   // C038 C438 C838 CC38
 int nWindsCtr;                       // C0F8 C4F8 C8F8 CCF8 // Number of wind layers
 NewWind Wind[24];                   // C0FC C4FC C8FC CCFC
 int nCloudsCtr;                   // C27C C67C CA7C CE7C // Number of Cloud layers (max 16 in FSX, was 24
 NewCloud Cloud[16];               // C280 C680 CA80 CE80
 char chUTCstamp[6];               // C380 C780 CB80 CF80 // UTC time stamp on METAR (internal use)
 unsigned short fWriteback;           // C386 C786 CB86 CF86 // Flags for writing back to FSX (internal use only)
 unsigned long ulSettingTimeStamp; // C388 c788 CB88 CF88 // Timestamp METAR sent (internal use)
 int nUpperVisCtr;                   // C38C C78C CB8C CF8C // Number of upper Vis layer (new in FSX)
 NewVis UpperVis[12];               // C390 C790 CB90 CF90
 unsigned short uSpare[8];           // C3F0 C7F0 CBF0 CFF0 
} NewWeather;

#define MAXVISLAYERS   12
#define MAXTEMPLAYERS  24
#define MAXWINDLAYERS  24
#define MAXCLOUDLAYERS 16

//Commands (for set weather area only)
#define NW_SET       1    // Set weather via FSUIPC user filters
#define NW_SETEXACT 2    // Set weather bypassing user filters
#define NW_CLEAR    3    // Clear all weather, but leave dynamic setting alone
#define NW_DYNAMICS 4    // Set weather dynamics (from uDynamics value)
#define NW_GLOBAL   5   // (FSX) Put FS into Global weather mode
//You sohuld write only 'GLOB' weather after this, which will be applied everywhere.

#define NW_METAR 128    // DON'T USE! (Internal setting when weather written via string at B000. (FSX))

#define NW_SET_PENDING 257     // Set weather using filters, but don't activate in FS yet
#define NW_SETEXACT_PENDING 258 // Set weather bypassing filters, but don't activate in FS yet

#define NW_ACTIVATE 256 // Activate pending weather settings

//Flags for FSX weather setting
#define NWF_SECONDS 1
/* Set this flag if "Seconds" value is to be used in setting weather in FSX
   This applies to weather set via NWI values or via the NEXT Metar string
   written to B000. It's a "one shot" flag, cleared after use. 

   The Seconds value determines whether the weather change is effective
   immediately or after a delay, gradually "blending" into the existing
   weather.
*/

// The 4 distinct areas are used as follows:
// C000 - read only, maintains current interpolated weather at aircraft
// C400 - read only, maintains last written global weather values
// C800 - write area to set weather according to Command, flags, etc etc.
// CC00 - selected read (via signature + ICAO), reads weather at weather station or GLOB

Link to comment
Share on other sites

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.