Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20688

BASCOM-AVR : how to assembled a three bye array in one data type : REPLY

$
0
0
[quote:4e89ce276d]I am able to collect one register of one old metering chip ADE7753 it is a 24 bit signed value, I am storing it in three byt array. 1- My question is how I can assembled it in one data type , say small, double I am not sure which data type??? [/quote:4e89ce276d] Store the received value in a Long variable "Num24" (MSByte will be always 0). Then convert it to a regular signed Long "Result". [code:1:4e89ce276d]Dim Num24 As Long ' 24-bit two's complement Dim Result As Long ' (signed) long Do If Num24.23 = 0 Then Result = Num24 Else Result = Num24 - 16777216 End If[/code:1:4e89ce276d]

Viewing all articles
Browse latest Browse all 20688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>