Omega-engineering OME-A826PG Instrukcja Użytkownika Strona 31

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 60
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 30
OME-A-826PG Software Manual [Win 95/98/NT]
2.3.3 A826U.PAS
unit A826U;
interface
type PSingle=^Single;
type PWord=^Word;
type PInteger=^Integer;
type PSmallInt=^PSmallInt;
Function A826_AD2F(hex, Gain :Word): Single ; StdCall;
implementation
uses math;
//*-----------------------------------------------------*
//* Return voltage value or -100.0 if any error occurs *
//* or parameter is out of range. *
//* Gain : 0-3 *
//*-----------------------------------------------------*
Function A826_AD2F(hex, Gain :Word): Single ;
Var
ZeroBase, VoltageRange, FullRange : Single ;
i : Integer ;
Begin
ZeroBase := 0;
FullRange := 32767;
VoltageRange := 10;
i := hex;
if i > $7FFF then
i := ((Not hex) + 1) * -1 ;
Gain := Gain mod 16 ;
If (Gain < 0) Or (Gain > 3) Then
begin
result := -100;
exit;
end;
Result := ((((i - ZeroBase) / FullRange) * VoltageRange) / Power(2, Gain));
End;
end.
Date: Aug-15-2000 Ver: 2.2 Page 29
Przeglądanie stron 30
1 2 ... 26 27 28 29 30 31 32 33 34 35 36 ... 59 60

Komentarze do niniejszej Instrukcji

Brak uwag