davidk64 Posted June 23 Report Share Posted June 23 (edited) Trying to use the freeware Spad with registered FSUIPC6 to remap a Saitek panel button via virtual button facility as suggested in FSUIPC documentation. Spad is giving an error on startup: "Run-time error '9': Subscript out of range" To clarify I can start Spad and see the user interface. When I then start P3D I see at the bottom of the Spad UI that it detects FSUIPC is running and then within a minute or so the error is generated. This happens before it detects (or shows in UI anyways) what simulator version is running. Just wondering if anybody has seen this before and can suggest a fix. Alternatively confirm it is doable. Thanks Edited June 23 by davidk64 Clarify when error occurs Link to comment Share on other sites More sharing options...
John Dowson Posted June 25 Report Share Posted June 25 On 6/23/2024 at 7:36 AM, davidk64 said: Just wondering if anybody has seen this before and can suggest a fix. Alternatively confirm it is doable. I have not used the freeware SPAD version for many many years, and don't have this installed any more. I will download and take a look, but it will take me a few days before I can get around to this (just back off of holiday). I will update once I have investigated. In the mean-time, could you show me/attach your FSUIPC6.log and FSUIPC6.ini files. John Link to comment Share on other sites More sharing options...
davidk64 Posted June 25 Author Report Share Posted June 25 I hope your break was good and thanks for taking a look. Attached log shows no mention of spad. I tried 3 methods, start P3D then start spad, start P3D open FSUIPC then start spad, start spad then start P3D. All give same error message. I fear it may be nothing to do with FSUIPC and something to do with my setup causing issues for spad. If you get it working that will confirm! FSUIPC6.ini FSUIPC6.log Link to comment Share on other sites More sharing options...
John Dowson Posted June 25 Report Share Posted June 25 18 minutes ago, davidk64 said: I fear it may be nothing to do with FSUIPC and something to do with my setup causing issues for spad. Well, as FSUIPC doesn't do anything with SPAD, it won't be an FSUIPC issue (although SPAD may talk to FSUIPC). But you should certainly be able to use the free SPAD version with FSUIPC, and I have done in the past (but over 5 years ago!). I have no recollection of how I set this up though... Do you have a link to download SPAD? Seems that it is no longer available at the link we provide(at http://fstools.weebly.com), and can't find it with google. Maybe also see https://www.prepar3d.com/forum/viewtopic.php?t=8356. John Link to comment Share on other sites More sharing options...
John Dowson Posted June 25 Report Share Posted June 25 Maybe also worth trying these lua scripts instead of SPAD: John Link to comment Share on other sites More sharing options...
davidk64 Posted June 25 Author Report Share Posted June 25 Yes, by fluke I found that the download page works even though the home page doesn't! Download - Tools for Flight Simulator - Home of the SPAD (weebly.com) Link to comment Share on other sites More sharing options...
davidk64 Posted June 26 Author Report Share Posted June 26 Installing the Lua scripts seems to be working in so much as I can now press a button on the Saitek panel, and it registers in FSUIPC. One issue I'm having is that say I press the master battery switch to the on position, FSUIPC recognizes I have done so, and I can assign the simulation variable, say "Toggle Master Battery". But when I test it after closing FSUIPC I have to press the switch twice for every one toggle. For example, I press the panel switch on and the master battery switch is moved to on position in plane then to move the switch in plane to the off position I have to press the panel switch to the off position and then to the on position. If I go into FSUIPC with the panel switch in on position and press it down, then FSUIPC doesn't register the down position. Yet testing per the forum post for setting up these Lua scripts shows that FSUIPC does know about both positions. Link to comment Share on other sites More sharing options...
John Dowson Posted June 26 Report Share Posted June 26 33 minutes ago, davidk64 said: But when I test it after closing FSUIPC I have to press the switch twice for every one toggle. For example, I press the panel switch on and the master battery switch is moved to on position in plane then to move the switch in plane to the off position I have to press the panel switch to the off position and then to the on position. If I go into FSUIPC with the panel switch in on position and press it down, then FSUIPC doesn't register the down position. Yet testing per the forum post for setting up these Lua scripts shows that FSUIPC does know about both positions. You are assigning to a toggle control and only on the press. So when you activate the switch (press) it toggles, but when you switch off (release) it is doing nothing. So, when you next activate the switch, it toggles again and will switch on. You need to assign to the toggle on release as well. However, when assigning both a button/switch press and release to toggles, you can easily get out-of-sync with the state of the switch in the VC. Better to assigning the press to on (e.g. Master Battery On or Master Battery Set with a parameter of 1) and the release to off (e.g. Master Battery Off or Master Battery Set with a parameter of 0). Alternatively, you can add an offset condition so that the control is only sent if needed (i.e. if already on and you switch on, no toggle control is sent). See the Advanced User guide on how to use offset conditions, and you need to find an offset that holds the state of whatever you are trying to change (see the Offset Status document for this). 11 hours ago, davidk64 said: Yes, by fluke I found that the download page works even though the home page doesn't! Download - Tools for Flight Simulator - Home of the SPAD (weebly.com) Thanks...but I have found my SPAD installation from 6 years ago, so will try/test this later. John Link to comment Share on other sites More sharing options...
davidk64 Posted June 26 Author Report Share Posted June 26 Okay thanks for that. I have tried to implement the offset method. It might be working for the battery switch but I can't seem to get it out of sync to be sure! It's not working for nav light switch so not sure if I've coded it wrong? SuperCub.ini Link to comment Share on other sites More sharing options...
John Dowson Posted June 26 Report Share Posted June 26 (edited) 46 minutes ago, davidk64 said: It's not working for nav light switch so not sure if I've coded it wrong? Yes - its wrong. You are checking the value against 2 bytes (word), but offset 0D0C is a bit-oriented offset with the nav lights in bit 0 (so use a mask of 0001 for bit 0, or 2^0), so should be: Quote 403=W0D0C&0001=0 P72,12,C68091,1 -{NAV_LIGHTS_SET}- 404=W0D0C&0001 U72,12,C68091,0 -{NAV_LIGHTS_SET}- If checking bit 1, use 0002, bit 2 is 0004, bit 3 is 0008, etc (generally, use 2^bitno, so 2nd bit is 2^2=4). Also better to use !0 for the condition, or omit (as I have done), as that is the default, as the actual value would depend on the bit position, but you are just checking if the bit is set (!0) or not (=0). John P.S. But as you are using Nav Lights Set and NOT a toggle control, you don't really need an offset condition. Without the offset condition, the control will be sent but have no effect Edited June 26 by John Dowson PS added Link to comment Share on other sites More sharing options...
John Dowson Posted June 26 Report Share Posted June 26 (edited) I just fired up SPAD with the C172 loaded. It connected, I selected the default profile for the aircraft, and both my Saitek Switch Panel and Multi panel seem to work, although the display seems to be not working on the Multi Panel at the moment - its blank, but the buttons are working. Not sure why - I haven't used this for many years. This is using version 0.5.1. I don't want to install and test with 0.5.0 as this would remove my current (working) installation. Sorry, but I have no idea why it isn't working for you - are you using 0.5.1? Edited June 26 by John Dowson Further info added Link to comment Share on other sites More sharing options...
davidk64 Posted June 27 Author Report Share Posted June 27 I tried 0.5.1 first but no it didn't work either. I've managed to program all needed switch panel functionality for the Super Cub now so I think the use of the Lua scripts will do the job for me thanks. The nav lights switch was a funny one. When the plane loads the engine is off but the nav lights are on in the VC and external views. So, to get the switch panel in sync I ended up programming the switch press to turn the nav lights off and the release to turn them on! I wish I'd thought of doing so earlier as I spent an inordinate amount of time trying more fanciful combinations to get things in sync 🙂 If I was really keen, I guess I could try to install a VB6 development environment and debug the SPAD source code to see what is causing the error .... but since the Lua scripts are working, I'll get on with something else - like flying with Charlie Gulick! 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