Jump to content
The simFlight Network Forums

"reset" an offset after condition is met?


Recommended Posts

FSUIPC Version: 3.98a

FS Version: 9.1

Hardware: CH Yoke

OS: Windows XP (SP3)

Hello, me again!

This is what I'm trying to achieve:

1. Press button on yoke to display ATC window

2. Press another button on yoke the required number of times to select an ATC menu option (eg: press button twice for option 3 etc...)

This is what I have so far, from my FSUIPC.ini [buttons] section:

12=P0,9,Cx510066C0,x00090001

13=B66C0=0 P0,9,C66172,0

14=B66C0=1 P0,9,C66173,0

15=B66C0=2 P0,9,C66174,0

16=B66C0=3 P0,9,C66175,0

17=B66C0=4 P0,9,C66176,0

18=B66C0=5 P0,9,C66177,0

19=B66C0=6 P0,9,C66178,0

20=B66C0=7 P0,9,C66179,0

21=B66C0=8 P0,9,C66180,0

22=B66C0=9 P0,9,C66181,0

This works to a degree, but of course, after each menu option has been chosen the offset needs to be cleared, or reset (I think), so that all the options on any subsequent menu are available.

Do I need a line after each button to reset this (example below), or could I/should I use another method?

19=B66C0=6 P0,9,C66178,0

20=B66C0=6 U0,9,[reset offset],0

Any advice gratefully received!

Thanks

Nige

Link to comment
Share on other sites

1. Press button on yoke to display ATC window

2. Press another button on yoke the required number of times to select an ATC menu option (eg: press button twice for option 3 etc...)

This is what I have so far, from my FSUIPC.ini [buttons] section:

12=P0,9,Cx510066C0,x00090001

13=B66C0=0 P0,9,C66172,0

14=B66C0=1 P0,9,C66173,0

15=B66C0=2 P0,9,C66174,0

16=B66C0=3 P0,9,C66175,0

17=B66C0=4 P0,9,C66176,0

18=B66C0=5 P0,9,C66177,0

19=B66C0=6 P0,9,C66178,0

20=B66C0=7 P0,9,C66179,0

21=B66C0=8 P0,9,C66180,0

22=B66C0=9 P0,9,C66181,0

This works to a degree, but of course, after each menu option has been chosen the offset needs to be cleared, or reset (I think), so that all the options on any subsequent menu are available.

Three things:

(a) You increment the byte at 66C0 before testing it, so the first option selected is the "14=B66C0=1" line, not the first listed.

(b) You should reset the byte at 66C0 to 0 when you press the button for the ATC menu.

© In order to select, say, the 4th option you seem to need to select the preceding three first. Is that what you are intending? If not then I think you need another button to increment 66C0, not have it increment each time you make a selection.

Do I need a line after each button to reset this (example below), or could I/should I use another method?

After each button? How many others? You only show one button above, 0,9. Your description says you are using two buttonsif you mean reset the count every time, you'd never get past 1 would you?

19=B66C0=6 P0,9,C66178,0

20=B66C0=6 U0,9,[reset offset],0

By "reset offset" you mean the "Offset byte set" I presume? There's no "reset offset" control.

One way to do it with two buttons would be to program the ATC Menu button to do the above conditional actions on button release, and use the other button only to increment 66C0. So the sequence would be:

Press and hold pressed the ATC Menu button -- this sets 66C0 to 0 and opens the ATC menu

