Herunterladen Inhalt Inhalt Diese Seite drucken

ABB Protronic 100 Bedienungsanleitung Seite 41

Vorschau ausblenden Andere Handbücher für Protronic 100:
Inhaltsverzeichnis

Werbung

IF (Byte(3) AND &H80) = &H80 THEN Vorzeichen = -1
'-------------------------------------------------------
'Exponent ermitteln aus Bit 6 bis 0 aus Byte(3)
'und Bit 8 aus Byte(2)
Exponent = (Byte(3) AND &H7F) * 2 + (Byte(2) \ 128)
'-------------------------------------------------------
'Mantisse ermitteln:
'Bit 7 von Byte(3) setzen,
'Mantisse aus Byte(0) bis Byte(3) errechnen
Mantisse = (Byte(2) OR &H80) * &H10000
Mantisse = Mantisse + Byte(1) * &H100 + Byte(0)
'-------------------------------------------------------
RealWert! = Vorzeichen * Mantisse / (2 ^ (23 - (Exponent - &H7F)))
PRINT "Rückrechnung = "; RealWert!
LOOP
'---------------------------------------------------
'Umwandlung einer Hex-Ziffer in Binädarstellung
'---------------------------------------------------
FUNCTION BINAER$ (z$)
DEFINT A-Z
FOR i = 1 TO LEN(z$)
NEXT
BINAER$ = X$
END FUNCTION
42/62-50040 DE
Protronic 100/500/550, Digitric 500, MODBUS-Schnittstellenbeschreibung
x1$ = ""
X% = VAL("&H" + MID$(z$, i, 1))
DO UNTIL X% = 0
Y$ = LTRIM$(STR$(X% MOD 2))
X% = X% \ 2
x1$ = Y$ + x1$
LOOP
x1$ = RIGHT$("0000" + x1$, 4)
X$ = X$ + " " + x1$
Anhang 3
41

Werbung

Inhaltsverzeichnis
loading

Diese Anleitung auch für:

Digitric 500Protronic 500Protronic 550

Inhaltsverzeichnis