PDA

View Full Version : Question for Nico !



Georg Schneider
05-19-2008, 11:26 AM
Hi Nico!

I need your help urgend!:-D

I`m Betatester for new flightdecksoftware from www.flightdecksoftware.com (http://www.flightdecksoftware.com)

I programmed the sioc script for their MCP and everything is working
except CMDB botton.

The MCP is like the PM one with their own FSUIPC Offsets.

Read only variables for CMD-LED:
CMDA Switch read only "0=off" , "1=on" $6DC4 Length 1

CMDB Switch read only "0=off" , "1=on" $6DC5 Length 1

Autopilot switch offset:
$6DB2 Length 1
Bits from left to right
1= Autopilot 1 engage
2= Autopilot 2 engage
Write bitvalue 1 to toggle . Combinations are possible , Value is reset to "0" after reading

Here is the section from my script:

Var 0084, Link FSUIPC_OUT, Offset $6DB2, Length 1 // MCP CMD OFS


Var 0087, Link FSUIPC_IN, Offset $6DC4, Length 1 // MCP CMD A LED
{
IF V0087 = 1
{
V0514 = 1
}
IF V0087 = 0
{
V0514 = 0
}
}
Var 0088, Link FSUIPC_IN, Offset $6DC5, Length 1 // MCP CMD B LED
{
IF V0088 = 1
{
V0515 = 1
}
IF V0088 = 0
{
V0515 = 0
}
}
Var 0213, Link IOCARD_SW, Input 21, Type P // Boton CMDA
{
IF V0213 = 1
{
V0084 = 1
}
ELSE
{
V0084 = 0
}
}
Var 0214, Link IOCARD_SW, Input 19, Type P // Boton CMDB
{
IF V0214 = 1
{
V0084 = 02
}
ELSE
{
V0084 = 0
}
}
Var 0514, Link IOCARD_OUT, Output 33 // Led CMDA
Var 0515, Link IOCARD_OUT, Output 35 // Led CMDB

With this constelation only CMDA is working correctly.

Can you give me a tip how to programm this?
The rest of the script works fine with the mcp software.

Thanks very much!

Greetings
Georg

kiek
05-19-2008, 11:53 AM
Hi George,

First question: are you sure the fsuipc interface is implemented correctly? this being a beta...



Autopilot switch offset:
$6DB2 Length 1
Bits from left to right
1= Autopilot 1 engage
2= Autopilot 2 engage
Write bitvalue 1 to toggle . Combinations are possible , Value is reset to "0" after reading


Second question:
What do you mean with bits from left to right? I'd expect them to be defined from right to left, or more formally, from least significant to most significant.
Normally the least significant bit is defined to be bit 0, then bit 1 and so on.

To set bit 0 to 1 you write 1, to set bit 1 to 1 you write 2, to set bit 2 to 1 you have to write 4..

Nico

Georg Schneider
05-19-2008, 12:38 PM
Hi Nico;)

Thanks for the quick answer!

You are right the fsuipc offsets list says "from right to left"

So to give offset $6DB2 Length 1 the value "1" i must write "1"
and value "2" i must write "4"

I try it out and post my results!

Thanks for helping anyway;)

Greets
Georg

Georg Schneider
05-19-2008, 02:12 PM
Me again!

Problem solved!

It was a bug in fsuipc offset.

Thanks for your advice Nico:D

Greetings Georg