markusr Posted March 31, 2004 Report Posted March 31, 2004 Hi, I am using an expansion slot for my Aerosoft MCP747 panel. It is connected to the expansion port1. There are many switches connected (fuel cutoff, nav id, doors,....) i want to connect a push button for AVC. That means, when i push this button AVC should send, when i release it it should stop sending. The difficult on this is, that the keys are not recognized from FS, so i have to programm PTT on and PTT off from FSUIPC to those key. And that is, what iam not understanding. I painted the problem in paint, i hope you understand my big problem. greetings Mark
Pete Dowson Posted March 31, 2004 Report Posted March 31, 2004 I am using an expansion slot for my Aerosoft MCP747 panel. It is connected to the expansion port1. There are many switches connected (fuel cutoff, nav id, doors,....) Okay, let's pause there for a moment: How are those switches programmed to do those things in FS? What software do you use to do thisare the switches seen as Joystick Buttons pr Key Presses in FS or FSUIPC, or are those functions provided by some software from Aerosoft? The rest of your question cannot be answered properly until this detail is understood. i want to connect a push button for AVC.That means, when i push this button AVC should send, when i release it it should stop sending. The difficult on this is, that the keys are not recognized from FS, so i have to programm PTT on and PTT off from FSUIPC to those key I'm afraid that if FS does not see the keys as joystick buttons or keypresses, then neither can FSUIPC see them that way. Unless you can make the Aerosoft driver provide input to FS or FSUIPC in some form that can be recognised, then how can it be utilised? You see the problem? If you know how to do this for the functions of the other keys, please explain and then maybe we can develop that for the additions you want to make. Regards, Pete
markusr Posted April 1, 2004 Author Report Posted April 1, 2004 Hello Pete, Okay, let's pause there for a moment: How are those switches programmed to do those things in FS? What software do you use to do thisare the switches seen as Joystick Buttons pr Key Presses in FS or FSUIPC, or are those functions provided by some software from Aerosoft? The switches are programmed by the Aerosoft MCP internal software, which uses FSUIPC variables in decimal. Heres an example from Aerosoft: 3008,2,+16383,0,65535,1,75,Trim Up (repeat) 0,0,0,0,0,0,0, Let's use the Trim Down function for this explanation. Access to the trim variable in FS2002 is via decimal address 3008 and is stored in 2 bytes. The 'ON Value' in this instance is -16383, a negative number. Every 75 milliseconds the value of -75 is added to the current trim value until it gets to the limit of -16383. Do not confuse the -75 value with the value of 75 milliseconds. These commands are REPEATED every 75 milliseconds which is about 13 times a second. 75 just happens to be a comfortable value with which to trim an aircraft. So, in the above example, a value of -75 will be sent to the trim variable in FS2002 around 13 times every second. This infor for the keys is saved in the program path from MCP747 in the file fs2002data.txt . When i add there a line with the variable for the PTT key, it should work. if you need more info, contact me again, greetings Mark more info on the expansion interface can be found on http://www.mcp747.com in the hardware section, or in THIS text
Pete Dowson Posted April 1, 2004 Report Posted April 1, 2004 3008,2,+16383,0,65535,1,75,Trim Up (repeat) 0,0,0,0,0,0,0, Let's use the Trim Down function for this explanation. Access to the trim variable in FS2002 is via decimal address 3008 and is stored in 2 bytes. Aha! Right. Now we are getting somewhere! The decimal value 3008 corresponds to the hexadecimal FSUIPC offset 0BC0, which as you will see from the FSUIPC SDK's Programmer's Guide, is the Elevator Trim value. So you can program writes to FSUIPC. Good. Can you change individual bits in a location, given its offset (converted to decimal of course)? If so then you can use the virtual buttons facility to make your PTT switch look like a Joystick Button. I've looked at the website, and according the the (rather brief) description of the data format, the "65535" value (the 5th in the example) is a 16-bit mask. Unfortunately it doesn't say what the mask actually does, but assuming you can use it to select which bits you change in an offset, the you should be able to make virtual buttons happen. 65535 is hexadecimal FFFF which is all the bits in the 2 bytes the example is using, so it just means select the whole lot. So, assuming that support from Aerosoft has been discontinued (has it?), you'll need to experiment a bit. As I mentioned, there are 36 bytes from offset 3340, in which each bit is a "virtual button" for programming in FSUIPC. Try the lowest bit (1) in the first of these bytes. hex 3340 is decimal 13120 (use your calculator: 3 x (16 x 16 x 16) plus 3 x (16 x 16) plus 4 x 16, plus 0). The "mask" for the 1 bit is 1. You want that bit to turn on when you press the button, off when you release it. So try: 13120,1,1,0,1,0,0,Virtual Button 1 According the the list of fields in the document on the website: Decimal address of variable in FS2002 (here it means in FSUIPC!) = 13120 Number of bytes in address = 1 (you only need 1 bit in fact) ON value = 1 (to set the bit) OFF value = 0 (to clear the bit) 16-bit mask = 1 (to avoid changing any other bits, I hope) Special function code = 0, no repeat wanted Special function value = 0, no special function Description = whatever you like. I don't know if this will work or not. It all depends on what is meant by "mask" in the documentation, though I think my interpretation is the only sensible one. Let me know. Once FSUIPC sees the button or switch in the Buttons page, you can program it to do whatever you like -- in the case you are interested in, PTT on when pressed, Off when released. Regards, Pete
markusr Posted April 1, 2004 Author Report Posted April 1, 2004 Hi Pete, 13120,1,1,0,1,0,0,Virtual Button 1 sorry thats not working.... :( do you have a nother idea?? please.... greetings Mark
Pete Dowson Posted April 1, 2004 Report Posted April 1, 2004 13120,1,1,0,1,0,0,Virtual Button 1 sorry thats not working.... :( do you have a nother idea?? please.... No. There's no other way that I can think of! Why doesn't it work? Have you tried Aerosoft support? Even if the "mask" method doesn't work, if the TRIM work then this should at least write 1 to the offset when you press the button and 0 when you release it, maybe messing up the rest of the same Byte if the mask is ignored. Have you enabled FSUIPC write logging and checked the Log to see what is happening? If you don't understand the log, show it to me. This is starting to look like a major job for Aerosoft rather than me, I'm afraid -- if it doesn't work then the Aerosoft driver needs attention. But if it doesn't, how have you got the others to work? There's no way I can debug their software I'm afraid. Pete
markusr Posted April 5, 2004 Author Report Posted April 5, 2004 Hi Pete, when i push the button AVC shortly goes to transmit, but in the next second, it releases the transmit mode. ive mail to andrew, who is the programmer of the software, but he didnt replyed yet. what logging do you need exactly??? greetings Mark
Pete Dowson Posted April 5, 2004 Report Posted April 5, 2004 when i push the button AVC shortly goes to transmit, but in the next second, it releases the transmit mode. Ahso it DOES actually work!!! Are you keeping the button pressed in? Normal PTT buttons need the button held? Or is the button you connected perhaps a momentary contact one only? If you are using a momentary contact button, or you wish to press it once to talk then push it again to stop talking, you'll need to "latch" it. Instead of programming it in FSUIPC for "PTT on" on push and "PTT off" on release (as I assume you've done?) you'll need to program it by editing the FSUIPC.INI file, using a Flag to make FSUIPC remember the "toggle" state of the button. The same applies even if your button is not momentary, but the Aerosoft driver treats it as such (which would be odd) -- i.e. only reacting to "off->on" and not signalling "on->off". what logging do you need exactly??? None, now that we know it is working. Check your use of the button, the type of button, and your current FSUIPC programming. You can read the relevant sections of the Advanced User's guide for FSUIPC to see how to use flags. If you want any help on that, show me the Buttons section (only) of your FSUIPC.INI file, and tell me the Joystick/Button number you are trying to program (you can read this in FSUIPC's Buttons programming page on screen). Regards, Pete
markusr Posted April 5, 2004 Author Report Posted April 5, 2004 Hi Pete, Are you keeping the button pressed in? Yes, when i press it it should send, and when i release it it should stop sending. you wish to press it once to talk then push it again to stop talking No, that i wont have.How do i "latch" it? Need help, please... If you want any help on that, show me the Buttons section (only) of your FSUIPC.INI file, and tell me the Joystick/Button number you are trying to program hmmm, i don't know.... I said, thats not a button to assign to, its managed via MCP... confused now :? greetings Mark
Pete Dowson Posted April 5, 2004 Report Posted April 5, 2004 How do i "latch" it? Need help, please... Did you look at the Advanced User's Guide, the section on Button programming and flags? hmmm, i don't know.... I said, thats not a button to assign to, its managed via MCP... confused now :? I certainly am confusedif you are not assigning the functions for the button in FSUIPC, and you are not using FSUIPC, what has all this discussion been about? If you are using FSUIPC, and you did assign the buttons to "ptt on" when pressed and "ptt off" when released, in FSUIPC, then there will be entries in the FSUIPC.INI for it. That is where these assignments are stored, and that is what I asked you to show me IF, that is, you still want help working this out! Please tell me now whether all this is anything at all to do with FSUIPC. If not, then you don't really need my help, you need Aerosoft's! :( :( :( Pete
markusr Posted April 6, 2004 Author Report Posted April 6, 2004 Did you look at the Advanced User's Guide, the section on Button programming and flags? Yes i read it. if you are not assigning the functions for the button in FSUIPC, and you are not using FSUIPC, what has all this discussion been about? As I said before: The switches are programmed by the Aerosoft MCP internal software, which uses FSUIPC variables in decimal. You said: Aha! Right. Now we are getting somewhere! I want it in this way : Yes, when i press it it should send, and when i release it it should stop sending I want to know how or if it is possible the set a delay on the button, so it doesnt stop sending within the next second. greetings Mark
Pete Dowson Posted April 6, 2004 Report Posted April 6, 2004 As I said before: The switches are programmed by the Aerosoft MCP internal software, which uses FSUIPC variables in decimal. Oh dear! This is going in circles. I know you said that. And I even gave you a line to try in the Aerosoft configuration. You then said it didn't work and gave no further information. Then you said it worked, but not exactly as you wanted. Please refer to this part of my message in response to that: Ahso it DOES actually work!!! Are you keeping the button pressed in? Normal PTT buttons need the button held? Or is the button you connected perhaps a momentary contact one only? If you are using a momentary contact button, or you wish to press it once to talk then push it again to stop talking, you'll need to "latch" it. Instead of programming it in FSUIPC for "PTT on" on push and "PTT off" on release (as I assume you've done?) you'll need to program it by editing the FSUIPC.INI file, using a Flag to make FSUIPC remember the "toggle" state of the button. The same applies even if your button is not momentary, but the Aerosoft driver treats it as such (which would be odd) -- i.e. only reacting to "off->on" and not signalling "on->off". Quote: what logging do you need exactly??? None, now that we know it is working. Check your use of the button, the type of button, and your current FSUIPC programming. You can read the relevant sections of the Advanced User's guide for FSUIPC to see how to use flags. If you want any help on that, show me the Buttons section (only) of your FSUIPC.INI file, and tell me the Joystick/Button number you are trying to program (you can read this in FSUIPC's Buttons programming page on screen). Then, instead of doing as I asked and showing me the FSUIPC INI entry for the button, you confused matters entirely by saying you didn't even program the button in FSUIPC, here: I said, thats not a button to assign to, its managed via MCP So, IF you are using FSUIPC to assign the PTT function, I can help, but you have to actually read what I said and show me the FSUIPC INI details so I can program a latching button for you. If, as you said more recently, you are NOT using FSUIPC there is no point in continuing. I want to know how or if it is possible the set a delay on the button, so it doesnt stop sending within the next second. No, there are no delay facilities. Either your button is the wrong type -- it is making only momentary contact -- or the Aerosoft program is at fault and reporting press/release on each press. Either way you'll need to latch the button and press it once for Talk and again to not talk. It seems to me more likely that you are using the wrong button type in the first place. If you want me to help program FSUIPC to make it work, please please please read what I say. Look for the file called FSUIPC.INI. In there you will find a [buttons... section, in which your button programming for this button will be found. I need to see that and I need to know what Joystick/Button number FSUIPC sees your button as, in the FSUIPC Buttons page, when you press it. I'm not going to repeat all this yet again. Please read things a little more carefully. This is getting quite exasperating. :( :( :( Pete greetings Mark
kiek Posted April 9, 2004 Report Posted April 9, 2004 Hi Mark, Let me try to help and summarize what you have to do, based on the great help you got from Pete: Add 13120,1,1,0,1,0,0,Virtual Button 1 to the definitions file that goes with the MCP software, and attach your PTT button to it using the MCP application software. Then open FSUIPC, choose buttons tab (don't forget that your MCP must be turned on). Push your PTT button and see whether FSUIPC recognises this -virtual- button. If so, add PTT on to the making and PTT off to the release of this button. If not ??? I give up.
kiek Posted April 10, 2004 Report Posted April 10, 2004 Hi, I have connected a push button to the MCP expansion port 4, this morning for test purposes. What I did for Mark's problem: Defined the virtual button 1 (according to Pete) in the variables.txt file that goes with my MCP. Defined the switch position 0 at expansion port 4 to be the Virtual button 1. In FSUIPC, buttons page, I pushed the button and got FSUIPC response with joystick 64, button one, and I programmed it to Keysend 1-255 (widefs) with param 1 on make and Keysend 1-255 (widefs) with param 2 on release. Note that this is equal to my definitions of normal PTT on Joystick 0 button 7. I looked in the fsuipc.ini file and found the button definitions for joystick 64, and saw that they were equal to the definitons for joystick 0 button7. So that looked good. However, it does not work. Strangly enough when I try to reprogram the PTT button in FSUIPC it does not recognize the button anymore, the screen remains grayed. When I exit FS2002 and FSUIPC and start them up again, I get the same picture. Only at the first push at the PTT button, FSUIPC responds with the Keysend definitions, but the second time I want to (re-define)it, it does not respond. This is strange, because for my normal push to talk button on joystick 0 button 7, I get always a respons from FSUIPC. Any ideas Pete what can cause this? Kind Regards, Nico
Pete Dowson Posted April 10, 2004 Report Posted April 10, 2004 Any ideas Pete what can cause this? Sorry, no. What version of FSUIPC is this with? Tell you whatI'm emailing you my current test version (3.207). Please try it in that. I'll explain to you how to get more information in the FSUIPC.LOG file also. Regards, Pete
kiek Posted April 10, 2004 Report Posted April 10, 2004 Hi, With the help of Pete I have solved the problem. In the Aerosoft MCP application (version 1.8a) for switches, it's important to assign the right Switch Type when assigning a function from the predefined and expandable list to a button. For the Virtual Button function, we have added to that list, the corresponding switch type is Toggle. (and not momentary, like I had ) Now it works fine!
markusr Posted April 13, 2004 Author Report Posted April 13, 2004 Thanks Nico and Pete for this work. Working fine. greetings Markus
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