# Thread: SIOC code for vertical speed gauge ?

1. ## SIOC code for vertical speed gauge ?

Hello,

can somebody help me getting the vertical speed gauge (http://www.opencockpits.com/catalog/....html?cPath=48) to work ?

The code I found in the SIOC programm directory is not in alignment with the Gauge.

Code:
```// *****************************************************************************
// * 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 ?

Thanks a lot,
Markus

2. ## Re: SIOC code for vertical speed gauge ?

Hi Markus,

as you can read in the script you need to adapt the script for you servo motor....
So I would suggest you connect your servo motor, find out where the 0 point is, align this with the -xxx feet/min on the gauge, find then the number of steps it takes to get to + xxx feet/min on the gauge, then see where the 0 feet/min lies... and adapt the script accordingly

Greetz Peter

3. ## Re: SIOC code for vertical speed gauge ?

Hello Peter,

I am now a little bit confused. Is the gauge really showing the vertical speed, same as the PFD shows? Or is this a complete different system? I tried to find some information about this instrument, but I didn't found anything what is explainin the correct function for this.
Do you know this?

regards,
Markus

4. ## Re: SIOC code for vertical speed gauge ?

Markus

There are two separate issues here. The planes Vertical Speed Indicator shows the physical rate of climb/descent in relation to the ground. The Cabin Rate of Climb relates to the actual drop/rise in pressure within the cabin. The two are not the same. For example a plane climbs from 0ft altitude to 36,000 ft in 18 minutes - that is a vertical speed of 2,000ft per minute. However, the cabin is limited to an internal pressure equivalent to a height of 8,000 ft. I do not know the ratio of cabin pressure rise in relation to external pressure, however, assuming an operational ceiling of 36,000 and a linear internal increase; then whilst the plane rises at 2000ft per min the internal cabin pressure goes from 0 to 8000ft in 18 minutes which is equivalent to a Cabin Rise of 444ft per min.

Given the above, it should be possible to code an approx simulation within SIOC

David

5. ## Re: SIOC code for vertical speed gauge ?

Thanks David for you explanation.
I just found in the SimAvionics Server a variable called: AIR_CABIN_RATE
maybe this is the right value to be triggered to the servo.
I will have a look today what the value reports on climbing /descend.

thanks,
Markus

6. ## Re: SIOC code for vertical speed gauge ?

I found a working code in the SimAvionics Forum.
Thanks alot,
Markus

7. ## Re: SIOC code for vertical speed gauge ?

Plwase share the code if possible.

Thanks!

Ruediger

8. ## Re: SIOC code for vertical speed gauge ?

Hi,

here is the link to the code, as I am not sure if I can share the code directly here.
http://www.sim-avionics.com/newforum...=2&t=395#p2082

regards,
Markus