Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello, after a bit of research I couldn't find a proper answer to my question so I'm posting it here:

In  the simulation model I made I also have a built in reposition system able to set the aircraft in various specific positions, configurations, attitudes etc.

It is workin pretty well but I encounter a problem related to the freeze.

I see fsuipc has a dedicated offset to set the position freeze (3541) which works as intended, but I also saw that P3D is able to give back more specific freezes as specified in offset 3402, in particular:

4 Freeze position
5 Freeze attitude
6 Freeze altitude
7 Freeze Lat/Lon

Now since depending on the repositioning I am doing, I am many times in need to freeze also the attitude but without setting the pause in the sim.
Would it be possible to also write those offsets bits in order to set the most appropriate freeze?

 

Thank you!

Posted
On 6/19/2024 at 10:22 PM, Edoradar said:

I am many times in need to freeze also the attitude but without setting the pause in the sim.
Would it be possible to also write those offsets bits in order to set the most appropriate freeze?

I can look into making these offsets writeable, but not sure when I will have time to look into this at the moment. For the time being, why not just use the provided FS controls:

Quote

66827   FREEZE_ATTITUDE_TOGGLE
66828   FREEZE_ATTITUDE_SET
66829   FREEZE_LATITUDE_LONGITUDE_TOGGLE
66830   FREEZE_LATITUDE_LONGITUDE_SET
66831   FREEZE_LATITUDE_LONGITUE_TOGGLE
66832   FREEZE_LATITUDE_LONGITUE_SET
66833   FREEZE_ALTITUDE_TOGGLE
66834   FREEZE_ALTITUDE_SET

67216   POSITION_FREEZE_USER
67217   POSITION_FREEZE_ALL

I can look into triggering those controls when the offset is written but it will be a week or two before I get time to look at this - I will update this thread once I have taken a look.

John
 

 

  • Like 1
  • 3 weeks later...
Posted

Hi John, did you have any chance to look into that?

Just a reminder 🙂

 

best regards

On 6/25/2024 at 11:27 AM, John Dowson said:

I can look into triggering those controls when the offset is written but it will be a week or two before I get time to look at this - I will update this thread once I have taken a look.

John
 

 

 

Posted
9 hours ago, Edoradar said:

Hi John, did you have any chance to look into that?

No yet - I am rather busy in support issues at the moment, and my time is rather limited at the moment due to health issues.

Don't worry, I haven't forgotten, and will hopefully find time to look into this next week. 

Posted (edited)

@Edoradar Sorry for the delay with this -I have been rather busy with MSFS / FSUIPC7 (as usual!) and also suffering from lower back and sciatica issues which are restricting the amount of time I can remain seated and working...

Anyway, please try the attached dll, beta version v6.2.1c. I have enable writing at offset 0x3402 but only for bits 0,1, 4,5,6 & 7. So, to assign to a button/key press, you need to assign to the control Offset Word Togglebits with parameters:
    0x1 - to toggle pause
    0x2 - to toggle slew mode
    0x10 - to toggle position freeze
    0x20 - to toggle attitude freeze
    0x40 - to toggle altitude freeze
    0x80 - to toggle lat/long freeze

Please test this and let me know how you get on. Once this is tested and I have updated the documentation I will release this version.

Cheers,

John

FSUIPC6.dll

 

Edited by John Dowson
Added support for pause and slew (bits 0 & 1)
Posted

Thank you very much John, I'll test in the next couple of days and get back to you with it.


Best of luck with the sciatica, I know how painful that is!

 

Take care!

  • Like 1
Posted
On 7/17/2024 at 3:36 PM, Edoradar said:

I'll test in the next couple of days and get back to you with it.

Did you manage to test this? I have tested here (of course) and it seems ok, so I will probably release a new version of FSUIPC6 this weekend.

On 7/17/2024 at 3:36 PM, Edoradar said:

Best of luck with the sciatica, I know how painful that is!

Thanks!

John

Posted

Hi John, I had to dedicate few days to my wife so couldn'ìt test yet. I'll try between tonight and tomorrow hopefully. sorry for the delay

Posted

No problem - your wife is certainly more important!
It was a simple updated and I have tested writing to all (writable) bits, so need really, but I always like to get the user who requested an update to test to make sure.
I will hopefully release this tomorrow (with a few other minor updates)...unless the wife has other plans!

