BrunoBL Posted August 16, 2004 Report Share Posted August 16, 2004 Pete, I am running FS2004, registered FSUIPC 3.22 (+WideFS) and PM build 415. After building a hardware EFIS control panel and getting just about every button to work, I can't see how to implement the TFC button (toggle TCAS on/off). As you know, you push the Range knob for this. IN PM's manuals there are discrete offsets to turn TCAS on or off (via the PM command FSUIPC facility), but no toggle option. There is also no direct PM TCAS toggle facility in FSUIPC. Here are the relevant params found in (http://www.projectmagenta.com/resources/PMOffsets.html): 50 TCAS Off 51 TCAS Alt 52 TCAS Callsign 53 TCAS All I can use (and indeed they worked) 50 and 51 above to turn TCAS on or off but, as said, with no toggle. Since I must do this with the same button (push/push for on/off) I thought I would need a "toggle TCAS" offset. One possibility would be moving the keyboard encoder involved in this into the machine running PM, in which case it would be simple to send the CTRL-SHIFT-Z (TCAS toggle which, oddly enough, PM provided as a keyboard macro but omitted the offset for use through FSUIPC). However, my encoder is also used for FS functions besides PM, so I need it in the FS machine. I did query the PM folks about this. I don't have a reply just yet, but anyway I thought you could also give some info on this. I don't think this is the case of conditional programming of the keys in FSUIPC.INI, is it? If so, how would I send a "50" parameter (PM command with param) at the push of a button, and a "51" at the subsequent push of the same button, etc, etc? Best regards, Bruno. Link to comment Share on other sites More sharing options...
Pete Dowson Posted August 16, 2004 Report Share Posted August 16, 2004 registered FSUIPC 3.22 That's out of date. 3.30 is current. I can use (and indeed they worked) 50 and 51 above to turn TCAS on or off but, as said, with no toggle.Since I must do this with the same button (push/push for on/off) I thought I would need a "toggle TCAS" offset. I don't think this is the case of conditional programming of the keys in FSUIPC.INI, is it? If so, how would I send a "50" parameter (PM command with param) at the push of a button, and a "51" at the subsequent push of the same button, etc, etc? Yes, it is conditional. Just make it conditional on the Flag for the same button (assuming the button is recognised on a Joystick number from 0 to 15 -- I only provide flags for those -- else it is more complicated). The example is the Advanced User's Guide is for the case where your button is NOT in the Joystick range 0-15: if you are short of buttons and really need a toggle, you can make any button toggle between two actions by using a flag as a condition. For example, suppose your button is Joy 110, button 3, and a spare flag (a button on joysticks 0-15 not otherwise used) is 15, 2. Program your button with three lines in FSUIPC (the numbers on the left need to be sequential with whatever's there already, but I'll assume you have no others so will start with 1):1=P110,3,C1005,3842 This says execute Control 1005 whenever your button is pressed. Control 1005 is "Button Flag Toggle". The parameter '3842' identifies the Flag: 256 x joystick 15 + button 2. So, this flag will now alternate between being set and clear each time you press the button. 2=CP(F+15,2), ... This tells FSUIPC what to do if the button is pressed AND the flag is set. Replace thepart by the Control number and parameter for one of the actions you need. 3=CP(F-15,2), ... Similarly, this tells FSUIPC what to do when the button is pressed and the flag is not set. However, if your button is on joystick 0-15 the Flag is toggled automatically each time that button is pressed, so you simply have two entries, one conditional on the Flag being set and the other on the Flag being clear. e.g. assuming your button is J1, B5: 1=CP(F-1,5)1,5,C2999,51 ;TCAS Alt 2=CP(F+1,5)1,5,C2999,50 ;TCAS Off Regards, Pete Link to comment Share on other sites More sharing options...
BrunoBL Posted August 16, 2004 Author Report Share Posted August 16, 2004 Pete, BrunoBL wrote: Registered FSUIPC 3.22 That's out of date. 3.30 is current. Ooopss. Will get the latest. Just make it conditional on the Flag for the same button (assuming the button is recognised on a Joystick number from 0 to 15 -- I only provide flags for those -- else it is more complicated). I don't really have a button in the joystick sense. I have the TCAS button on the EFIS panel (and all the other contacts from that panel, too) wired to a keyboard encoder which fools the machine into thinking that I hit a keystroke with each button pressed or rotary switch turned. Maybe there is a way of treating this as a joystick button? Otherwise I may actually get an adittional joystick and wire the TCAS knob to one of its buttons, and thus use your last example (joystick in the 0-15 range). Best regards, Bruno. Link to comment Share on other sites More sharing options...
Pete Dowson Posted August 16, 2004 Report Share Posted August 16, 2004 I don't really have a button in the joystick sense. I have the TCAS button on the EFIS panel (and all the other contacts from that panel, too) wired to a keyboard encoder which fools the machine into thinking that I hit a keystroke with each button pressed or rotary switch turned. Hmmm. Doesn't the encoder come with any software for programming it? Or is it just a plain "you get one code per key" option? Sorry, I haven't provided conditionals for keypresses. Maybe there is a way of treating this as a joystick button? Yes, of course -- you can use it to toggle a bit in the virtual buttons offsets of FSUIPC. This is an area from offset 3340-3363 where each bit is a "virtual button", which can then be recognised in the Buttons programming section. Regards, Pete Link to comment Share on other sites More sharing options...
BrunoBL Posted August 16, 2004 Author Report Share Posted August 16, 2004 Doesn't the encoder come with any software for programming it? Or is it just a plain "you get one code per key" option? The encoder sits in series between the keyboard and the PC. Any one of the 72 switches may be translated to a character (or a macro sequence). Thus, whatever happens in the encoder goes in through the keyboard input of the PC, exactly as if it were typed in the KB. Other than a flexible configuration (what keystroke sequence - up to 16 characters per event, IIRC - is generated when a particular switch is opened or closed, or both) there is no real programming to it. This is an area from offset 3340-3363 where each bit is a "virtual button", which can then be recognised in the Buttons programming section. The plot thickens. I see I have a lot of reading to do! :) But Now I know what to look for. Will go into the documentation with this in mind. I will of course put some of my own effort into this (as you might expect from those who venture into this hobby) but if I get into trouble... will cry for help! :oops: Thanks for the support, Bruno. Link to comment Share on other sites More sharing options...
Pete Dowson Posted August 17, 2004 Report Share Posted August 17, 2004 Now I know what to look for. Will go into the documentation with this in mind. I will of course put some of my own effort into this (as you might expect from those who venture into this hobby) but if I get into trouble... will cry for help! :oops: Well, for full documentation on such offsets you would need the Programmer's Guide from the FSUIPC SDK. You might find that useful in any case -- the Keys and Buttons programming facilities in FSUIPC options both include many Offset value setting/clearing/toggling controls, and these can be used to do almost anything through the FSUIPC offsets without actually writing a program. In terms of what you want to do, using one bit on one of the bytes in the Virtual Button offsets I mentioned actually simplifies things quite a bit, as now you can TOGGLE a bit each time the Key is pressed -- in other words you can make the Key Press look like a latching toggle switch just by programming it to toggle a bit. Once you've done that, programming the button "Press" to switch TCAS on, and the "Release" to switch TCAS off is easy, and you don't need conditional programming, flags, or any editing in the FSUIPC.INI file at all! By all means get back to me if you are still puzzled. Regards, Pete Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now