{-------------------------------------------------------------------------}
{ Интерфейсный модуль библиотеки Lcard_ad для BP7.0/Delphi                }
{-------------------------------------------------------------------------}
UNIT LCARD_AD;
interface

type
    Proc=procedure;
    PTErrorHandler=pointer;
{procedure(Error:longint;OSError:longint);}
    TDDS=record
        Size:longint;
        Offset:longint;
        SegSel:word;
        BufferID:word;
        Physical:longint;
    End;
    PTDDS=^TDDS;
    PWord=^word;
    TDmaChannel=record
        DDS:TDDS;
        DmaChannelNo:integer;
        PLinear:PWord;
    End;
    PTDmaChannel=^TDmaChannel;

{ типы поддерживаемых данной библиотекой плат                             }
const
    NO_BOARD=0;
    L305=1;
    L1610=2;
    L1250=3;
    L154=4;
    L164=5;
    L1056=6;
    L1208=7;
    L264=8;
    E330=9;
    L1210=10;
    LCI01=11;
    CRAIT=12;
    L241=13;
    L1211=14;
    
    AUTODETECT_INTERFACE =-1;
    EPP_INTERFACE        = 0;
    SERIAL_INTERFACE     = 1;
    BIDIR_INTERFACE      = 2;
    IDE_INTERFACE        = 3;