Cheers,

John

Posted

I could have given a quick try now before goin for dinner. It works but having a constant flow of offset writes, makes the use of the toggle a little uneasy to use...would eventually be possible to do like the 3541 where you write the timer to hold the value set? Sorry to bother you with that.

 

Thanks!

Posted
16 hours ago, Edoradar said:

but having a constant flow of offset writes, makes the use of the toggle a little uneasy to use

What do you mean by this? Doesn't toggling a bit activate/deactivate the defined mode change?

16 hours ago, Edoradar said:

would eventually be possible to do like the 3541 where you write the timer to hold the value set?

I don't think this functionality is generally suitable for this offset - I would think most use would be to manually trigger these on and off/ and noy on a timer. You can always implement such timer functionality in a lua script if needed..

Posted

Ok guys, i join this conversation because im returning customers from fsuipc4 and i'm about to buy fsuipc6 just for that :

It looks like Edoradar i need a freeze position like in the real sim:

- i'm using p3dV5 with FSLab A320 and using some failure scenario to work for my next recurrent sim

- my problem are that with these failure, no autopilot no trim and no autothrust so dealing with the ecam become almost impossible

I need a flight freeze which will freeze

- attitude

- speed

- position

- altitude

- fuel burned

And if possible another one wich will freeze only

- attitude

- speed

- altitude

The first one is used when i need to writte some explanation

the second one is to switch role pilot monitoring pilot flying

I never program for fsuipc so i don't know if it complex or no ...

Thanks really much for your help,

Pierrot

Posted
6 minutes ago, Pierrot727 said:

I need a flight freeze which will freeze

- attitude

- speed

- position

- altitude

- fuel burned

I have no idea how to freeze speed or fuel burned. If you are freezing position (or latitude/longitude), then wouldn't the speed also freeze (or be zero)? I do not know how this affects the fuel burned though. You would normally hold the airspeed via the Autopilot.

14 minutes ago, Pierrot727 said:

And if possible another one wich will freeze only

- attitude

- speed

- altitude

Again, I don't think you can freeze the speed. 

Note also that with position freeze in offset 0x3402, I have linked this to the FS control POSITION FREEZE USER. This is different from the FSUIPC controls for position freeze, that freeze the latitude/longitude.

John

Posted (edited)

ok, thanks John.

Do you have a link for a documentation which will explain how to program that, because offset and the hexa code is chinese for me and i have no clue how to use it. (just to remind as well, im using p3dv5)

Thanks for your help

Edited by Pierrot727
Posted
18 hours ago, Pierrot727 said:

Do you have a link for a documentation which will explain how to program that, because offset and the hexa code is chinese for me and i have no clue how to use it. (just to remind as well, im using p3dv5)

For assignments, as explained above:

On 7/17/2024 at 1:30 PM, John Dowson said:

I have enable writing at offset 0x3402 but only for bits 0,1, 4,5,6 & 7. So, to assign to a button/key press, you need to assign to the control Offset Word Togglebits with parameters:
    0x1 - to toggle pause
    0x2 - to toggle slew mode
    0x10 - to toggle position freeze
    0x20 - to toggle attitude freeze
    0x40 - to toggle altitude freeze
    0x80 - to toggle lat/long freeze

If you want to send multiple controls, add the parameters. So to freeze attitude, altitude and lat/long, you would use a parameter of 0xE (0x20 + 0x40 + 0x80 = 0xE0)

If using lua, you would use the function:

ipc.togglebitsUW(offset, mask)

using offset 0x3402 and the mask is the same as the parameter as defined above.

Posted
20 minutes ago, John Dowson said:

@Edoradar I would like to clarify the issues you are having with this update before I release, so could you please respond to my previous comment.

Hi John. It does work yes but... 

So I work with python and I have a full simulation done in that. variables like the various types of freeze are generated on my software side and sent as a stream to fsuipc. Of course if the freeze if a toggle, at every iteration there is a new assignement and that makes the freeze to go on and off repeatedly. On the contrary the way the 3541 works  is just perfect for my kind of environment as at every iteration, if the freeze is active, the timer is kept alive. I attacch you the part of binding I use to give you the idea.

 

Thanks

fsuipc.py

Posted
1 hour ago, Edoradar said:

