Results 1 to 10 of 12
-
08-21-2008, 12:29 PM #1
What's going wrong in my SIOC code?
Hello,
Could you please someone point to my error on the following code? Gears Up/Down work fine, but I'm not able to make the led to light
Code:// ***************************************************************************** // * Config_SIOC ver 3.5 - By Manolo Velez - www.opencockpits.com // ***************************************************************************** // * FileName : pilot_console.txt // * Date : 21/8/2008 Var 0300, Value 0 // Gear Initialization { &GEAR = 16383 } Var 0301, name GEAR, Link FSUIPC_INOUT, Offset $0BE8, Length 4, Value 16383 Var 0305, name GEAR_LIGHT, Link IOCARD_OUT, Output 27 Var 0306, name GEARS_SWITCH, Link IOCARD_SW, Input 34 { IF &GEARS_SWITCH = 1 { &GEAR = 16383 &GEAR_LIGHT = 1 } ELSE { &GEAR = 0 &GEAR_LIGHT = 0 } }
Maria
-
08-21-2008, 04:05 PM #2
Hello Maria,
There is nothing wrong with your program. It works over here... Are you sure that you are using a valid output? Have you checked the led with Controlador?
Of course you could improve your code a little bit by:
* using FSUIPC_OUT instead of FSUIPC_INOUT (since you are not using the value coming from FSUIPC);
* making the type of switch used more explicit by adding Type I (default);
* by initialising variable &GEAR only once, now you as well initialise in Value 0 and by adding initial value to the GEAR variable. You can leave out one of the two.
But like I said before, even without these improvements it should work...
Here is an even better program, that will also lit the led when you move the Gear in your panel:
Var 301 name GEAR Link FSUIPC_INOUT Offset $0BE8 Length 4 Value 16383
{
IF &GEAR = 16383
{
&GEAR_LIGHT = 1
}
ELSE
{
&GEAR_LIGHT = 0
}
}
Var 305 name GEAR_LIGHT Link IOCARD_OUT Output 27
Var 306 name GEARS_SWITCH Link IOCARD_SW Input 34 Type I
{
IF &GEARS_SWITCH = 1
{
&GEAR = 16383
}
ELSE
{
&GEAR = 0
}
}
regards,
Nico Kaan
http://www.lekseecon.nl
-
Post Thanks / Like - 1 Thanks, 0 Likes, 0 Dislikes
MicroHellas thanked for this post
-
08-22-2008, 01:14 AM #3
Hello Nico,
Thank you so much. By the chance my congratulations for the contents of your site. I've been there many times reading your SIOC articles. Could you please allow me a childish question (don't forget that I'm blond too). Is this lekseecon only about B767?
If not could you please point me to an article where I can get a global idea about it?
That's another pitty story. I don't know how to check it. I found a good tutorial for it, but it covers only instructions for inputs, so I was able to check only them. Don't know how to check outputs, displays etc.
Opencockpits sure they've great products but, sorry to say, from my experiance they've zero support. Even if I placed already 3 orders, spending around 1,000 Euros, they're replying only to my pre-sales questions and never to my support questions. Also their forums look like died. Only few posts have been replied there among dozens of others waiting a reply. Finally, for some cards (eg encoders cards) there is no manual, so I don't know (for example) where I must connect the 3pins of an encoder while their input is for 4 pins.
Thank you again
Maria
-
08-22-2008, 01:23 AM #4
-
08-22-2008, 04:00 AM #5
-
08-22-2008, 04:07 AM #6
Yes, because the Level-D 767 is shipped with a Sofware Development Kit (SDK). It's the only Flight Sim addon that offers this facility.
Just fill in an output number and 'tick' it ON...
I would not use encoder cards. Use grey type encoders, you can connect these encoders directly to two consecutive logical inputs of the Master card.
Nico
-
08-22-2008, 04:47 AM #7
- Join Date
- Nov 2005
- Location
- rotterdam, the Netherlands, Europe
- Posts
- 803
if you use single encoders i suggest you use the ones they sell. dead cheap and can be directly connected to the mastercard (without the encoder card).
If you use dual concentrics (so far i havent found dual concentrics that work directly on the master card) then use this schematic for the encoder card.
Pin 4 (+5v) is only needed for optical encoders.
Stef
-
Post Thanks / Like - 1 Thanks, 0 Likes, 0 Dislikes
MicroHellas thanked for this post
-
08-22-2008, 05:06 AM #8
-
08-22-2008, 05:30 AM #9
Maria,
the optical encoders (CTS288 type, like OC sell) have three pins and you should look on them like follows :
pin 1 : (right pin) switch 1
pin 2 : (middle pin) ground
pin 3 : (left pin) switch 2
now you connect the ground pin to a ground of an input group on the mastercard
and you connect the two other pins to two consecutive inputs of that input group
depending from which side you look at the rotary you will swap the two outer pins
but this doesnt make much difference. The only thing you will notice is that the
turn direction will change in the software. I mean ... when turning right the value
you receive in the SIOC will be positive or negative. Swapping the 2 inputs will change
this.
Thats it....
Greetz Peter
-
08-22-2008, 05:37 AM #10
- Join Date
- Nov 2005
- Location
- rotterdam, the Netherlands, Europe
- Posts
- 803
its been ages since ive used opencockpit cards so i hope i stll remember correctly (if not, nico please jump in
)
the rotary encoders they sell are grey type. you can connect them directly to the master card and should use consecutive inputs.
In each input group there is 1 commone ground.
from their manual:
ANNEX II. Programming and Configuration
Page 20 of 56
Manual Version 1.1
Software Version 1.7
03/10/03
In TIPO (type) we will write the following values depending
on the type of rotary switch that we are using:
- Blank if we are using a rotary switch.
- 1 if we are using 2 phased out digital encoders. They need
an additional circuit (available at Annex III) and use two
inputs instead three.
- 2 if we are using 2 bits Gray type encoders. They don't
need additional circuits.
If i remember well you cant connect potentiometers to the mastercard.
They have the usbaxes card for that. Also some of their other cards like the usb servos card have some analog inputs for potentiometers.
Stef
Similar Threads
-
SIOC Elevator Pot Code
By tomenglish2000 in forum OpenCockpits General DiscussionReplies: 0Last Post: 09-28-2009, 06:26 AM -
SIOC Code for MCP, MIP, and TQ updated
By BoeingNG in forum OpenCockpits General DiscussionReplies: 3Last Post: 08-10-2008, 05:53 PM -
Sixpack SIOC code
By dcutugno in forum PMSystemsReplies: 0Last Post: 12-16-2007, 04:55 PM -
ALT , FLT LDG, Displays and ENC SIOC code
By dcutugno in forum PMSystemsReplies: 0Last Post: 12-10-2007, 07:10 PM -
SIOC Code
By Polmer in forum I/O Interfacing Hardware and SoftwareReplies: 6Last Post: 12-28-2006, 10:49 AM