markusr
09-23-2010, 04:31 AM
Hello,
can somebody help me getting the vertical speed gauge (http://www.opencockpits.com/catalog/cabin-climb-p-193.html?cPath=48) to work ?
The code I found in the SIOC programm directory is not in alignment with the Gauge.
// *****************************************************************************
// * Config_SIOC ver 1.97 - By Manolo Vélez - www.opencockpits.com
// *****************************************************************************
// * FileName : a.txt
// * Date : 4/4/2005
// In this example, gauge have 4 sectors for positive and 4 sectors for negative values
// In this example, gauge have 1020 steps, 510 for positive and 510 for negative
// sectors are : 0-1000 = 150 steps, 1001-2000 = 100 steps, 2001-4000 = 160 steps and 4000-6000 = 100 steps
// You need change those parameters for your gauges.
Var 0010, Link FSUIPC_IN, Offset $02C8, Length 4, Type 1 // Vertical Speed
{
L0 = V0010 * 0.7895 // FSUIPC conversion, L0=VS
L0 = ABS L0 // L0 not signed
L2 = L0
IF L0 <= 1000 // First sector
{
L1 = L2 * 0.15 // (150 steps/1000 values) = 0.15
}
ELSE // Is a greater value
{
L2 = L0 - 1000 // L2 only have values for next sector
IF L0 <= 2000 // Second sector
{
L1 = L2 * 0.1 // (100 steps / 1000 values) = 0.1
L1 = L1 + 150 // Add steps of others sectors
}
ELSE
{
L2 = L0 - 2000 // L2 only have values for next sector
IF L0 <= 4000 // 3. Sector
{
L1 = L2 * 0.08 // ( 160 / 2000) =0.08
L1 = L1 + 250 // Add steps of others sectors 150+100
}
ELSE
{
L2 = L0 - 4000 // L2 only next sector (Value-1000-1000-2000)
IF L0 <= 6000 // 4. Sector
{
L1 = L2 * 0.05 // ( 100 / 2000) =0.05
L1 = L1 + 410 // Add steps of others sectors 150+100+160
}
ELSE // Out of range
{
L1 = 510 // Max. position
}
}
}
}
IF V0010 < 0 // if vs is negative
{
V0000 = 511 - L1 // subctract from center
}
ELSE
{
V0000 = 511 + L1 // else add to center
}
}
Var 0000 // Servo Motor
Somebody get the gauge working with the correct sections for climb and descend ?
Please advice,
Thanks a lot,
Markus
can somebody help me getting the vertical speed gauge (http://www.opencockpits.com/catalog/cabin-climb-p-193.html?cPath=48) to work ?
The code I found in the SIOC programm directory is not in alignment with the Gauge.
// *****************************************************************************
// * Config_SIOC ver 1.97 - By Manolo Vélez - www.opencockpits.com
// *****************************************************************************
// * FileName : a.txt
// * Date : 4/4/2005
// In this example, gauge have 4 sectors for positive and 4 sectors for negative values
// In this example, gauge have 1020 steps, 510 for positive and 510 for negative
// sectors are : 0-1000 = 150 steps, 1001-2000 = 100 steps, 2001-4000 = 160 steps and 4000-6000 = 100 steps
// You need change those parameters for your gauges.
Var 0010, Link FSUIPC_IN, Offset $02C8, Length 4, Type 1 // Vertical Speed
{
L0 = V0010 * 0.7895 // FSUIPC conversion, L0=VS
L0 = ABS L0 // L0 not signed
L2 = L0
IF L0 <= 1000 // First sector
{
L1 = L2 * 0.15 // (150 steps/1000 values) = 0.15
}
ELSE // Is a greater value
{
L2 = L0 - 1000 // L2 only have values for next sector
IF L0 <= 2000 // Second sector
{
L1 = L2 * 0.1 // (100 steps / 1000 values) = 0.1
L1 = L1 + 150 // Add steps of others sectors
}
ELSE
{
L2 = L0 - 2000 // L2 only have values for next sector
IF L0 <= 4000 // 3. Sector
{
L1 = L2 * 0.08 // ( 160 / 2000) =0.08
L1 = L1 + 250 // Add steps of others sectors 150+100
}
ELSE
{
L2 = L0 - 4000 // L2 only next sector (Value-1000-1000-2000)
IF L0 <= 6000 // 4. Sector
{
L1 = L2 * 0.05 // ( 100 / 2000) =0.05
L1 = L1 + 410 // Add steps of others sectors 150+100+160
}
ELSE // Out of range
{
L1 = 510 // Max. position
}
}
}
}
IF V0010 < 0 // if vs is negative
{
V0000 = 511 - L1 // subctract from center
}
ELSE
{
V0000 = 511 + L1 // else add to center
}
}
Var 0000 // Servo Motor
Somebody get the gauge working with the correct sections for climb and descend ?
Please advice,
Thanks a lot,
Markus