Results 11 to 20 of 21
Thread: Can SOIC handle switch bounce?
-
10-21-2009, 02:59 AM #11
Re: Can SOIC handle switch bounce?
John,
Peter is right,
Code:&canopysw = 1
Code:v8000 = 1
I am a bit surprised about the FSUIPC offset popping up... I thought you hade a problem with a bouncing switch? I don't think you should
mix up these two. Get a 'clean' value for your switch first and then continue with the FSUIPC offset.
What do you want to do with that FSUIPC offset in relation to your switch?
regards,
Nico
-
10-21-2009, 08:12 AM #12
Re: Can SOIC handle switch bounce?
Hi Nico & Peter,
Thanks for your expert eyes and SOIC minds helping. The reason I changed the V=8000 to &canopysw was, SOIC's complier kept giving me an error with v=8000. (Command out of place) I checked and I had typed it as Nico suggested, with the changing of Var #s to their named counterparts.
I didn't know if I could mix Var 8000 with names and, I thought maybe that was the problem? When I changed it to &canopysw it worked????
As to what I want to accomplish:
This is a fighter cockpit. Fighters (at least when I flew them) start with the canopy open. I want to be able to load a FSX fighter and have the canopy open during start up and checks.
I then want to move the lever and connect the switch. The canopy should then close. I want the code to detect if the lever is forward (canopy closed) or backward (canopy open) and have SOIC set the FSX canopy to be in sync with my lever.
What I am experiencing is that the FSX airplanes always start with the canopy closed. I guess I could save a flight back in the chocks cold & dark with the canopy open? However, unlike you guys I will fly a dozen different airplanes from the T-6II or T-45 trainers to the F-16 or F18.
I thought the manual cockpit switch and SOIC could handle the syncing of the virtual and real cockpits?
Does this make sense to you?John
System:
ASUS P5Q SE/R
Intel Q9550 O/C to 3.4 GHz
4 GB 1066 DDR2 RAM
300 GB WD 10,000 RPM Raptor SATA Drive
GeForce 8800 GT 512 KB RAM
Matrox TH2Go with three 19" Sumsung 940 BX
IR Track 4
-
10-21-2009, 09:31 AM #13
Re: Can SOIC handle switch bounce?
Aha, now I understand!
I thought you had a typo in the name cancopy... being a 767 pilot I did not know what a canopy is, had to look that up in the english dictionary
It should be possible to synchronise, you could try this code:
Code:Var 8000 name semaphore Value 0 Var 8001 name canopyswitch Link IOCARD_SW Input 7 Type I { IF &semaphore = 0 { &semaphore = 1 v8002 = DELAY &canopyswitch 50 // assign after .5 delay } } Var 8002 { &semaphore = 0 &canopy = &canopyswich } Var 8003 name canopy Link FSUIPC_OUT Offset $3367 Length 1
BTW it is SIOC not SOIC ...
-
10-21-2009, 09:56 AM #14
Re: Can SOIC handle switch bounce?
Okay class, today's lesson will be a Topsy turby class on "Yanking and Banking" followed tomorrow by a hi-pressure and fiery class on G-forces and Afterburners.
I gotta teach you guys what "real" flying is like,
Thanks for the code, Nico. I will try it and let you know.
P.S. didn't I tell you I am dyslexic? Really am!John
System:
ASUS P5Q SE/R
Intel Q9550 O/C to 3.4 GHz
4 GB 1066 DDR2 RAM
300 GB WD 10,000 RPM Raptor SATA Drive
GeForce 8800 GT 512 KB RAM
Matrox TH2Go with three 19" Sumsung 940 BX
IR Track 4
-
10-22-2009, 10:36 PM #15
Re: Can SOIC handle switch bounce?
Well Nico & Peter, thanks to you two I have the canopy switch working. Thanks.
FSX is still being FSX, however. When the airplane is loaded into FSX the canopy is closed. I have to use the shift-e to open it, then my switch will work correctly.
I tried saving a flight with the canopy open. When you load the flight, the canopy is closed. Grurrrrrr!
I don't know how to get the flight to load with an open canopy?John
System:
ASUS P5Q SE/R
Intel Q9550 O/C to 3.4 GHz
4 GB 1066 DDR2 RAM
300 GB WD 10,000 RPM Raptor SATA Drive
GeForce 8800 GT 512 KB RAM
Matrox TH2Go with three 19" Sumsung 940 BX
IR Track 4
-
10-23-2009, 04:18 AM #16
Re: Can SOIC handle switch bounce?
This might be related to the fact that if you start SIOC before you load a fighter flight, the SIOC code has been executed (according to the position of your switch) before the Flight is loaded.
You could try to start SIOC after you have loaded your (saved with open canopy) fighter flight...
Nico
-
10-23-2009, 04:54 AM #17
Re: Can SOIC handle switch bounce?
Hi there,
some time ago had made a script which did something regarding the fuel status of a plane.
Some problem that occurred with this is that when I loaded a new plane the fuel tank size
changes and my script needed to get a trigger to recalculate some things. I had this solved
by also reading the planes id on some offset, dont know exatly anymore which offset. But if you like I could find it back. The thing is that in the case the name, or tail number changes that offset changed and without caring of whats the value in it, you can let the script then update the canopy fsuipc offset to align with the state of the canopy switch.
This could also solve the fact if sioc is running before fs is running.
Try and error...thats the way to learn in this case...sioc is powerfull enough to accomodate
clever things ...
Also, in my setup, wideFS starts when the computer starts but wideFS starts SIOC only when
widefs connected to FS. This is a feature of widefs. I think it is something called RunDelay or Run ...
If FS starts, with a fighter with closed canopy, a little later the SIOC is started and the canopy
should take the state of the canopyswitch.
Greetz PeterFS9+PM+AST+opencockpits
-
10-23-2009, 07:46 AM #18
Re: Can SOIC handle switch bounce?
Those are good idea Peter & Nico. I could set FSUIPC to start SIOC. However, if I change aircraft without closing and restarting FSX, I would be back where we started.
The offset used for the canopy is a toggle offset. Is there a way to send a one time toggle to the offset right after the aircraft loads and, then run the switch position routine?
Could I just start the canopy routine with a toggle command and then initialize it to the switch position?
Just thinking out loud here. Thanks again for all of your suggestions.John
System:
ASUS P5Q SE/R
Intel Q9550 O/C to 3.4 GHz
4 GB 1066 DDR2 RAM
300 GB WD 10,000 RPM Raptor SATA Drive
GeForce 8800 GT 512 KB RAM
Matrox TH2Go with three 19" Sumsung 940 BX
IR Track 4
-
10-24-2009, 04:00 AM #19
Re: Can SOIC handle switch bounce?
Hi Jmig,
that is exactly what I was trying to explain. Give your different fighters in FS a different plane tail ids
Example
Var 0007, name Lv_PlaneId, Link FSUIPC_IN, Offset $313C, Length 4
{
// assuming one of the airbus setups
&Lv_Plane = 0
// check for twin otter C-GND
if &Lv_PlaneId = 1313287491
{
&Lv_Plane = 1
}
// check for learjet N456
if &Lv_PlaneId = 909456462
{
&Lv_Plane = 2
}
// check for beechcraft baron 58 with N058SN or N058BE
// for the moment we will treat beech baron 58 as the twin otter
if &Lv_PlaneId = 943009870
{
&Lv_Plane = 1
}
}
Var 0008, name Lv_Plane
{
send here the canopy trigger to FS
}
In above script only the four first letters of the plane id are taken into account
and if your plane changes then the Lv_Plane variable will change and here you can trigger
the a change of the canopy
PS : this is a piece of my SIOC script and depending on which plane is loaded the script will
behave different upon the same hardware inputs
Greetz PeterFS9+PM+AST+opencockpits
-
10-26-2009, 05:33 AM #20
Re: Can SOIC handle switch bounce?
Hi, I was just looking at the FSUIPC offset table in the project magenta site and noticed
the following offset :
3364 1 FS2004 “Ready to Fly” indicator. This is non-zero when FS is loading, or reloading a
flight or aircraft or scenery, and becomes zero when flight mode is enabled (even
if the simulator is paused or in Slew mode).
Possibly interesting to solve some problems as in the previous post
greetz PeterFS9+PM+AST+opencockpits
Similar Threads
-
HELP, i am totally lost with SOIC
By Jasmckee in forum OpenCockpits General DiscussionReplies: 1Last Post: 07-06-2010, 03:21 AM -
737 reverser handle
By ivar hestnes in forum General Builder Questions All Aircraft TypesReplies: 0Last Post: 04-11-2009, 06:18 PM -
Sound for Flaps Handle
By flightdeck in forum PM General Q & AReplies: 2Last Post: 02-17-2008, 04:24 PM
Embrace the freedom of casual encounters on the best dating app in town! One night stands, no...
Night games. No obligations. One...