Results 1 to 1 of 1
-
10-27-2007, 08:23 AM #1
SIOC code for ADF1 (any aircraft)
Hi,
Here an updated version of my SIOC script for ADF1, based on generic FSUIPC offsets. I think that most aircraft will support this.
ADF2 source and a script supporting ADF1 and ADF2 based on one hardware ADF radio, are available for download at my site www.nicokaan.nl
Cheers,
Nico
//////////////////////////////////////////////////////////////////
// ADF1
//
// SIOC 3.4 code for generic FSUIPC offsets
//
// Version 1.0
// Oct 27 2007
//
// Nico Kaan
// The Netherlands
// www.nicokaan.nl
// email: flightsim@nicokaan.nl
//
// IMPLEMENTS:
// * a 4 digit freq display with decimal point control (xyz.d)
// * a single rotary controlling the higher two digits
// * a single rotary controlling the lower two digits
// (or one dual rotary for both)
//
// CHANGE LOG:
//
// 1.0 First Release
Var 8700 name X_ADF1High Link FSUIPC_INOUT Offset $034C Length 2
{
L0 = FROMBCD &X_ADF1High
IF &ADF1High <> L0 // block values coming from rotary
{
&ADF1High = L0
&ADF1HighR = DIV &ADF1High 10
CALL &CalcADF1LowR
CALL &CalcADF1Freq
}
}
Var 8701 name X_ADF1Low Link FSUIPC_INOUT Offset $0356 Length 2
{
IF &X_ADF1Low <> &ADF1Low // block values coming from rotary
{
&ADF1Low = &X_ADF1Low
CALL &CalcADF1LowR
CALL &CalcADF1Freq
}
}
Var 8710 name ADF1High // FSUIPC ADF value high: 3 digits
Var 8711 name ADF1Low // FSUIPC ADF value: 1 digit
var 8712 name ADF1Freq // total (needed for display): 4 digits
var 8713 name CalcADF1Freq Link Subrutine
{
L0 = &ADF1High * 10 // high * 10
&ADF1Freq = L0 + &ADF1Low // + decimal
CALL &OutADF1
}
Var 8720 name OutADF1 Link SUBRUTINE
{
&D_ADF1 = &ADF1Freq
&O_ADF1DP = 1
}
Var 8740 name ADF1HighR // higher TWO digits controlled by rotarie
Var 8741 name ADF1LowR // lower TWO digits controlled by rotarie
var 8742 name CalcADF1LowR Link Subrutine
{
L0 = MOD &ADF1High 10
L0 = L0 * 10
&ADF1LowR = L0 + &ADF1Low
}
var 8743 name CalcADF1High Link Subrutine
{
L0 = DIV &ADF1LowR 10
L1 = &ADF1HighR * 10
&ADF1High = L0 + L1
}
Var 8744 name RO_ADF1High Link IOCARD_ENCODER Device 1 Input 68 Aceleration 4 Type 2
{
// controls the higher TWO digits
L0 = &RO_ADF1High * -1 // change direction
&ADF1HighR = ROTATE 20 99 L0
CALL &CalcADF1High
CALL &CalcADF1Freq
&X_ADF1High = TOBCD &ADF1High // higher 3 Digits in bcd to fsuipc
}
Var 8745 name RO_ADF1Low Link IOCARD_ENCODER Device 1 Input 70 Aceleration 4 Type 2
{
// controls the lower TWO digits
L0 = &RO_ADF1Low * 5 // in steps of 5
&ADF1LowR = ROTATE 0 99 L0
&ADF1Low = MOD &ADF1LowR 10
CALL &CalcADF1High
CALL &CalcADF1Freq
&X_ADF1Low = &ADF1Low // decimal digit to fsuipc
&X_ADF1High = TOBCD &ADF1High // higher 3 Digits in bcd to fsuipc
}
Var 8770 name D_ADF1 Link IOCARD_DISPLAY Device 1 Digit 16 Numbers 4
Var 8780 name O_ADF1DP Link IOCARD_OUT Device 1 Output 95
Similar Threads
-
sioc code a320 fcu need help
By usssp in forum I/O Interfacing Hardware and SoftwareReplies: 5Last Post: 03-12-2013, 11:02 AM -
SIOC code issues - Can someone take a look?
By XOrionFE in forum I/O Interfacing Hardware and SoftwareReplies: 8Last Post: 02-04-2009, 08:43 AM -
What's going wrong in my SIOC code?
By MicroHellas in forum I/O Interfacing Hardware and SoftwareReplies: 11Last Post: 08-22-2008, 06:55 AM -
SIOC Code for MCP, MIP, and TQ updated
By BoeingNG in forum OpenCockpits General DiscussionReplies: 3Last Post: 08-10-2008, 05:53 PM -
SIOC Code
By Polmer in forum I/O Interfacing Hardware and SoftwareReplies: 6Last Post: 12-28-2006, 10:49 AM
Search Girls from your city for night
B_34 TOGA takeoff