procedure SELECT_SLOT(Slot:integer);
function PLATA_TEST:integer;
procedure SET_BOARD_TYPE(BoardType:integer);
function GET_BOARD_TYPE:integer;
procedure SET_BASE_ADDRESS(Address:integer);
procedure ENABLE_INT(_IntEnabled:integer);
function CREATE_CHANNEL(Channel:integer; Usil:integer; Mode:integer):word;
function MEMORY_STATE:integer;
function MEMORY_PM_STATE:integer;
procedure SET_INTER_DELAY(delay_value:integer);
procedure SET_ADSP_SPEED(DspType:integer);
procedure SET_WAIT_STATE(wait_state:integer);
procedure SET_TIMER_SCALE(ScaleValue:integer);
procedure TIMER_L154_L164(TimerNumber:integer; Mode:integer; Rate:integer);
procedure WAIT_TICK_L154_L164(TimerNumber:integer);
function GET_TIMER_L154_L164:integer;
procedure CALIBRATION;
procedure INIT_COMPARATOR(Channel:integer; Porog:integer; BitNPoint:integer; HandleMode:integer
);
procedure LOW_POWER(ModeReg:integer);
function GET_SLOT_CODE(CraitNumber:integer; ModuleNumber:integer):integer;
procedure RESET_ALL;
function MAKE_CHANNEL(CraitNumber:integer; ModuleNumber:integer; Chan:integer; 
Kadrr:integer; 
Usil:integer
):word;
procedure PROGRAM_FILTER(CraitNumber:integer; ModuleNumber:integer; CutFrequency:integer; 
AnalogFilterType:integer
);
procedure PROGRAM_LM_201(CraitNumber:integer; ModuleNumber:integer; Chan:integer; 
Usil1:integer; 
Source:integer
);
procedure PROGRAM_LM_102(CraitNumber:integer; ModuleNumber:integer; Usil1:integer
);
procedure PROGRAM_LM_501(CraitNumber:integer; ModuleNumber:integer; M3:integer; 
M2:integer; 
M1:integer; 
EN:integer; 
EP:integer; 
AN:integer; 
AP:integer
);
procedure PROGRAM_LM_DAC(CraitNumber:integer; ModuleNumber:integer; Mode:integer; 
Coded:integer; 
DacCh:integer
);
function GET_LM_401(CraitNumber:integer; ModuleNumber:integer):integer;
function LM_404(Coded:word):word;
procedure PROGRAM_LM_TTLOUT(CraitNumber:integer; ModuleNumber:integer; Coded:word
);
procedure SETCHANNEL(Channel:word);
function SAMPLE:word;
function ADCHAN(Chan:word):word;
procedure KADR(var Datad; var Chans; Nch:integer);
procedure STREAM(var Datad; Npoint:integer; Chan:word; Rate:integer);
procedure SOFT(var Datad; Nkadr:integer; var Chan; Nch:integer; Rate:integer
);
procedure SOFT_HUGE(var Datad; Nkadr:longint; var Chan; Nch:integer; Rate:integer
);
procedure DMAONE(var Datad; Npoint:integer; Chan:integer; Rate:integer; 
Dmm:integer
);
procedure DMAALL(var Datad; Nkadr:integer; var Chan; Nch:integer; Rate:integer; 
Dmm:integer
);
procedure DMA_ALL_DA(var AdDatad; AdNkadr:integer; var Chan; Nch:integer; Rate:integer; 
AdDmm:integer; 
var DaDatad; 
DaNkadr:integer; 
DaDmm:integer; 
DaNumber:integer
);
procedure OUTDA(Coded:integer);
procedure SET_DA_NUMBER(SoftDaMode:integer; DaNumber:integer);
procedure STREAM_OUTDA(Coded:word);
procedure DASTREAM(Rate:integer; Npoint:integer; var Datad);
procedure DASTREAM_HUGE(Rate:integer; Npoint:longint; var Datad);
procedure DADMASTREAM(var Datad; Npoint:integer; Rate:integer; Dmm:integer
);
procedure OUTBYTE(CodeVal:integer);
function INPBYTE:integer;
function DSP_INPBYTE:integer;
procedure DSP_OUTBYTE(CodeVal:integer);
procedure INTR_SETUP(Number:integer);
procedure STOP_INTR;
procedure RESET_IRQ;
procedure INIT_SIMPLE_INTR(Rate:integer; Rate1:integer; Vector:pointer);
procedure STREAM_INTR(Rate:integer; Vector:pointer; Chan:word);
procedure SOFT_INTR(Rate:integer; Vector:pointer; var Chan; Nch:integer);
function READ_DATA:integer;
function DATA_READY:integer;
procedure SYNCHRO_MODE(SMode:integer; TtlMask:integer; AdChannel:word; AdValue:word
);
procedure SOFT_MEMORY_START(Nkadr:longint; var Chan; Nch:integer; Rate:integer; PageNumber:integer; 
OffsetNumber:integer; 
RestartMode:integer
);
function TEST_FOR_INPUT_END:integer;
procedure GET_INPUT_DATA(var Datad; Npoint:integer);
procedure SOFT_MEMORY_RESTART;
procedure DMA_OFF;
function DMA_TEST:integer;
function DMA_COUNTER_IN:integer;
function DMA_COUNTER_OUT:integer;
procedure GET_BUFFER(var Data);
function GET_BUFFER_HALF(var Data):integer;
procedure PUT_BUFFER(var Data);
function PUT_BUFFER_HALF(var Data):integer;
procedure CONFIG_FIFO(fifo_mode:integer);
procedure CONFIG_2FIFO_TYPE(fifo_type:integer; fifo_length:integer);
procedure READ_FIFO(var Datad; Npoint:integer);
procedure STREAM_FIFO2_BEGIN(Rate:integer; Vector:pointer; var Chan; Nch:integer);
procedure GET_DIGITS_1056(Chan:integer; var Data);
procedure OUT_DIGITS_1056(Data:integer);
procedure STREAM_1056(var Datad; NKadr:integer; Chan:integer; Rate:integer);
procedure STREAM_DMA_1056(var Datad; Nkadr:integer; Chan:integer; Rate:integer; Dmm:integer
);
procedure OUT_STREAM_1056(var Datad; NPoint:integer; Rate:integer);
procedure OUT_STREAM_DMA_1056(var Datad; Npoint:integer; Rate:integer; Dmm:integer
);
procedure INIT_INTR_1056(Rate:integer; Chan:integer; Vector:pointer);
procedure SET_SYNCHRO_MODE_1056(s_mode:integer; s_number:integer; s_mask:integer);
procedure ZERO_MODE_1208(Mode:integer);
procedure OUTDA_1208(Coded:word; DacNumber:integer);
procedure KADR_1208(Nch:integer; var Datad; var DacNumber);
procedure SOFT_1208(var Datad; NPoint:integer; var DacNumber; NCh:integer; 
Rate:integer
);
procedure SOFT_FON_1208(var Datad; NPoint:integer; var DacNumber; NCh:integer; 
Rate:integer
);
procedure DMASOFT_1208(var Datad; NPoint:integer; var DacNumber; Nch:integer; 
Rate:integer; 
Dmm:integer
);
procedure SOFT_INTR_1208(Rate:integer; Vector:pointer; Nch:integer);
function GET_DATA:integer;
procedure PUT_DATA(Data:word);
procedure READ_INT_MEMORY(var Datad; Page:integer; StartAddr:integer; NWords:integer
);
procedure WRITE_INT_MEMORY(var Datad; Page:integer; StartAddr:integer; NWords:integer
);
function LOADBIOS(var FileName; DslOff:integer):integer;
procedure POWER_AND_PRINTER_E330(ModePower:integer; ModePrinter:integer);
procedure SET_EPP_MODE_E330(aEppMode:integer);
procedure SET_FIFO_PARAMETERS_E330(FifoSize:integer; FifoMode:integer);
procedure SET_SOFT_PARM_E330(Nch:integer; var Channels);
procedure SET_TIME_PARAMETERS_E330(Rate:integer);
procedure TIMER_INPUT_START_E330;
procedure STOP_FUNC_E330;
procedure TIMER_INPUT_E330(var Datad; NWords:integer);
procedure SOFT_MEMORY_PREPARE_E330(Nkadr:longint; PageNumber:integer; OffsetNumber:integer; RestartMode:integer
);
procedure SOFT_MEMORY_START_E330;
procedure TIMER_INPUT_IRQ_START_E330(Vector:pointer);
procedure IRQ_SLOW_START_E330(IrqPeriod:integer; Vector:pointer);
procedure SET_TEST_SPEED_MODE_E330(TestMode:integer);
procedure WRITE_BY_ADDRESS_E330(Address:integer; Data:word);
function READ_BY_ADDRESS_E330(Address:integer):word;
procedure BOARD_SPECIFIC_INIT(LowPowerMode:integer);
procedure SELECT_BOARD(Board:integer);
procedure SETBASEADDRESS(Address:integer);
procedure EXEC_ADSP_COMMAND(Command:integer; NWordsOut:integer; var WordsOut; NWordsIn:integer; 
var WordsIn
);
function GET_STATUS:integer;
procedure ALLOCATEBUFFER(PDmaChannel:PTDmaChannel; NeedCopy:word);
procedure CONFIG_TX_CHANNEL_LCI01(Channel:integer);
procedure FREEBUFFER(PDmaChannel:PTDmaChannel; NeedCopy:word);
procedure GET_HALF_FIFO(var Datad; NPoint:integer; Mode:integer);
procedure GET_INPUT_POINTS(var Datad);
function QADCHAN(Chan:word):word;
function LOADBIOSFROMARRAY_L1211(var BiosCode):integer;
procedure INIT_CORRECTION_LC302(Type_:word);
procedure QSOFT(var Datad; Rate:word);
procedure RESERVED2(var p1; p2:integer; p3:integer);
procedure READ_CALIBR_CC;
procedure CONFIG_RX_CHANNEL_LCI01(Channel:integer);
procedure SELECT_DEVICE(DeviceNumber:integer);
procedure SET_AD_MODE(Mode:integer);
procedure CONFIGURE_FAST_READ_CC(Nch:integer; var FastLogChanBuff);
procedure SET_CHANNELS(Nch:word; Single:word);
procedure INITIALIZE_CORRECTION_PC(CalibrMode:word);
procedure SET_DAC_BUFER_E330(Npoint:integer; var Data);
procedure SET_TIME(Rate:integer; Scale:integer; Epocha:integer);
procedure SET_FAST_PARAMS_CC(Slot301:integer; DACDelayValue:integer; NChannel:integer);
procedure START_LOOP_DAC_E330;
procedure STOP_INPUT;
procedure TIMER_INPUT;
procedure TIMER_INPUT_INTR(Vector:pointer);
procedure RESERVED4(var p1; p2:integer; p3:integer);
procedure GET_TABLE(var Table; NWords:integer);
procedure CONFIG_LC227(Slot:integer; Mode:integer; Scale:integer);
procedure GET_SAMPLE_LC227(Slot:integer; Chan:integer; var Dest);
function STATUS_LC227(Slot:integer):word;
procedure GET_KADR_LC227(Slot:integer; Mask:integer; var NWords; var DestInt);
function LOAD_BIOS_LC227(Slot:integer; var BiosCode):integer;
function GET_ERROR_HANDLER:PTErrorHandler;
function GET_TIMEOUT:longint;
function PLATA_TEST_CC:integer;
function MEMORY_STATE_CC:integer;
function MEMORY_PM_STATE_CC:integer;
procedure EXECUTE_COMMAND_CC(Code:integer; NWordsOut:integer; var WordsOut; NWordsIn:integer; 
var WordsIn
);
procedure SET_CALIBR_MODE_CC(CalibrMode:integer);
procedure SET_ERROR_HANDLER(NewErrorHandler:PTErrorHandler);
procedure OUTDA_LC301(Slot:integer; Code1:integer; Code2:integer);
function SAMPLE_LC301(Slot_301:integer; SourceSlot:integer; LogChannel:integer):word;
function SAMPLE_LC111(Slot_111:integer; LogChannel:integer):word;
procedure SET_FIFO_SIZE_CC(FifoSize:integer);
procedure CONFIG_FIFO_CC(FirstFifoPage:integer; LastFifoPage:integer);
procedure SOFT_CONFIG_CC(Slot_301:integer; NChannel:integer; var Channels; Rate:integer
);
procedure SOFT_START_CC;
procedure SOFT_STOP_CC;
function GET_NWORDS_CC(var NWords):integer;
procedure GET_SOFT_DATA_CC(var Datad; NWords:longint);
procedure SOFT_CC(Slot_301:integer; NChannel:integer; var Channels; NKadr:longint; 
Rate:integer; 
var Datad
);
procedure FAST_SOFT_IRQ_START_CC(Vector:pointer);
procedure GET_FAST_SOFT_DATA(var Datad; NWords:integer);
procedure FAST_SOFT_START_CC;
procedure GET_FAST_SOFT_IRQ_DATA(var Datad; NWords:integer);
procedure FAST_SOFT_IRQ_STOP_CC;
procedure WAIT_SOFT_DATA_CC(var Datad; NWords:longint);
function GET_CTRL_LC301(Slot:integer):integer;
procedure SET_CTRL_LC301(Slot:integer; CtrlWord:integer);
procedure READ_REG_7710(Chan:integer; A0:integer; var Datad);
procedure WRITE_REG_7710(Chan:integer; A0:integer; var Datad);
function LOAD_BIOS_LC351(Slot:integer; var BiosCode):integer;
function MEMORY_STATE_LC351(Slot:integer):integer;
procedure SET_CTRL_LC351(Slot:integer; AttenMode:integer; CommutMode:integer);
procedure OUTDA_LC351(Slot:integer; Coded:integer);
procedure LOAD_DATA_LC351(Slot:integer; Page:integer; NWords:integer; var Datad
);
procedure START_OUT_LC351(Slot:integer; NWords:longint; Delay:integer);
function LOAD_BIOS_LC451(Slot:integer; var BiosCode):integer;
function INP_DIGITS_401(Slot:integer):word;
procedure ENABLE_IRQ_401(Slot:integer; Enable:integer);
procedure OUT_DIGITS_402(Slot:integer; Data:word);
procedure ENABLE_IRQ_402(Slot:integer; Enable:integer);
procedure OUT_DIGITS_403(Slot:integer; Data:longint);
function INP_DIGITS_403(Slot:integer):longint;
procedure ENABLE_IRQ_403(Slot:integer; Enable:integer);
procedure ENABLE_OUT_403(Slot:integer; EnableMask:integer);
function READ_IO_403(Slot:integer):integer;
procedure RESET_ANSW_403(Slot:integer);
procedure PROGRAM_FILTER_LC201(Slot:integer; Freq:longint);
procedure PROGRAM_USIL_LC201(Slot:integer; Channel:integer; Kusil:integer);
procedure PROGRAM_FILTER_LC210(Slot:integer; Freq:longint);
procedure PROGRAM_USIL_LC210(Slot:integer; Channel:integer; Kusil:integer);
function READ_FLASH_CC(Slot:integer; Addr:integer):integer;
procedure WRITE_FLASH_CC(Slot:integer; Addr:integer; Data:integer);
procedure WRITE_EN_DS_CC(Slot:integer; Enable:integer);
procedure PUT_REMOTE_WORD_CC(Addr:integer; Data:word);
function GET_REMOTE_WORD_CC(Addr:integer):word;
procedure PUT_REMOTE_ARRAY_CC(aPage:integer; Addr:integer; NWords:integer; var Datad
);
procedure GET_REMOTE_ARRAY_CC(aPage:integer; Addr:integer; NWords:integer; var Datad
);
procedure SET_IRQ_MASK_CC(IrqMask:integer);
procedure GET_MODULE_IRQ(var IrqCount; var IrqMarkers);
procedure SET_TIMEOUT(Value:longint);
procedure LOW_POWER_CC(IsLowPower:integer);
procedure OUTDA_LC302(Slot:integer; Channel:integer; Datad:integer);
procedure KADR_LC302(Slot:integer; var ChanAndData; NChannel:integer);
procedure SET_CTRL_LC302(Slot:integer; CtrlWord:integer);
procedure PROGRAM_AD8402(Slot:integer; ChanExt:integer; ChanInt:integer; Data:integer
);
procedure PROGRAM_MAX(Slot:integer; ChanExt:integer; Data:longint);
procedure OUTDA_AD8842(Slot:integer; ChanInt:integer; Datad:integer);
procedure RELEASEDMACHANNEL(Channel:word);
procedure FORCE_INTER_DELAY_CC(InterDelay:integer);
procedure CONNECT_LC501(Slot:integer; Connection:longint);
function ADCHAN_L241(LogChannel:integer):longint;
procedure SELFCALIBR_L241(LogChannel:integer; Control:longint);
procedure SET_INTERFACE_TYPE(aEppMode:integer);
procedure SET_DEVICE_BINDING(InterfaceDevice:integer);
procedure SET_CRAIT_ADDRESS(aBase:integer);
procedure GET_INI_SETTINGS;
procedure CONFIG_LC451(Slot:integer; Mode:integer; Scale:integer);
function STATUS_LC451(Slot:integer):word;
procedure GET_SAMPLE_LC451(Slot:integer; Chan:integer; var Dest);
procedure GET_KADR_LC451(Slot:integer; Mask:integer; var NWords; var DestInt);
procedure SET_THRESHOLD_LC451(Slot:integer; Chan:integer; Typ_:integer; Val:integer
);
procedure SET_IRQ_INFOM_CC(NumCraitSlots:integer; var InfArr);
procedure SET_LC227DATA_IRQSET_CC;
procedure GET_IRQ1DATA_CC(Slot:integer; NWords:integer; var DatArr);
function GET_LC227CHMASK(Slot:integer; ShiftVal:integer):word;
procedure REQUESTDMACHANNEL(var Data; NPoint:word; Channel:word; Dmm:word);
function CALIBRLC201_STEP1_BEG(aSlot_201:integer; aSlot_301:integer):integer;
function CALIBRLC201_STEP1_CYCLE(aChannel:integer; aGain:integer; var Value):integer;
function CALIBRLC201_STEP1_FIN(var NameOfClbFile):integer;
function CALIBRLC201_STEP2_BEG(aSlot_201:integer; aSlot_301:integer):integer;
function CALIBRLC201_STEP2_CYCLE_CHANV0(aChannel:integer; var ValueExpected; var ValueMeasured):integer;
function CALIBRLC201_STEP2_CYCLE_CHANV5(aChannel:integer; var ValueExpected; var ValueMeasured):integer;
function CALIBRLC201_STEP2_CYCLE_CHANZG(aChannel:integer; var Values; var OffsetValue; var GainValue
):integer;
function CALIBRLC201_STEP2_CYCLE_GAIN(aGain:integer; var NameClbFile):integer;
function CALIBRLC201_STEP2_FIN(var FileName):integer;
procedure CALIBR_LC201_STEP1(Slot201:integer; Slot301:integer);
function CALIBR_LC201_STEP2(Slot201:integer; Slot301:integer):integer;
function GET_DFLTCALIBRSET_LC201(var xFltFreq; var xForceIntDel; var xnGains; var xckdFile; 
var Ku; 
var xTimeDAC; 
var xNPoint
):integer;
procedure SETU_LC301(Slot_301:integer; U:double);
function SET_DFLTCALIBRSET_LC201(xFltFreq:longint; xForceIntDel:integer; xnGains:integer; var xckdFile; 
var Ku; 
xTimeDAC:integer; 
xNPoint:integer
):integer;
procedure SET_TRIM_DAC_LC201_FILE(Slot_201:integer; Chan:integer; Gain:integer; var NameClbFile
);
procedure READ_REG_7710_CRAIT(Slot:integer; A0:integer; var Datad);
procedure WRITE_REG_7710_CRAIT(Slot:integer; A0:integer; var Datad);
function CHECK_OVERFLOW_7710_CRAIT:integer;
procedure ENABLE_7710_CRAIT(Slot:integer; Mode:integer);
function FINISH_READ_7710_CRAIT(Slot_301:integer):double;
function FINISH_READ_CODE_7710_CRAIT(Slot_301:integer):longint;
function IS_7710_PRESENT_CRAIT(Slot_301:integer):integer;
function IS_7710_READY_CRAIT(Slot_301:integer):integer;
function READ_7710_CRAIT(Slot_301:integer):double;
function READ_CODE_7710_CRAIT(Slot_301:integer):longint;
procedure RESET_FILTER_7710_CRAIT;
procedure SELF_CALIBR_7710_CRAIT(Slot_301:integer; Gain:integer);
procedure SET_CHANNEL_7710_CRAIT(Slot_301:integer; ExtChan:integer);
function CREATE_CHANNEL_LC201(Channel:integer; Gain:integer; UvxOpened:integer; ConnectDAC:integer
):integer;
procedure KADR_LC227(Slot:integer; Scale:integer; Mask:integer; var Dest
);
function SET_CALIBRATION_LC227(Slot:integer):integer;
procedure SET_CALIBRATION_LC227_ALL;
function GET_LC201_CONNECTDAC_MODE:integer;
procedure SET_LC201_CONNECTDAC_MODE(aConnectDACMode:integer);
procedure INIT_LC201_FROM_FILE(Slot_201:integer; var FileName; CalibrMode:integer; Freq:longint; 
var GainsForChan; 
InterDelayVal:integer; 
aPage1_Fifo:integer; 
aPage2_Fifo:integer
);
procedure INIT_LC201_FROM_PPZU(Slot_201:integer; Freq:longint; var GainsForChan; InterDelayVal:integer; 
aPage1_Fifo:integer; 
aPage2_Fifo:integer
);
procedure KADR_LC451(Slot:integer; Mode:integer; Scale:integer; Mask:integer; 
var Dest
);
procedure INIT_MODULE_LC201(Slot:integer; CalibrMode:integer; Freq:longint; var CurrentModes; 
InterDelayVal:integer; 
aPage1_Fifo:integer; 
aPage2_Fifo:integer
);
procedure TRANSMIT_CALIBR_DATA201_TO_PPZU(Slot:integer; var FileName; var GainSet);
function IN_BYTE(Port:word):word;
function IN_WORD(Port:word):word;
function OUT_BYTE(Port:word; Value:word):word;
function OUT_WORD(Port:word; Value:word):word;
procedure RESET_SYNMODE;
procedure SET_SYNMODE_ADC(Slot_301:word; SourceSynSlot:word; LogSynChan:word; SynDir:word; 
SynLevel:word
);
procedure SET_SYNMODE_TTL(SMode:word; SynSlot:word; SynChan:word; Dir:word);
procedure START_SYNSOFT;
procedure SYNSOFT_CC(Slot_301:word; NChannel:word; var Channels; NKadr:word; 
Rate:word; 
var Datad
);
function LOADBIOS_MODULE_CC(xSlot:integer; var FileName; ModuleType:integer):integer;
function CREATE_CHANNEL_LC101(Channel:integer; Gain:integer; Mode:integer):integer;
function CREATE_CHANNEL_LC102(Channel:integer; Gain:integer; Mode:integer):integer;
function CREATE_CHANNEL_LC104(Channel:integer; Gain:integer; Mode:integer):integer;
function CREATE_CHANNEL_LC111(Channel:integer; Gain:integer; Mode:integer):integer;
function CREATE_CHANNEL_LC210(Channel:integer; UvxOpened:integer; BaseChan:integer):integer;
procedure DEINSTALLLOGIO;
procedure INSTALLLOGIO;
function CREATE_CONTROL_WORD_LC302(Slot:integer; Channel:integer; Datad:integer):word;
function CREATE_FAST_CHAN_CC(ModuleType:integer; Slot:integer; LogChan:word):word;
procedure KADR_OUT_LC302_FAST_CC(Slot302:integer; NChan:integer; var CtrlWrdBuff);
procedure OUT_LC302_FAST_CC(Slot302:integer; Datad:word);
procedure READ_FAST_KADR_CC(Nch:integer; var Datad);
function READ_FAST_SAMPLE_CC(CtrlWrdFast:word):integer;
function LOADCRAIT(CraitType:integer; Adr:integer):integer;
function AUTO_PREPARE_MODULE(ModuleCode:integer):word;
function _GET_DATA:word;
procedure _PUT_DATA(Data:word);
procedure _SEND_COMMAND(Command:word);
function FAST_LOADING_LC010(var BiosCode):integer;
function FAST_LOADING_LCI01(var BiosCode):integer;

