48
46
45
53
`Add the two bytes and convert to a single data type
oottte
'Visual Basic routine to convert the data in the return string from a DCP-E device from 2 byte binary to a signed decimal.
`Return true
sData = CSng(HighByte + LowByte)
56
`Extract the data's low byte
51
43
Exit Function
oon
'Return: decimal value
42
44
LowByte = Asc(Mid(ReceiveString, ByteNum + 1, 1))
52
`Shift left
55
N
60
X
ppllliiiccca
Humidity Sensor 4 Time out of limits low byte (minutes)
Humidity Sensor 4 Out of limits state (1 = out of limits)
3/7/2006
A
Degrees °C or °F (0x43 = C, 0x46 = F)
Water Input Time out of limits high byte (minutes)
ee
`Routine failed
58
Water Input State high byte (1 = water present, 0 = water not present, 1000 = loss of power)
Water Input Out of limits state (1 = out of limits)
X
sData = &H10000 - sData
Water Input Time out of limits high byte (minutes)
End Function
Humidity Sensor 4 Reading low byte (relative humidity)
54
`1 on a VM500-5-DCP-E
©2006 Microtechnologies, Inc.
Page 4 of 4
`Set return value
X
End If
A
aatttiiio
On Error GoTo ConvertError
X
Function ConvertBytesToDecimal(ByRef ReceiveString$, ByRef ByteNum%, ByRef ReturnValue!) As Boolean
47
ConvertBytesToDecimal = False
`Exit function
ConvertError:
`If data is negative, multiply by -1
X
Ap
HighByte = Asc(Mid(ReceiveString, ByteNum, 1))
X
Revision 1.1
HighByte = HighByte * &H100
'Pass in: string containing data from DCP-E, the high byte number of the data of interest. For example, pass in 5 for Temperature Sensor
Reading values from a VM500 unit with DCP-E
'Check for negative temperature
Water Input State low byte
59
sData = sData * -1
Humidity Sensor 4 Time out of limits high byte (minutes)
57
X
nn N
49
41
ppp
ConvertBytesToDecimal = True
'
Dim sData!, HighByte&, LowByte&
If (sData >= &H1000) Then
`Extract the data's highbyte
X
50
ReturnValue = sData
X
No
X
<< < [Pag.4]
Esta version es la html del arhivo pdf ANDCP-E, genearada por domotica.name desde www.temperatureguard.com
Archivos relacionados:AN505E DCP_Getting_ DCP_IP_Setup DCP_Manual_v DCP_manual IP_Setup_rev MA41201 MA412_Wiring MOLLY303_Wir MOLLY305_Wir NetworkAddre VM500-5_Inst VM500_INSTAL VM500_Mounti VM5032-2002 VM50522 VM505E_510Em VM52002 VaccineRepor ab305v aci-1k-2w-bp aci-1k-2w-sp computer_roo ma401_wiring ma403 molly303_spe pump_sequenc rl-b_wiring_ vm500-5E-DCP vm500-6wirin vm501_manual vm501_specsh vm502_specsh vm504_manual vm505 vm50518 vm50520 vm5057r14 vm506_manual vm50811 vm508_specsh vm509 vm51001 vm510_specsh vm511_specsh vm54001 vm540lv_wiri actuadores activethermal airwaysystem automatedceilingregisters coolcomponents easywarmfloor heatizon numinus pcslighting relampit taiserver temperatureguard touchplate warmzone