![]() |
Double aus Bytes erstellen
Hallo,
ich habe ein Array mit 8 Byte, wie kann ich diese in einen Double verwandeln? Dieser Double wurde voher auf einem Mikrocontroller auseinandergenommen um in über die serielle Schnittstelle übertragen zu können. Grüße Stefan |
Re: Double aus Bytes erstellen
Delphi-Quellcode:
oder über "unions" in c style
var
ar: array[0..7]of Byte; db: PDouble; myDouble: Double; begin db := PDouble(@ar[0]); myDouble := db^; end;
Delphi-Quellcode:
type TMultiType = packed record
case Boolean of true: (as_array: array[0..7]of Byte); false: (as_double: Double); end; |
Re: Double aus Bytes erstellen
Danke! Funktioniert
Grüße Stefan |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:44 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz