About simFlight - simflight.com - simflight.de - simflight.fr - simflight.nl - simflight.pt - simflight.es - simflight.it - simflight.jp - simrussia.com - simMarket
rotary switches and FSUIPC
#1
Posted 20 February 2012 - 08:40 PM
#2
Posted 20 February 2012 - 10:10 PM
gr8guitar, on 20 February 2012 - 08:40 PM, said:
I moved your support request to the Support Forum. The FAQ subforum is, like other FAQ's, actually a repository for standard answers, not questions.
Something almost exactly like what you ask was dealt with here quite recently. Have a bit of a search in this, the Support Forum, but don't go back more than a week or two. I'll have a look later for you, but I'm a bit tied up elsewhere at present.
Pete
#3
Posted 21 February 2012 - 04:15 PM
#4
Posted 21 February 2012 - 04:27 PM
gr8guitar, on 21 February 2012 - 04:15 PM, said:
I just had a quck look for the previous thread with a similar question, and it isn't far down. Check this thread:
Double condition facility rotary knob with push button
Regards
Pete
#5
Posted 21 February 2012 - 04:32 PM
#6
Posted 21 February 2012 - 05:12 PM
#7
Posted 21 February 2012 - 05:16 PM
#8
Posted 21 February 2012 - 05:40 PM
gr8guitar, on 21 February 2012 - 05:12 PM, said:
Sorry, you need to explain more. I don't tend to think in terms of Hertz, but just nnn.nn for NAV/COM radios and nnnn.n for ADFs. What exactly are the two "modes" you want to switch between, and why do you want to be able to READ whatever mode is set?
I think you misunderstood my reference to that other thread. It was an example of using a button to swap between different things a rotary might do. Surely that is what you wanted answering? Not some technical thing regarding MHz and KHz?
Quote
Why? I thought you had a button you wanted to use to swtch between two things. Are you confused or is it me?
Quote
Why should FSUIPC care? You are just toggling between two things. There's nothing to read. The flag will indicate whether the button has been pushed an even or odd number of times.
Quote
You can count presses in a Lua plug-in if you wish, but what's the point? All you need, surely, is a flag which is set or unset each time you press the button. That's exactly what the referenced thread ended up doing.
Quote
Sorry, you've lost me. How does Excel work with FSUIPC, or anything in FS for that matter?
Pete
#9
Posted 21 February 2012 - 06:42 PM
#10
Posted 21 February 2012 - 06:55 PM
gr8guitar, on 21 February 2012 - 06:42 PM, said:
Okay, that's good -- you know the FS controls for those already, then.
Quote
That's why I pointe you to that other thread. Use the button to toggle a button flag and use the state of that flag as the condition to determine which of the two controls to send. Your need is EXACTLY the same as the one fulfilled there -- only the functions being switched change!
Regards
Pete
#11
Posted 21 February 2012 - 07:01 PM
#12
Posted 21 February 2012 - 10:16 PM
pushbutton 2,2
rotary switch 0,2/0,3
3=P2,2,K78,8 2,2 turns on the "n" actually depending on speed of presses/hold, toggles between n and nn - so okay *
4=CP(F-2,2)0,2,C65642,0,C1003,514: conditional press on and this checks flag of 2,2 is clear. 0,2 = Nav1 Frac Dec and sets flag of 2,2
5=CU(F-2,2)0,3,C65643,0,C1003,514: conditional press off and this checks flag of 2,2 is clear. 0,3 = Nav1 Frac Inc and sets flag of 2,2
6=CP(F+2,2)0,2,C65640,0,C1004,514: conditional press on and this checks flag of 2,2 is set. 0,2 = Nav1 Whole Dec and clears flag of 2,2
7=CU(F+2,2)0,3,C65641,0,C1004,514: conditional press off and this checks flag of 2,2 is set. 0,3 = Nav1 Whole Inc and clears flag of 2,2
514 = 256 * 2 +2
I noticed the highlighted frequency did not alter but the Whole / Frac freqs changes were indicated and swapped correctly. * Only concerned with Nav1 at this time because I am using 767PIC (was for FS2000) in FS2004. It has an FMC that can automatically control Nav1 & 2 but in Manual mode, only Nav 1 is showing on the Mode Control Panel (MCP).
#14
Posted 22 February 2012 - 03:21 PM
#15
Posted 22 February 2012 - 03:44 PM
gr8guitar, on 22 February 2012 - 03:21 PM, said:
Well here's what I don't understand out of what you are doing:
3=P2,2,K78,8 2,2 turns on the "n" actually depending on speed of presses/hold, toggles between n and nn - so okay *
Why are you sendng 'n's in any case? The INC and DEC controls you are using determine the specific value being changed, you don't have to have focus on them. In fact the relevant gauge need not even be on screen.
All you should need to do with that button it toggle a flag, i.e.
3=P2,2,C1005,3840 ;Using Joy15, flag 0 for tthis, not associated with a real button
Then, all these make no sense ot me at all.
4=CP(F-2,2)0,2,C65642,0,C1003,514: conditional press on and this checks flag of 2,2 is clear. 0,2 = Nav1 Frac Dec and sets flag of 2,2
To start with the excess parameters at the end (C1003,514 etc) are ignored -- there's only one control or keypress assignable to each button in one line. you need multiple lines for multiple assignments. It's only Axes which can have up to 4 assignments in one line.
Then you have a coupe acting on the Press ("P") and a couple on the Release ("U"). Why? Why not all on Press or all on release or on both? What are you trying to achieve by such differences?
I think you either need:
4=CP(F-15,0)0,2,C65642,0 :Nav1 Frac Dec
5=CP(F-15,0)0,3,C65643,0 :Nav1 Frac Inc
6=CP(F+15,0)0,2,C65640,0 ;Nav1 Whole Dec
7=CP(F+15,0)0,3,C65641,0 ;Nav1 Whole Inc
or, for changes on press and release (every click?)
4=CP(F-15,0)0,2,C65642,0 :Nav1 Frac Dec
5=CP(F-15,0)0,3,C65643,0 :Nav1 Frac Inc
6=CP(F+15,0)0,2,C65640,0 ;Nav1 Whole Dec
7=CP(F+15,0)0,3,C65641,0 ;Nav1 Whole Inc
8=CU(F-15,0)0,2,C65642,0 :Nav1 Frac Dec
9=CU(F-15,0)0,3,C65643,0 :Nav1 Frac Inc
10=CU(F+15,0)0,2,C65640,0 ;Nav1 Whole Dec
11=CU(F+15,0)0,3,C65641,0 ;Nav1 Whole Inc
Quote
Again the confusion with the keyboard and focus. In the above the FS controls you are using are the NAV1 ones. There are NAV2 ones, and COM1 and COM2 and ADF. You don't need to mess with keypresses and focus.
Regards
Pete
#16
Posted 22 February 2012 - 06:24 PM
quote:
4=CP(F-15,0)0,2,C65642,0 :Nav1 Frac Dec
5=CP(F-15,0)0,3,C65643,0 :Nav1 Frac Inc
6=CP(F+15,0)0,2,C65640,0 ;Nav1 Whole Dec
7=CP(F+15,0)0,3,C65641,0 ;Nav1 Whole Inc
and this did not work until I change the 5 to CU and the 7 to CU or whatever I wrote above. And I derived that information from page 26 of the FSUIPC manual. Also, If I don't select the "n" then I am not able to toggle back and forth between the Whole and the Frac with the pushbutton, which is the goal and again, it was achieved. As long as the goal was achieved and it seems to be consistant than I am happy. I was just showing you how I was able to get it to work and what I thought was logically happening. As far as the other radios, I'm not concerned with them as I use Saitek's radio panel. Using 767PIC version for FS2000 (in FS2004), I am only concerned with Nav1. In addition, in auto mode or manual mode, I can and do control the Nav's with the FMC. I use Saitek to control the other radios. It was only Nav 1 that is shown on the MCP and I wanted to be able to control it with the rotary switch with the pushbutton. In auto mode, again 767PIC, the FMC updates its INS position from the VOR's and it works great while cruizing but I don't like it to control the Nav1 when I feel the time to set up for an ILS approach so I then switch to manual and enter the freq as needed. So in conclusion, what I showed you, WORKS. Why? Like I said, I thought I understood it logically and made it work but looking back, I'm a bit confused now but won't change what works, and works well.
#17
Posted 22 February 2012 - 07:21 PM
gr8guitar, on 22 February 2012 - 06:24 PM, said:
quote:
4=CP(F-15,0)0,2,C65642,0 :Nav1 Frac Dec
5=CP(F-15,0)0,3,C65643,0 :Nav1 Frac Inc
6=CP(F+15,0)0,2,C65640,0 ;Nav1 Whole Dec
7=CP(F+15,0)0,3,C65641,0 ;Nav1 Whole Inc
and this did not work until I change the 5 to CU and the 7 to CU or whatever I wrote above.
Seems, then, that your rotary sends "button press" when you turn it one way, and "button up" when you turn it the other way. I've never heard of any rotary that does such a thing. All the ones i've ever heard of send alternately button down and button up, a continuous toggling.
In fact unless both directions does sent a button down and button up alternating I don't see how anything can ever recognise another button down or up -- it will look stuck down one way and stuck up the othjer. You need them alternating to detect them.
Sorry, but what you suggest simply doesn't make any sense at all.
Quote
But that button doesn't need to toggle between those selections. All it needs to do is change the Flag which is being tested so that the rotary inputs affect either Whole or Fract parts -- the difference in what is changing in FS does not depend on the "n" or "nn" at all -- the determination whether it is Whole or Fract parts is entirely included in the controls you are making it send. else why do you think there are separate controls for Whole and Fract? If you needed to preselect which part to change, what on Earth do you think is the point of having different controls for the different parts is? It would make a nonsense of the whole thing.
Many implementations using the controls you are using here have been constructed and are in use successfully every day, including in my own cockpit. I feel there is something you are completely misunderstanding, and evidently something else you not telling me.
Quote
Okay, I'll leave you to it. It's just overcomplex and illogical, but evidently there are things about your hardware I don't know about.
Bye
Pete
#18
Posted 22 February 2012 - 11:52 PM
#19
Posted 23 February 2012 - 12:29 AM
gr8guitar, on 22 February 2012 - 11:52 PM, said:
How do you work that out? All I'm saying is that I don't understand how what you've done works at all, and deduced that this must be because I don't know enough about your setup. How has this angered you so? I don't understand where you are coming from.
But if you are going to react so, I won't bother any more. Bye.
Pete
#20
Posted 23 February 2012 - 06:48 PM
(verbatim) into my FSUIPC.ini and it did not work. And after discovering something, I
found out why. In your code, you mention/use (F-15,0), etc. for flag monitoring but
since you're using a phantom switch, switch 15,0 is never toggled. And that is why I
need 'n' or perhaps just the activation of some pushbutton so that its flag can be
toggled. I must admit, I did not see the significance of that the first time I read
the manual and even worse, I missed it when it was mentioned in the thread. I did not
know that a switch's flag gets toggled with each activation. You were aware of this
but I don't recall it being mentioned in our conversation. So my sincere apologies to
you for missing it - twice! I now see that I don't need to set or clear flags in my
situation. In fact, when I went back over the FSUIPC.ini, FSUIPC had removed them!
And the rotary switch/pushbutton functioned as I desired but only with the 'n"
portion being there as well. So to go beyond 767PIC's unique handling of Nav1, I
decided to see about making Nav 2 work in any aircraft and this is what I came up
with:
0=CP(F-2,0)0,0,C65646,0; Nav 2 Frac Dec
1=CU(F-2,0)0,1,C65647,0; Nav 2 Frac Inc
2=CP(F+2,0)0,0,C65644,0; Nav 2 Whole Dec
3=CU(F+2,0)0,1,C65645,0; Nav 2 Whole Dec
Now that I was aware that just activating a pushbutton should toggle its flag, and
perhaps it does but the above code did not work fully. I could only get the Frac
portion to Inc/Dec but the "Whole" was inoperable even though I was activating pb
2,0. When I added the N2, shown below, then it worked. I could activate the
pushbutton and swap back and forth between the Frac and Whole.
0=H2,0,K78,8
1=H2,0,K50,8
2=CP(F-2,0)0,0,C65646,0; Nav 2 Frac Dec
3=CU(F-2,0)0,1,C65647,0; Nav 2 Frac Inc
4=CP(F+2,0)0,0,C65644,0; Nav 2 Whole Dec
5=CU(F+2,0)0,1,C65645,0; Nav 2 Whole Dec
Again, as mentioned many times before, I do NOT know why - but it works. My only
reasoning is perhaps FS requires a toggle between n and nn. And yes I'm aware I
perhaps don't need the CU but, again, it's working. So hopefully you'll accept my
apologies for missing given information and we can get back to "flying." One more
note, what are people using for hardware to display, say Altitude Select and lights
on, etc?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












