PDA

View Full Version : toggle switches to fs9



smartarze
09-07-2009, 12:15 PM
hi all please can someone help me its driving me mad,

I have a board from leo bodnar to which i have wired 9 toggle switches to control lights in leveld 767. Firstly i used the mouse macro in fsuipc to get these to work which they did nicely, however when i restart a flight or exit flightsim, the next flight i lose the settings and the switches no longer work.

This is where i need your help, is there something i'm missing or is there an easier way of doing it. I started to research on using the leveld sdk but it looks so complicated and i just don't know where to start, I can't seem to find a walkthrough for dummies like me :)

If someone can give a step by step for getting a switch to work with sdk then that would be most helpful

thankyou

Ian

autocadplease
09-07-2009, 01:15 PM
What you need is the FSUIPC offset value for the function you want to control. Then you just assign your switch to that offset to make it work.

smartarze
09-07-2009, 01:17 PM
how do i find that? also where do i assign it to the switch?


I am totally new to all this



ps thanks for your reply

autocadplease
09-07-2009, 01:30 PM
Actually, I think with Level D it isn't as easy as just assigning - if I remember properly. Some programs like Level D and PMDG don't provide the offsets. Go to www.lekseecon.nl and www.mycockpit.org/forums/showthread.php?p=34549 for the Level D solution.

kiek
09-07-2009, 01:33 PM
Hi,
You can use my free FSCONV program, it provides lots of FSUIPC offsets for the Level-D 767. The light controls are described in section 3.2, 3.3 and 3.4 of the Manual.
Register to my forum first and download from there.

smartarze
09-07-2009, 01:52 PM
hi niko i presume, i tried using your product but couldn't find any step by step instructions for doing it, i looked at the manual but couldn't figure it out.

kiek
09-07-2009, 02:00 PM
Hi,

Everything as far as FCONV is concerned is in the Manual. You have to use FSConvigurator to activate the offset with the bits that control the lights first.

Then you have do 'something' with the software of your interface card to set/release the right bits in this FSUIPC offset when toggling a switch.

smartarze
09-07-2009, 02:28 PM
RX5c71540*X83cc

is this the code for a leveld light switch?

how do i then assign this to my toggle switch as leo's board doesn't have any software

kiek
09-07-2009, 02:42 PM
RX5c71540*X83cc
is this the code for a leveld light switch?

? don't know what you mean by that.... but the lights switches in FSCONV are defined in section 3.2, 3.3 and 3.4 of the FSCONV Manual.

There is a distinction in lights buttons, and lights switches. For the switches you have a choice in using buttons (toggle versions) or using on/off switches.
A lights switch in the Level-D is controlled by setting/clearing a bit in one of the corresponding FSUIPC offsets at bytes 0x8B34, 0x8B35, 0x8B36 and 0x8B37



how do i then assign this to my toggle switch as leo's board doesn't have any software
Don't know leo's board, you better ask him... How does one normally activate a bit in a fsuipc offset with leo's board? If that is not possible it is pretty useless... imho

smartarze
09-07-2009, 02:50 PM
thanks, I understand that the details for the lights are in the manual but for someone who hasn't a clue where to start there is no other details, i've been researching this for over a week and i'm still no closer to getting a switch assigned.

kiek
09-07-2009, 03:14 PM
Maybe this is a too difficult task?
One need some basic knowledge of electronics and of programming...
It is certainly not plug and play.

smartarze
09-07-2009, 03:26 PM
once told how to do it i'll know for future switches,

autocadplease
09-07-2009, 03:45 PM
how do i then assign this to my toggle switch as leo's board doesn't have any software

You use FSUIPC. Open FSUIPC windows, go to buttons. Activate the switch or button, FSUIPC will display what button you are pressing, then assign the offset value.
Leo's controller simply makes the card a HID (Human Interface Device) / joystick.

kiek
09-07-2009, 03:56 PM
Ok, thank you for the additional info about Leo's board!

From there (FSUIPC) it is easy, at a button press one should select one of the FSControls that toggles a bit in a byte. Which bit in what byte is what you have defined in FSConvigurator.

smartarze
09-07-2009, 06:11 PM
i give up, still can't get my head around it

when you say assign the offset value......where do i get that from?

i am really sorry guys for being a pain....please help me get through this first one.

davek
09-07-2009, 10:45 PM
Hi smartarze (luv the name)

Dont worry mate, I should have called myself dumbarze when it comes to electronics stuff.
I will try and explain it as I understand it.. if i get something wrong guys please correct me

The switch is connected to the computer through the Card. There is no software as such associated with the switch or the card.

(think of your switch as a keyboard letter and the card as the guts of the keyboard.) It gets plugged into a USB port. With a keyboard all the letters and numbers are assigned so the computer knows what the key is and what it is supposed to do or represent.

When you connect a switch to a computer through the card, there is an electrical imulse but the computer doesnt know what to do with that.

For example, you want a switch to represent the landing gear lever. On the keyboard you press the G key and MSFS software 'knows' that it is the G key and performs the action.
In the normal MSFS software you can reassign the G key to any function you want and any key to the landing gear function.

This is a simple way to set up the cockpit but you need to be able to tell the computer software about the external switches and what you want the software to do when it receives that information.