Of course if the freeze if a toggle, at every iteration there is a new assignement and that makes the freeze to go on and off repeatedly.

But it toggles only if you write a different value to the offset. So, say freeze position is currently Off, then bit 4 will be 0. Writing 1 to this bit,  or toggling it, will send the position freeze control, which in turn will update this bit to 1 (value 0x10). If you write 0 to the offset (when it is already 0), nothing will happen.
Now bit 4 is on, if you try and set that bit again, nothing happens. If you set that bit to 0, either by a clear or toggle control, the position freeze will be turned off.

Currently bits 0 and 1 of offset 0x3402 use on/off controls (not toggles), but bits 4,5,6 and 7 use toggle controls.  I could change these controls to use the equivalent on/off controls (via Set), but this shouldn't be necessary as the offset should always hold the current correct status/value, so toggling performs the same action as a set or clear.

So, if the freeze is going on/off repeatedly, then you are repeatedly sending controls to toggle the bits. You should only send the toggle control when needed, once to set the freeze and later to clear the freeze. If you must continually send these controls, then use Offset Word Setbits and Offset Word Clrbits controls instead.

1 hour ago, Edoradar said:

On the contrary the way the 3541 works  is just perfect for my kind of environment as at every iteration, if the freeze is active, the timer is kept alive.

But this would make this offset very difficult to use for most users. The standard use case for such controls is user-driven, i.e. the user decides when to freeze (and presses the button or key to trigger this), and when they want to unfreeze they would press the button again.

1 hour ago, Edoradar said:

I attacch you the part of binding I use to give you the idea.

Sorry but I don't have time to go through such a large script in a language I haven't used for over 20 years. 

Posted
7 minutes ago, John Dowson said:

If you must continually send these controls, then use Offset Word Setbits and Offset Word Clrbits controls instead.

 

Hmmmm ok I never tried to use it this way. I can give it a try for sure. is there a reference in the manual for how to do that or could you quickly point me towards?

 

Quote

But this would make this offset very difficult to use for most users. The standard use case for such controls is user-driven, i.e. the user decides when to freeze (and presses the button or key to trigger this), and when they want to unfreeze they would press the button again.

Sure I understand. Tought tho that since no one ever asked for this feature wouldn't have really matter the way it was implemented. But I get what you mean.

 

Thanks!

 

Posted
5 minutes ago, Edoradar said:
12 minutes ago, John Dowson said:

If you must continually send these controls, then use Offset Word Setbits and Offset Word Clrbits controls instead.

Hmmmm ok I never tried to use it this way. I can give it a try for sure. is there a reference in the manual for how to do that or could you quickly point me towards?

Those controls are defined on page 35 of the Advanced User guide, as is control Offset Word Togglebits.

 

Posted
7 hours ago, John Dowson said:

Those controls are defined on page 35 of the Advanced User guide, as is control Offset Word Togglebits.

 

Hi John. I finished now to test. It works really well. Thanks!

  • Like 1
Posted (edited)

Please Edoradar, will it be possible to have the file to use it please ?

I mean i gess that with the pyton file that you provide, you compile it but then how could i use it on p3d.

For info, on real simulator, the associated button to freeze the sim position is 'rain repellent' button

Thanks for your help

Edited by Pierrot727
Posted

@Pierrot727 I think Edoradar's script is overkill for your needs. If you just want to toggle various freeze states on/off on the press of a button, assign the button to the control Offset Word Togglebits, give the offset as 0x3402, and sum the bit values of the freeze states you want to use for the parameter. So, if you want to freeze attitude (0x20), altitude (0x40) and lat/long (0x80), the value would be 0xE0 (0x20 + 0x40 + 0x80).

John

Posted
4 hours ago, Pierrot727 said:

Please Edoradar, will it be possible to have the file to use it please ?

I mean i gess that with the pyton file that you provide, you compile it but then how could i use it on p3d.

For info, on real simulator, the associated button to freeze the sim position is 'rain repellent' button

Thanks for your help

Hi. actually my case wouldn't really work for you without a massive customization.

I have a full simulation running aside and the freeze has double effect on p3d itself and my simulation.

Like John said you just need to write the offset the way he specified, probably the easiest thing for you is inside fsuipc window to bind a particular swithc (like rain repellend as you said) to set the bit you want of the 3402 offset.

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.