implementation

procedure SELECT_SLOT(Slot:integer);external 'LCARD_AD';
function PLATA_TEST:integer;external 'LCARD_AD';
procedure SET_BOARD_TYPE(BoardType:integer);external 'LCARD_AD';
function GET_BOARD_TYPE:integer;external 'LCARD_AD';
procedure SET_BASE_ADDRESS(Address:integer);external 'LCARD_AD';
procedure ENABLE_INT(_IntEnabled:integer);external 'LCARD_AD';
function CREATE_CHANNEL(Channel:integer; Usil:integer; Mode:integer):word;external 'LCARD_AD';
function MEMORY_STATE:integer;external 'LCARD_AD';
function MEMORY_PM_STATE:integer;external 'LCARD_AD';
procedure SET_INTER_DELAY(delay_value:integer);external 'LCARD_AD';
procedure SET_ADSP_SPEED(DspType:integer);external 'LCARD_AD';
procedure SET_WAIT_STATE(wait_state:integer);external 'LCARD_AD';
procedure SET_TIMER_SCALE(ScaleValue:integer);external 'LCARD_AD';
procedure TIMER_L154_L164(TimerNumber:integer; Mode:integer; Rate:integer);external 'LCARD_AD';
procedure WAIT_TICK_L154_L164(TimerNumber:integer);external 'LCARD_AD';
function GET_TIMER_L154_L164:integer;external 'LCARD_AD';
procedure CALIBRATION;external 'LCARD_AD';
procedure INIT_COMPARATOR(Channel:integer; Porog:integer; BitNPoint:integer; HandleMode:integer
);external 'LCARD_AD';
procedure LOW_POWER(ModeReg:integer);external 'LCARD_AD';
function GET_SLOT_CODE(CraitNumber:integer; ModuleNumber:integer):integer;external 'LCARD_AD';
procedure RESET_ALL;external 'LCARD_AD';
function MAKE_CHANNEL(CraitNumber:integer; ModuleNumber:integer; Chan:integer; 
Kadrr:integer; 
Usil:integer
):word;external 'LCARD_AD';
procedure PROGRAM_FILTER(CraitNumber:integer; ModuleNumber:integer; CutFrequency:integer; 
AnalogFilterType:integer
);external 'LCARD_AD';
procedure PROGRAM_LM_201(CraitNumber:integer; ModuleNumber:integer; Chan:integer; 
Usil1:integer; 
Source:integer
);external 'LCARD_AD';
procedure PROGRAM_LM_102(CraitNumber:integer; ModuleNumber:integer; Usil1:integer
);external 'LCARD_AD';
procedure PROGRAM_LM_501(CraitNumber:integer; ModuleNumber:integer; M3:integer; 
M2:integer; 
M1:integer; 
EN:integer; 
EP:integer; 
AN:integer; 
AP:integer
);external 'LCARD_AD';
procedure PROGRAM_LM_DAC(CraitNumber:integer; ModuleNumber:integer; Mode:integer; 
Coded:integer; 
DacCh:integer
);external 'LCARD_AD';
function GET_LM_401(CraitNumber:integer; ModuleNumber:integer):integer;external 'LCARD_AD';
function LM_404(Coded:word):word;external 'LCARD_AD';
procedure PROGRAM_LM_TTLOUT(CraitNumber:integer; ModuleNumber:integer; Coded:word
);external 'LCARD_AD';
procedure SETCHANNEL(Channel:word);external 'LCARD_AD';
function SAMPLE:word;external 'LCARD_AD';
function ADCHAN(Chan:word):word;external 'LCARD_AD';
procedure KADR(var Datad; var Chans; Nch:integer);external 'LCARD_AD';
procedure STREAM(var Datad; Npoint:integer; Chan:word; Rate:integer);external 'LCARD_AD';
procedure SOFT(var Datad; Nkadr:integer; var Chan; Nch:integer; Rate:integer
);external 'LCARD_AD';
procedure SOFT_HUGE(var Datad; Nkadr:longint; var Chan; Nch:integer; Rate:integer
);external 'LCARD_AD';
procedure DMAONE(var Datad; Npoint:integer; Chan:integer; Rate:integer; 
Dmm:integer
);external 'LCARD_AD';
procedure DMAALL(var Datad; Nkadr:integer; var Chan; Nch:integer; Rate:integer; 
Dmm:integer
);external 'LCARD_AD';
procedure DMA_ALL_DA(var AdDatad; AdNkadr:integer; var Chan; Nch:integer; Rate:integer; 
AdDmm:integer; 
var DaDatad; 
DaNkadr:integer; 
DaDmm:integer; 
DaNumber:integer
);external 'LCARD_AD';
procedure OUTDA(Coded:integer);external 'LCARD_AD';
procedure SET_DA_NUMBER(SoftDaMode:integer; DaNumber:integer);external 'LCARD_AD';
procedure STREAM_OUTDA(Coded:word);external 'LCARD_AD';
procedure DASTREAM(Rate:integer; Npoint:integer; var Datad);external 'LCARD_AD';
procedure DASTREAM_HUGE(Rate:integer; Npoint:longint; var Datad);external 'LCARD_AD';
procedure DADMASTREAM(var Datad; Npoint:integer; Rate:integer; Dmm:integer
);external 'LCARD_AD';
procedure OUTBYTE(CodeVal:integer);external 'LCARD_AD';
function INPBYTE:integer;external 'LCARD_AD';
function DSP_INPBYTE:integer;external 'LCARD_AD';
procedure DSP_OUTBYTE(CodeVal:integer);external 'LCARD_AD';
procedure INTR_SETUP(Number:integer);external 'LCARD_AD';
procedure STOP_INTR;external 'LCARD_AD';
procedure RESET_IRQ;external 'LCARD_AD';
procedure INIT_SIMPLE_INTR(Rate:integer; Rate1:integer; Vector:pointer);external 'LCARD_AD';
procedure STREAM_INTR(Rate:integer; Vector:pointer; Chan:word);external 'LCARD_AD';
procedure SOFT_INTR(Rate:integer; Vector:pointer; var Chan; Nch:integer);external 'LCARD_AD';
function READ_DATA:integer;external 'LCARD_AD';
function DATA_READY:integer;external 'LCARD_AD';
procedure SYNCHRO_MODE(SMode:integer; TtlMask:integer; AdChannel:word; AdValue:word
);external 'LCARD_AD';
procedure SOFT_MEMORY_START(Nkadr:longint; var Chan; Nch:integer; Rate:integer; PageNumber:integer; 
OffsetNumber:integer; 
RestartMode:integer
);external 'LCARD_AD';
function TEST_FOR_INPUT_END:integer;external 'LCARD_AD';
procedure GET_INPUT_DATA(var Datad; Npoint:integer);external 'LCARD_AD';
procedure SOFT_MEMORY_RESTART;external 'LCARD_AD';
procedure DMA_OFF;external 'LCARD_AD';
function DMA_TEST:integer;external 'LCARD_AD';
function DMA_COUNTER_IN:integer;external 'LCARD_AD';
function DMA_COUNTER_OUT:integer;external 'LCARD_AD';
procedure GET_BUFFER(var Data);external 'LCARD_AD';
function GET_BUFFER_HALF(var Data):integer;external 'LCARD_AD';
procedure PUT_BUFFER(var Data);external 'LCARD_AD';
function PUT_BUFFER_HALF(var Data):integer;external 'LCARD_AD';
procedure CONFIG_FIFO(fifo_mode:integer);external 'LCARD_AD';
procedure CONFIG_2FIFO_TYPE(fifo_type:integer; fifo_length:integer);external 'LCARD_AD';
procedure READ_FIFO(var Datad; Npoint:integer);external 'LCARD_AD';
procedure STREAM_FIFO2_BEGIN(Rate:integer; Vector:pointer; var Chan; Nch:integer);external 'LCARD_AD';
procedure GET_DIGITS_1056(Chan:integer; var Data);external 'LCARD_AD';
procedure OUT_DIGITS_1056(Data:integer);external 'LCARD_AD';
procedure STREAM_1056(var Datad; NKadr:integer; Chan:integer; Rate:integer);external 'LCARD_AD';
procedure STREAM_DMA_1056(var Datad; Nkadr:integer; Chan:integer; Rate:integer; Dmm:integer
);external 'LCARD_AD';
procedure OUT_STREAM_1056(var Datad; NPoint:integer; Rate:integer);external 'LCARD_AD';
procedure OUT_STREAM_DMA_1056(var Datad; Npoint:integer; Rate:integer; Dmm:integer
);external 'LCARD_AD';
procedure INIT_INTR_1056(Rate:integer; Chan:integer; Vector:pointer);external 'LCARD_AD';
procedure SET_SYNCHRO_MODE_1056(s_mode:integer; s_number:integer; s_mask:integer);external 'LCARD_AD';
procedure ZERO_MODE_1208(Mode:integer);external 'LCARD_AD';
procedure OUTDA_1208(Coded:word; DacNumber:integer);external 'LCARD_AD';
procedure KADR_1208(Nch:integer; var Datad; var DacNumber);external 'LCARD_AD';
procedure SOFT_1208(var Datad; NPoint:integer; var DacNumber; NCh:integer; 
Rate:integer
);external 'LCARD_AD';
procedure SOFT_FON_1208(var Datad; NPoint:integer; var DacNumber; NCh:integer; 
Rate:integer
);external 'LCARD_AD';
procedure DMASOFT_1208(var Datad; NPoint:integer; var DacNumber; Nch:integer; 
Rate:integer; 
Dmm:integer
);external 'LCARD_AD';
procedure SOFT_INTR_1208(Rate:integer; Vector:pointer; Nch:integer);external 'LCARD_AD';
function GET_DATA:integer;external 'LCARD_AD';
procedure PUT_DATA(Data:word);external 'LCARD_AD';
procedure READ_INT_MEMORY(var Datad; Page:integer; StartAddr:integer; NWords:integer
);external 'LCARD_AD';
procedure WRITE_INT_MEMORY(var Datad; Page:integer; StartAddr:integer; NWords:integer
);external 'LCARD_AD';
function LOADBIOS(var FileName; DslOff:integer):integer;external 'LCARD_AD';
procedure POWER_AND_PRINTER_E330(ModePower:integer; ModePrinter:integer);external 'LCARD_AD';
procedure SET_EPP_MODE_E330(aEppMode:integer);external 'LCARD_AD';
procedure SET_FIFO_PARAMETERS_E330(FifoSize:integer; FifoMode:integer);external 'LCARD_AD';
procedure SET_SOFT_PARM_E330(Nch:integer; var Channels);external 'LCARD_AD';
procedure SET_TIME_PARAMETERS_E330(Rate:integer);external 'LCARD_AD';
procedure TIMER_INPUT_START_E330;external 'LCARD_AD';
procedure STOP_FUNC_E330;external 'LCARD_AD';
procedure TIMER_INPUT_E330(var Datad; NWords:integer);external 'LCARD_AD';
procedure SOFT_MEMORY_PREPARE_E330(Nkadr:longint; PageNumber:integer; OffsetNumber:integer; RestartMode:integer
);external 'LCARD_AD';
procedure SOFT_MEMORY_START_E330;external 'LCARD_AD';
procedure TIMER_INPUT_IRQ_START_E330(Vector:pointer);external 'LCARD_AD';
procedure IRQ_SLOW_START_E330(IrqPeriod:integer; Vector:pointer);external 'LCARD_AD';
procedure SET_TEST_SPEED_MODE_E330(TestMode:integer);external 'LCARD_AD';
procedure WRITE_BY_ADDRESS_E330(Address:integer; Data:word);external 'LCARD_AD';
function READ_BY_ADDRESS_E330(Address:integer):word;external 'LCARD_AD';
procedure BOARD_SPECIFIC_INIT(LowPowerMode:integer);external 'LCARD_AD';
procedure SELECT_BOARD(Board:integer);external 'LCARD_AD';
procedure SETBASEADDRESS(Address:integer);external 'LCARD_AD';
procedure EXEC_ADSP_COMMAND(Command:integer; NWordsOut:integer; var WordsOut; NWordsIn:integer; 
var WordsIn
);external 'LCARD_AD';
function GET_STATUS:integer;external 'LCARD_AD';
procedure ALLOCATEBUFFER(PDmaChannel:PTDmaChannel; NeedCopy:word);external 'LCARD_AD';
procedure CONFIG_TX_CHANNEL_LCI01(Channel:integer);external 'LCARD_AD';
procedure FREEBUFFER(PDmaChannel:PTDmaChannel; NeedCopy:word);external 'LCARD_AD';
procedure GET_HALF_FIFO(var Datad; NPoint:integer; Mode:integer);external 'LCARD_AD';
procedure GET_INPUT_POINTS(var Datad);external 'LCARD_AD';
function QADCHAN(Chan:word):word;external 'LCARD_AD';
function LOADBIOSFROMARRAY_L1211(var BiosCode):integer;external 'LCARD_AD';
procedure INIT_CORRECTION_LC302(Type_:word);external 'LCARD_AD';
procedure QSOFT(var Datad; Rate:word);external 'LCARD_AD';
procedure RESERVED2(var p1; p2:integer; p3:integer);external 'LCARD_AD';
procedure READ_CALIBR_CC;external 'LCARD_AD';
procedure CONFIG_RX_CHANNEL_LCI01(Channel:integer);external 'LCARD_AD';
procedure SELECT_DEVICE(DeviceNumber:integer);external 'LCARD_AD';
procedure SET_AD_MODE(Mode:integer);external 'LCARD_AD';
procedure CONFIGURE_FAST_READ_CC(Nch:integer; var FastLogChanBuff);external 'LCARD_AD';
procedure SET_CHANNELS(Nch:word; Single:word);external 'LCARD_AD';
procedure INITIALIZE_CORRECTION_PC(CalibrMode:word);external 'LCARD_AD';
procedure SET_DAC_BUFER_E330(Npoint:integer; var Data);external 'LCARD_AD';
procedure SET_TIME(Rate:integer; Scale:integer; Epocha:integer);external 'LCARD_AD';
procedure SET_FAST_PARAMS_CC(Slot301:integer; DACDelayValue:integer; NChannel:integer);external 'LCARD_AD';
procedure START_LOOP_DAC_E330;external 'LCARD_AD';
procedure STOP_INPUT;external 'LCARD_AD';
procedure TIMER_INPUT;external 'LCARD_AD';
procedure TIMER_INPUT_INTR(Vector:pointer);external 'LCARD_AD';
procedure RESERVED4(var p1; p2:integer; p3:integer);external 'LCARD_AD';
procedure GET_TABLE(var Table; NWords:integer);external 'LCARD_AD';
procedure CONFIG_LC227(Slot:integer; Mode:integer; Scale:integer);external 'LCARD_AD';
procedure GET_SAMPLE_LC227(Slot:integer; Chan:integer; var Dest);external 'LCARD_AD';
function STATUS_LC227(Slot:integer):word;external 'LCARD_AD';
procedure GET_KADR_LC227(Slot:integer; Mask:integer; var NWords; var DestInt);external 'LCARD_AD';
function LOAD_BIOS_LC227(Slot:integer; var BiosCode):integer;external 'LCARD_AD';
function GET_ERROR_HANDLER:PTErrorHandler;external 'LCARD_AD';
function GET_TIMEOUT:longint;external 'LCARD_AD';
function PLATA_TEST_CC:integer;external 'LCARD_AD';
function MEMORY_STATE_CC:integer;external 'LCARD_AD';
function MEMORY_PM_STATE_CC:integer;external 'LCARD_AD';
procedure EXECUTE_COMMAND_CC(Code:integer; NWordsOut:integer; var WordsOut; NWordsIn:integer; 
var WordsIn
);external 'LCARD_AD';
procedure SET_CALIBR_MODE_CC(CalibrMode:integer);external 'LCARD_AD';
procedure SET_ERROR_HANDLER(NewErrorHandler:PTErrorHandler);external 'LCARD_AD';
procedure OUTDA_LC301(Slot:integer; Code1:integer; Code2:integer);external 'LCARD_AD';
function SAMPLE_LC301(Slot_301:integer; SourceSlot:integer; LogChannel:integer):word;external 'LCARD_AD';
function SAMPLE_LC111(Slot_111:integer; LogChannel:integer):word;external 'LCARD_AD';
procedure SET_FIFO_SIZE_CC(FifoSize:integer);external 'LCARD_AD';
procedure CONFIG_FIFO_CC(FirstFifoPage:integer; LastFifoPage:integer);external 'LCARD_AD';
procedure SOFT_CONFIG_CC(Slot_301:integer; NChannel:integer; var Channels; Rate:integer
);external 'LCARD_AD';
procedure SOFT_START_CC;external 'LCARD_AD';
procedure SOFT_STOP_CC;external 'LCARD_AD';
function GET_NWORDS_CC(var NWords):integer;external 'LCARD_AD';
procedure GET_SOFT_DATA_CC(var Datad; NWords:longint);external 'LCARD_AD';
procedure SOFT_CC(Slot_301:integer; NChannel:integer; var Channels; NKadr:longint; 
Rate:integer; 
var Datad
);external 'LCARD_AD';
procedure FAST_SOFT_IRQ_START_CC(Vector:pointer);external 'LCARD_AD';
procedure GET_FAST_SOFT_DATA(var Datad; NWords:integer);external 'LCARD_AD';
procedure FAST_SOFT_START_CC;external 'LCARD_AD';
procedure GET_FAST_SOFT_IRQ_DATA(var Datad; NWords:integer);external 'LCARD_AD';
procedure FAST_SOFT_IRQ_STOP_CC;external 'LCARD_AD';
procedure WAIT_SOFT_DATA_CC(var Datad; NWords:longint);external 'LCARD_AD';
function GET_CTRL_LC301(Slot:integer):integer;external 'LCARD_AD';
procedure SET_CTRL_LC301(Slot:integer; CtrlWord:integer);external 'LCARD_AD';
procedure READ_REG_7710(Chan:integer; A0:integer; var Datad);external 'LCARD_AD';
procedure WRITE_REG_7710(Chan:integer; A0:integer; var Datad);external 'LCARD_AD';
function LOAD_BIOS_LC351(Slot:integer; var BiosCode):integer;external 'LCARD_AD';
function MEMORY_STATE_LC351(Slot:integer):integer;external 'LCARD_AD';
procedure SET_CTRL_LC351(Slot:integer; AttenMode:integer; CommutMode:integer);external 'LCARD_AD';
procedure OUTDA_LC351(Slot:integer; Coded:integer);external 'LCARD_AD';
procedure LOAD_DATA_LC351(Slot:integer; Page:integer; NWords:integer; var Datad
);external 'LCARD_AD';
procedure START_OUT_LC351(Slot:integer; NWords:longint; Delay:integer);external 'LCARD_AD';
function LOAD_BIOS_LC451(Slot:integer; var BiosCode):integer;external 'LCARD_AD';
function INP_DIGITS_401(Slot:integer):word;external 'LCARD_AD';
procedure ENABLE_IRQ_401(Slot:integer; Enable:integer);external 'LCARD_AD';
procedure OUT_DIGITS_402(Slot:integer; Data:word);external 'LCARD_AD';
procedure ENABLE_IRQ_402(Slot:integer; Enable:integer);external 'LCARD_AD';
procedure OUT_DIGITS_403(Slot:integer; Data:longint);external 'LCARD_AD';
function INP_DIGITS_403(Slot:integer):longint;external 'LCARD_AD';
procedure ENABLE_IRQ_403(Slot:integer; Enable:integer);external 'LCARD_AD';
procedure ENABLE_OUT_403(Slot:integer; EnableMask:integer);external 'LCARD_AD';
function READ_IO_403(Slot:integer):integer;external 'LCARD_AD';
procedure RESET_ANSW_403(Slot:integer);external 'LCARD_AD';
procedure PROGRAM_FILTER_LC201(Slot:integer; Freq:longint);external 'LCARD_AD';
procedure PROGRAM_USIL_LC201(Slot:integer; Channel:integer; Kusil:integer);external 'LCARD_AD';
procedure PROGRAM_FILTER_LC210(Slot:integer; Freq:longint);external 'LCARD_AD';
procedure PROGRAM_USIL_LC210(Slot:integer; Channel:integer; Kusil:integer);external 'LCARD_AD';
function READ_FLASH_CC(Slot:integer; Addr:integer):integer;external 'LCARD_AD';
procedure WRITE_FLASH_CC(Slot:integer; Addr:integer; Data:integer);external 'LCARD_AD';
procedure WRITE_EN_DS_CC(Slot:integer; Enable:integer);external 'LCARD_AD';
procedure PUT_REMOTE_WORD_CC(Addr:integer; Data:word);external 'LCARD_AD';
function GET_REMOTE_WORD_CC(Addr:integer):word;external 'LCARD_AD';
procedure PUT_REMOTE_ARRAY_CC(aPage:integer; Addr:integer; NWords:integer; var Datad
);external 'LCARD_AD';
procedure GET_REMOTE_ARRAY_CC(aPage:integer; Addr:integer; NWords:integer; var Datad
);external 'LCARD_AD';
procedure SET_IRQ_MASK_CC(IrqMask:integer);external 'LCARD_AD';
procedure GET_MODULE_IRQ(var IrqCount; var IrqMarkers);external 'LCARD_AD';
procedure SET_TIMEOUT(Value:longint);external 'LCARD_AD';
procedure LOW_POWER_CC(IsLowPower:integer);external 'LCARD_AD';
procedure OUTDA_LC302(Slot:integer; Channel:integer; Datad:integer);external 'LCARD_AD';
procedure KADR_LC302(Slot:integer; var ChanAndData; NChannel:integer);external 'LCARD_AD';
procedure SET_CTRL_LC302(Slot:integer; CtrlWord:integer);external 'LCARD_AD';
procedure PROGRAM_AD8402(Slot:integer; ChanExt:integer; ChanInt:integer; Data:integer
);external 'LCARD_AD';
procedure PROGRAM_MAX(Slot:integer; ChanExt:integer; Data:longint);external 'LCARD_AD';
procedure OUTDA_AD8842(Slot:integer; ChanInt:integer; Datad:integer);external 'LCARD_AD';
procedure RELEASEDMACHANNEL(Channel:word);external 'LCARD_AD';
procedure FORCE_INTER_DELAY_CC(InterDelay:integer);external 'LCARD_AD';
procedure CONNECT_LC501(Slot:integer; Connection:longint);external 'LCARD_AD';
function ADCHAN_L241(LogChannel:integer):longint;external 'LCARD_AD';
procedure SELFCALIBR_L241(LogChannel:integer; Control:longint);external 'LCARD_AD';
procedure SET_INTERFACE_TYPE(aEppMode:integer);external 'LCARD_AD';
procedure SET_DEVICE_BINDING(InterfaceDevice:integer);external 'LCARD_AD';
procedure SET_CRAIT_ADDRESS(aBase:integer);external 'LCARD_AD';
procedure GET_INI_SETTINGS;external 'LCARD_AD';
procedure CONFIG_LC451(Slot:integer; Mode:integer; Scale:integer);external 'LCARD_AD';
function STATUS_LC451(Slot:integer):word;external 'LCARD_AD';
procedure GET_SAMPLE_LC451(Slot:integer; Chan:integer; var Dest);external 'LCARD_AD';
procedure GET_KADR_LC451(Slot:integer; Mask:integer; var NWords; var DestInt);external 'LCARD_AD';
procedure SET_THRESHOLD_LC451(Slot:integer; Chan:integer; Typ_:integer; Val:integer
);external 'LCARD_AD';
procedure SET_IRQ_INFOM_CC(NumCraitSlots:integer; var InfArr);external 'LCARD_AD';
procedure SET_LC227DATA_IRQSET_CC;external 'LCARD_AD';
procedure GET_IRQ1DATA_CC(Slot:integer; NWords:integer; var DatArr);external 'LCARD_AD';
function GET_LC227CHMASK(Slot:integer; ShiftVal:integer):word;external 'LCARD_AD';
procedure REQUESTDMACHANNEL(var Data; NPoint:word; Channel:word; Dmm:word);external 'LCARD_AD';
function CALIBRLC201_STEP1_BEG(aSlot_201:integer; aSlot_301:integer):integer;external 'LCARD_AD';
function CALIBRLC201_STEP1_CYCLE(aChannel:integer; aGain:integer; var Value):integer;external 'LCARD_AD';
function CALIBRLC201_STEP1_FIN(var NameOfClbFile):integer;external 'LCARD_AD';
function CALIBRLC201_STEP2_BEG(aSlot_201:integer; aSlot_301:integer):integer;external 'LCARD_AD';
function CALIBRLC201_STEP2_CYCLE_CHANV0(aChannel:integer; var ValueExpected; var ValueMeasured):integer;external 'LCARD_AD';
function CALIBRLC201_STEP2_CYCLE_CHANV5(aChannel:integer; var ValueExpected; var ValueMeasured):integer;external 'LCARD_AD';
function CALIBRLC201_STEP2_CYCLE_CHANZG(aChannel:integer; var Values; var OffsetValue; var GainValue
):integer;external 'LCARD_AD';
function CALIBRLC201_STEP2_CYCLE_GAIN(aGain:integer; var NameClbFile):integer;external 'LCARD_AD';
function CALIBRLC201_STEP2_FIN(var FileName):integer;external 'LCARD_AD';
procedure CALIBR_LC201_STEP1(Slot201:integer; Slot301:integer);external 'LCARD_AD';
function CALIBR_LC201_STEP2(Slot201:integer; Slot301:integer):integer;external 'LCARD_AD';
function GET_DFLTCALIBRSET_LC201(var xFltFreq; var xForceIntDel; var xnGains; var xckdFile; 
var Ku; 
var xTimeDAC; 
var xNPoint
):integer;external 'LCARD_AD';
procedure SETU_LC301(Slot_301:integer; U:double);external 'LCARD_AD';
function SET_DFLTCALIBRSET_LC201(xFltFreq:longint; xForceIntDel:integer; xnGains:integer; var xckdFile; 
var Ku; 
xTimeDAC:integer; 
xNPoint:integer
):integer;external 'LCARD_AD';
procedure SET_TRIM_DAC_LC201_FILE(Slot_201:integer; Chan:integer; Gain:integer; var NameClbFile
);external 'LCARD_AD';
procedure READ_REG_7710_CRAIT(Slot:integer; A0:integer; var Datad);external 'LCARD_AD';
procedure WRITE_REG_7710_CRAIT(Slot:integer; A0:integer; var Datad);external 'LCARD_AD';
function CHECK_OVERFLOW_7710_CRAIT:integer;external 'LCARD_AD';
procedure ENABLE_7710_CRAIT(Slot:integer; Mode:integer);external 'LCARD_AD';
function FINISH_READ_7710_CRAIT(Slot_301:integer):double;external 'LCARD_AD';
function FINISH_READ_CODE_7710_CRAIT(Slot_301:integer):longint;external 'LCARD_AD';
function IS_7710_PRESENT_CRAIT(Slot_301:integer):integer;external 'LCARD_AD';
function IS_7710_READY_CRAIT(Slot_301:integer):integer;external 'LCARD_AD';
function READ_7710_CRAIT(Slot_301:integer):double;external 'LCARD_AD';
function READ_CODE_7710_CRAIT(Slot_301:integer):longint;external 'LCARD_AD';
procedure RESET_FILTER_7710_CRAIT;external 'LCARD_AD';
procedure SELF_CALIBR_7710_CRAIT(Slot_301:integer; Gain:integer);external 'LCARD_AD';
procedure SET_CHANNEL_7710_CRAIT(Slot_301:integer; ExtChan:integer);external 'LCARD_AD';
function CREATE_CHANNEL_LC201(Channel:integer; Gain:integer; UvxOpened:integer; ConnectDAC:integer
):integer;external 'LCARD_AD';
procedure KADR_LC227(Slot:integer; Scale:integer; Mask:integer; var Dest
);external 'LCARD_AD';
function SET_CALIBRATION_LC227(Slot:integer):integer;external 'LCARD_AD';
procedure SET_CALIBRATION_LC227_ALL;external 'LCARD_AD';
function GET_LC201_CONNECTDAC_MODE:integer;external 'LCARD_AD';
procedure SET_LC201_CONNECTDAC_MODE(aConnectDACMode:integer);external 'LCARD_AD';
procedure INIT_LC201_FROM_FILE(Slot_201:integer; var FileName; CalibrMode:integer; Freq:longint; 
var GainsForChan; 
InterDelayVal:integer; 
aPage1_Fifo:integer; 
aPage2_Fifo:integer
);external 'LCARD_AD';
procedure INIT_LC201_FROM_PPZU(Slot_201:integer; Freq:longint; var GainsForChan; InterDelayVal:integer; 
aPage1_Fifo:integer; 
aPage2_Fifo:integer
);external 'LCARD_AD';
procedure KADR_LC451(Slot:integer; Mode:integer; Scale:integer; Mask:integer; 
var Dest
);external 'LCARD_AD';
procedure INIT_MODULE_LC201(Slot:integer; CalibrMode:integer; Freq:longint; var CurrentModes; 
InterDelayVal:integer; 
aPage1_Fifo:integer; 
aPage2_Fifo:integer
);external 'LCARD_AD';
procedure TRANSMIT_CALIBR_DATA201_TO_PPZU(Slot:integer; var FileName; var GainSet);external 'LCARD_AD';
function IN_BYTE(Port:word):word;external 'LCARD_AD';
function IN_WORD(Port:word):word;external 'LCARD_AD';
function OUT_BYTE(Port:word; Value:word):word;external 'LCARD_AD';
function OUT_WORD(Port:word; Value:word):word;external 'LCARD_AD';
procedure RESET_SYNMODE;external 'LCARD_AD';
procedure SET_SYNMODE_ADC(Slot_301:word; SourceSynSlot:word; LogSynChan:word; SynDir:word; 
SynLevel:word
);external 'LCARD_AD';
procedure SET_SYNMODE_TTL(SMode:word; SynSlot:word; SynChan:word; Dir:word);external 'LCARD_AD';
procedure START_SYNSOFT;external 'LCARD_AD';
procedure SYNSOFT_CC(Slot_301:word; NChannel:word; var Channels; NKadr:word; 
Rate:word; 
var Datad
);external 'LCARD_AD';
function LOADBIOS_MODULE_CC(xSlot:integer; var FileName; ModuleType:integer):integer;external 'LCARD_AD';
function CREATE_CHANNEL_LC101(Channel:integer; Gain:integer; Mode:integer):integer;external 'LCARD_AD';
function CREATE_CHANNEL_LC102(Channel:integer; Gain:integer; Mode:integer):integer;external 'LCARD_AD';
function CREATE_CHANNEL_LC104(Channel:integer; Gain:integer; Mode:integer):integer;external 'LCARD_AD';
function CREATE_CHANNEL_LC111(Channel:integer; Gain:integer; Mode:integer):integer;external 'LCARD_AD';
function CREATE_CHANNEL_LC210(Channel:integer; UvxOpened:integer; BaseChan:integer):integer;external 'LCARD_AD';
procedure DEINSTALLLOGIO;external 'LCARD_AD';
procedure INSTALLLOGIO;external 'LCARD_AD';
function CREATE_CONTROL_WORD_LC302(Slot:integer; Channel:integer; Datad:integer):word;external 'LCARD_AD';
function CREATE_FAST_CHAN_CC(ModuleType:integer; Slot:integer; LogChan:word):word;external 'LCARD_AD';
procedure KADR_OUT_LC302_FAST_CC(Slot302:integer; NChan:integer; var CtrlWrdBuff);external 'LCARD_AD';
procedure OUT_LC302_FAST_CC(Slot302:integer; Datad:word);external 'LCARD_AD';
procedure READ_FAST_KADR_CC(Nch:integer; var Datad);external 'LCARD_AD';
function READ_FAST_SAMPLE_CC(CtrlWrdFast:word):integer;external 'LCARD_AD';
function LOADCRAIT(CraitType:integer; Adr:integer):integer;external 'LCARD_AD';
function AUTO_PREPARE_MODULE(ModuleCode:integer):word;external 'LCARD_AD';
function _GET_DATA:word;external 'LCARD_AD';
procedure _PUT_DATA(Data:word);external 'LCARD_AD';
procedure _SEND_COMMAND(Command:word);external 'LCARD_AD';
function FAST_LOADING_LC010(var BiosCode):integer;external 'LCARD_AD';
function FAST_LOADING_LCI01(var BiosCode):integer;external 'LCARD_AD';

End.