To do that you can use FSUIPC. It is the software that interfaces between the switch/card and the computer FS software. If you register for the modest fee, it opens up a whole new world for attaching switches etc. The program can assign a specific keystroke or macro to a switch. Press the switch, FSUIPC reads the input, and then tells the software what the switch input represents, ie cycle landing gear.

An offset is similar to an address. The software needs to know that the switch you just pushed (representing landing gear) where to send that input to what part of the software to make the action happen. Its like sending a letter to your granny in the US and not putting a street number and name... its got no idea where its going or what its doing.

When you download FSUIPC there is an excellent readme file. DL it and print it out. Make coffee and hit the comfy chair and read it, several times, soon it will click as to what to do. There is a list of offsets for the basic FS functions + more in the DL file.

Its pretty complex and I am only just scraping the surface. It might be worth sticking to the very basics like I am doing at first until you get a better understanding of it.

Hope that helps and I havent steered you up the wrong path...
cheers
Dave

smartarze
09-08-2009, 11:52 AM
dave, thankyou ever so much for the time you have taken to explain that to me, The problem i have is, with the leveld 767 there are no keyboard commands to flick the light switches on and off (as far as i know) so i cannot use the fs offset values.

UPDATE:

I have sort of managed to figure it out but i am getting the wrong switches flicking or getting 2 flicking on and off at once.

does this sound right?
for instance i want to control the position light:
as FS Control, selected "Offset Byte togglebits"
- in the offset box, entered x8B34
- in the parameter box, entered x01 (for bit 1)

however this flicks the ovrd switch instead of the position lights


what am i doing wrong?

kiek
09-08-2009, 12:22 PM
- in the parameter box, entered x01 (for bit 1)

x01 will give you bit 0 which is the OVRD light ....
x02 will give you bit 1
x04 will give you bit 2
and so on ...

And also notice the difference between FSCONV sections 3.2 and 3.3.
There are two implementations possible of lights buttons. You can activate only one of them in FSCONvigurator. Make sure the slider is set to 12, and just experiment a bit, I'd recommend.

smartarze
09-08-2009, 01:19 PM
so to continue that

x08 = 3bit
x16 = 4bit
x32 = 5bit

is that right as i'm able to only get a few switches working, still something simple i'm missing i think.

Also when it comes to doing right landing light and nose light they are bits 8 - 11 how does that work?

remember explain as simple as possible:lol:

kiek
09-08-2009, 02:05 PM
x08 = 3bit
x16 = 4bit
x32 = 5bit
No!, not really:
0x08=bit 3
0x10=bit 4
0x20=bit 5
0x30=bit 6
0x40=bit 7
0x100=bit 8 BUT(!) then you have to use FSControl Togglebits Word!
0x200=bit 9 ..
and so on



Also when it comes to doing right landing light and nose light they are bits 8 - 11 how does that work?
Two possible approaches: either use bit 8 in a FSControl ToggleBits Word at the same offset (as indicated above) OR (recommended):

Note that bit 8 is the same as bit 8 - 8 = bit 0 of the next byte:

So at byte offset 0x8B35 you take bit 0 (is the same as bit 8 of offset 0x8B34 as Word (a Word is 2 bytes))

Bit 9 is of 0x8B34 (Word) is the same as bit 9-8=1 at offset 0x8B35 (as byte)

Bit 10 of 0x8B34 (Word) is the same as bit 2 at offset 0x8B35 (byte)

...

I cannot make it simpler ;-)

No Longer Active
09-08-2009, 02:07 PM
In english? lol

smartarze
09-08-2009, 02:11 PM
wahayyyy....... I finally understand, why didn't you just explain it like that at the start, would of saved me 2 sleepless nights.

On a serious note I cannot thank you enough for you patience, you have been superb.....not forgetting all the other posters of coarse, you've all helped me so much.

a big thanks to all of you

kiek
09-08-2009, 02:58 PM
Ah great!

There is always light at the end of the tunnel.

Note that the combination of FSCONV and the Level-D SDK is very powerful. E.g. toggling the light switches also works if you are in spot view (something that does not work if you would have used key strokes).

Note also that FSCONV offers you a lot more then just the lights switches, have fun!

smartarze
09-08-2009, 03:01 PM
i might still be looking for that light tho......

having set up the R landing Light and Nose Light to those values, I flick my toggle switch to on and the lights come on, if i then flick switch off the lights stay on. Then when i flick switch on again the lights turn off.

kiek
09-08-2009, 03:53 PM
In FSUIPC, also specify an FSControl when the button is released (the same control as when the button is pushed, with the same parameter).

smartarze
09-08-2009, 03:59 PM
if i do that i get no response from the switch at all, in the manual it shows bit 10 for on and 11 for off, i set the switch at these values and thats when i was getting on for on, on for off

kiek
09-08-2009, 04:05 PM
ah I see, for the switches in section 3.4 you have to set 1 bit and clear another and vice versa .. more complicated , but possible, study FSUIPC manual...

smartarze
09-08-2009, 04:22 PM
hmmmm don't like the sound of that, took me 3 days to get my other 6 switches working.

can anyone shed any light on this?

kiek
09-08-2009, 04:40 PM
The light switches in 3.4 have been modelled to be controlled by a 2 position rotary switch, not for a push button, that makes things more complicated...

You better concentrate first on the controls that are just 1 bit ...

kiek
09-08-2009, 04:43 PM
took me 3 days to get my other 6 switches working.

It took me at least four years to build my home cockpit...