Then, whilst it is pressed, use the other button to go to the 2nd and subsequent entries (else you'll get the 1st)

Release the ATC Menu button so that the correct conditional entry (as above) actions the selection.

Regards

Pete

Link to comment
Share on other sites

Pete,

Thanks for the reply.

I understand the principle, but the syntax is defeating me at the moment.

Yes, I do need to increment the offset using a different button, but how to pass the results of those presses to the ATC button on release?

This is what I have so far, but according to the log the offset never changes from the first entry. Where have I gone wrong? Logic tells me that I need to pass on the value of the offset to the conditional lines on the ATC button release, rather than using offset increment, but I'm at a loss as to how to do that!

10=P0,0,Cx010066C0,x00

11=P0,0,C65564,0

12=U0,0,Cx5100660C,x000A0001

13=B66C0=0 U0,0,C65564,0

14=B66C0=1 U0,0,C66172,0

15=B66C0=2 U0,0,C66173,0

16=B66C0=3 U0,0,C66174,0

17=B66C0=4 U0,0,C66175,0

18=B66C0=5 U0,0,C66176,0

19=B66C0=6 U0,0,C66177,0

20=B66C0=7 U0,0,C66178,0

21=B66C0=8 U0,0,C66179,0

22=B66C0=9 U0,0,C66180,0

23=B66C0=10 U0,0,C66181,0

24=P0,9,Cx5100660C,x000A0001

Link to comment
Share on other sites

Hi again!

I just rechecked the syntax for this on page 24 of the Advanced Users manual and changed the fsuipc.ini entries accordingly:

10=P0,0,Cx010066C0,x00

11=P0,0,C65564,0

12=P0,9,Cx5100660C,x000A0001

13=B66C0=0 U0,0,C65564,0

14=B66C0=1 U0,0,C66172,0

15=B66C0=2 U0,0,C66173,0

16=B66C0=3 U0,0,C66174,0

17=B66C0=4 U0,0,C66175,0

18=B66C0=5 U0,0,C66176,0

19=B66C0=6 U0,0,C66177,0

20=B66C0=7 U0,0,C66178,0

21=B66C0=8 U0,0,C66179,0

22=B66C0=9 U0,0,C66180,0

23=B66C0=10 U0,0,C66181,0

But it's still not working. The offset doesn't look as though it's incrementing:

11144812 Button changed: bRef=0, Joy=0, Btn=0, Pressed

11144812 [buttons] 10=P0,0,Cx010066C0,x00

11144812 IPC Offsets Control: Ctrl=x0100, Length=1, Offset=66C0, Param=x0

11144812 [buttons] 11=P0,0,C65564,0

11144812 FS Control Sent: Ctrl=65564, Param=0

11149906 Button changed: bRef=0, Joy=0, Btn=9, Pressed

11149906 [buttons] 12=P0,9,Cx5100660C,x000A0001

11149906 IPC Offsets Control: Ctrl=x5100, Length=1, Offset=660C, Param=xA0001

11149906 [buttons] 29=P0,9,Cx5100660C,x000A0001

11149906 IPC Offsets Control: Ctrl=x5100, Length=1, Offset=660C, Param=xA0001

11150218 Button changed: bRef=0, Joy=0, Btn=9, Released

11150703 Button changed: bRef=0, Joy=0, Btn=9, Pressed

11150703 [buttons] 12=P0,9,Cx5100660C,x000A0001

11150703 IPC Offsets Control: Ctrl=x5100, Length=1, Offset=660C, Param=xA0001

11150703 [buttons] 29=P0,9,Cx5100660C,x000A0001

11150703 IPC Offsets Control: Ctrl=x5100, Length=1, Offset=660C, Param=xA0001

11151031 Button changed: bRef=0, Joy=0, Btn=9, Released

11151468 Button changed: bRef=0, Joy=0, Btn=9, Pressed

11151468 [buttons] 12=P0,9,Cx5100660C,x000A0001

11151468 IPC Offsets Control: Ctrl=x5100, Length=1, Offset=660C, Param=xA0001

11151468 [buttons] 29=P0,9,Cx5100660C,x000A0001

11151468 IPC Offsets Control: Ctrl=x5100, Length=1, Offset=660C, Param=xA0001

11151750 Button changed: bRef=0, Joy=0, Btn=9, Released

11152281 Button changed: bRef=0, Joy=0, Btn=9, Pressed

11152281 [buttons] 12=P0,9,Cx5100660C,x000A0001

11152281 IPC Offsets Control: Ctrl=x5100, Length=1, Offset=660C, Param=xA0001

11152281 [buttons] 29=P0,9,Cx5100660C,x000A0001

11152281 IPC Offsets Control: Ctrl=x5100, Length=1, Offset=660C, Param=xA0001

11152593 Button changed: bRef=0, Joy=0, Btn=9, Released

11153218 Button changed: bRef=0, Joy=0, Btn=0, Released

11153218 [buttons] 13=B66C0=0 U0,0,C65564,0

11153218 .... Offset check: x66C0/1 = 0? (0), Result = TRUE

11153218 FS Control Sent: Ctrl=65564, Param=0

11153218 [buttons] 14=B66C0=1 U0,0,C66172,0

11153218 .... Offset check: x66C0/1 = 1? (0), Result = FALSE

11153218 [buttons] 15=B66C0=2 U0,0,C66173,0

11153218 .... Offset check: x66C0/1 = 2? (0), Result = FALSE

11153218 [buttons] 16=B66C0=3 U0,0,C66174,0

11153218 .... Offset check: x66C0/1 = 3? (0), Result = FALSE

11153218 [buttons] 17=B66C0=4 U0,0,C66175,0

11153218 .... Offset check: x66C0/1 = 4? (0), Result = FALSE

11153218 [buttons] 18=B66C0=5 U0,0,C66176,0

11153218 .... Offset check: x66C0/1 = 5? (0), Result = FALSE

11153218 [buttons] 19=B66C0=6 U0,0,C66177,0

11153218 .... Offset check: x66C0/1 = 6? (0), Result = FALSE

11153218 [buttons] 20=B66C0=7 U0,0,C66178,0

11153218 .... Offset check: x66C0/1 = 7? (0), Result = FALSE

11153218 [buttons] 21=B66C0=8 U0,0,C66179,0

11153218 .... Offset check: x66C0/1 = 8? (0), Result = FALSE

11153218 [buttons] 22=B66C0=9 U0,0,C66180,0

11153218 .... Offset check: x66C0/1 = 9? (0), Result = FALSE

11153218 [buttons] 23=B66C0=10 U0,0,C66181,0

11153218 .... Offset check: x66C0/1 = 10? (0), Result = FALSE

Link to comment
Share on other sites

Got it!

10=P0,0,Cx010066C0,x00

11=P0,0,C65564,0

13=B66C0=0 U0,0,C65564,0

14=B66C0=1 U0,0,C66172,0

15=B66C0=2 U0,0,C66173,0

16=B66C0=3 U0,0,C66174,0

17=B66C0=4 U0,0,C66175,0

18=B66C0=5 U0,0,C66176,0

19=B66C0=6 U0,0,C66177,0

20=B66C0=7 U0,0,C66178,0

21=B66C0=8 U0,0,C66179,0

22=B66C0=9 U0,0,C66180,0

23=B66C0=10 U0,0,C66181,0

29=P0,9,Cx510066C0,x000A0001

Works fine now!

Thanks v. much.

Regards,

Nige

Link to comment
Share on other sites

I understand the principle, but the syntax is defeating me at the moment.

It's pretty much the same as you have already.

Yes, I do need to increment the offset using a different button, but how to pass the results of those presses to the ATC button on release?

You have those lines already. Release is just a "U" at the start instead of a "P". You know that already too!

This is what I have so far, but according to the log the offset never changes from the first entry. Where have I gone wrong? Logic tells me that I need to pass on the value of the offset to the conditional lines on the ATC button release

You don't "pass on" an offset. Whatever the value stored there is the value you get! Like a post box, or more a file.

10=P0,0,Cx010066C0,x00

11=P0,0,C65564,0

This sets 66C0 to zero, and calls up the ATC menu, when you press 0,0. So far, so good.

12=U0,0,Cx5100660C,x000A0001

But this increments 66C0 when you release 0,0. Why? This is a waste -- next time you press it it will be zeroed again, so why increment it on the ATC selection button?

13=B66C0=0 U0,0,C65564,0

You are sending the ATC select control AGAIN when releasing 0,0. Why? Won't that simply clear the menu? What are you thinking here?

14=B66C0=1 U0,0,C66172,0

15=B66C0=2 U0,0,C66173,0

16=B66C0=3 U0,0,C66174,0

17=B66C0=4 U0,0,C66175,0

18=B66C0=5 U0,0,C66176,0

19=B66C0=6 U0,0,C66177,0

20=B66C0=7 U0,0,C66178,0

21=B66C0=8 U0,0,C66179,0

22=B66C0=9 U0,0,C66180,0

23=B66C0=10 U0,0,C66181,0

These are all okay -- but what about when 66C0 is 0, as it is initially? You weon't do anything UNLESS you increment 66C0 (with the other button). Is that what you want? If so, fine.

24=P0,9,Cx5100660C,x000A0001

So, you ARE incrementing on 0,9 as well as when releasing 0,0. Don't you think the 0,0 one is rather redundant?

Regards

Pete

Link to comment
Share on other sites

Thanks again Peter!

The first line is set to toggle the ATC window so that there's a logic to the number of button presses for each ATC option (1 for option 1, and so on). Otherwise, it's press once for menu option 2, twice for option 3 etc...

I decided to tweak the arrangement from my last post - having the commands sent on release of the ATC button was problematic with ATC sub-menus (eg: parking options) that appear automatically without closing the ATC window.

I have now an arrangement on the 3 buttons on the left side of the CH Throttle:

Button 0 - Toggles the ATC window and resets the offset.

Button 9 - Increments the offset on press.

Button 8 - Send the command on press and resets the offset on release.

10=P0,0,Cx010066C0,x00

11=P0,0,C65564,0

29=P0,9,Cx510066C0,x000A0001

30=B66C0=0 P0,8,C65564,0

31=B66C0=1 P0,8,C66172,0

32=B66C0=2 P0,8,C66173,0

33=B66C0=3 P0,8,C66174,0

34=B66C0=4 P0,8,C66175,0

35=B66C0=5 P0,8,C66176,0

36=B66C0=6 P0,8,C66177,0

37=B66C0=7 P0,8,C66178,0

38=B66C0=8 P0,8,C66179,0

39=B66C0=9 P0,8,C66180,0

40=B66C0=10 P0,8,C66181,0

41=U0,8,Cx010066C0,x00

It's all working as I wanted now. Thanks again for your advice.

Regards,

Nige

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

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