180 lines
5.2 KiB
OpenEdge ABL
180 lines
5.2 KiB
OpenEdge ABL
VERSION 1.0 CLASS
|
|
BEGIN
|
|
MultiUse = -1 'True
|
|
Persistable = 0 'NotPersistable
|
|
DataBindingBehavior = 0 'vbNone
|
|
DataSourceBehavior = 0 'vbNone
|
|
MTSTransactionMode = 0 'NotAnMTSObject
|
|
END
|
|
Attribute VB_Name = "clsSEMI"
|
|
Attribute VB_GlobalNameSpace = False
|
|
Attribute VB_Creatable = True
|
|
Attribute VB_PredeclaredId = False
|
|
Attribute VB_Exposed = False
|
|
Option Explicit
|
|
|
|
Public Length As Byte
|
|
Public AppCODE As Byte
|
|
Public Counter As Byte
|
|
Public RadioAdr As Currency
|
|
Public Billing_Volume As Currency
|
|
Public Alarm As Byte
|
|
Public PAM_status As Byte
|
|
Public PAM_RSSI As Byte
|
|
Public Meter_Type As Byte
|
|
Public Transmission_interval As Long
|
|
Public LAT_interval As Byte
|
|
Public Current_Flow As Long
|
|
Public Backward_Volume As Currency
|
|
Public Number_of_Dials As Byte
|
|
Public Volume_Unit As Byte
|
|
Public Meter_ID As Currency
|
|
Public OM_Status As Byte
|
|
Public OM_Transmission_Interval As Long
|
|
Public Alarm_Mask_Active_Information As Byte
|
|
Public Leakage_Detection_Parameters As Byte
|
|
Public Broken_Pipe_Detection_Parameters As Byte
|
|
Public Battery_Remaining As Long
|
|
Public Battery_End_Detected As Long
|
|
Public Maximum_Flow As Long
|
|
Public Time_of_maximum_Flow As Long
|
|
Public Low_Battery_detected As Long
|
|
Public Leak_Start As Long
|
|
Public Leak_End As Long
|
|
Public Magnetic_Tamper_Start As Long
|
|
Public Magnetic_Tamper_End As Long
|
|
Public Module_Remove_Start As Long
|
|
Public Module_Remove_End As Long
|
|
Public Backflow_Start As Long
|
|
Public Backflow_End As Long
|
|
Public Broken_Pipe_Start As Long
|
|
Public Broken_Pipe_End As Long
|
|
Public Log_Content As Long
|
|
Public Logging_interval As Long
|
|
Public Fixed_Date_Reading_Content As Long
|
|
Public Billing_day As Byte
|
|
Public Actual_date_and_time As Currency
|
|
Public History_Error_Limit_days As Byte
|
|
|
|
Public Customer_specific_text As String
|
|
|
|
'Public Customer_specific_text_1 As Byte
|
|
'Public Customer_specific_text_2 As Byte
|
|
'Public Customer_specific_text_3 As Byte
|
|
'Public Customer_specific_text_4 As Byte
|
|
'Public Customer_specific_text_5 As Byte
|
|
'Public Customer_specific_text_6 As Byte
|
|
'Public Customer_specific_text_7 As Byte
|
|
'Public Customer_specific_text_8 As Byte
|
|
'Public Customer_specific_text_9 As Byte
|
|
'
|
|
'Public Time_of_FDR_Reset As Long
|
|
'Public Time_of_LOG_Reset As Long
|
|
|
|
Public MeterSize As Byte
|
|
Public A_CRC_MSB As Byte
|
|
Public A_CRC_LSB As Byte
|
|
|
|
|
|
|
|
Public Sub Decode(ByRef arbytes() As Byte)
|
|
' Dim i As Integer
|
|
' For i = 0 To 6
|
|
' Debug.Print "SEMI " & i & ": " & arbytes(i) & " = " & Hex(arbytes(i))
|
|
' Next
|
|
|
|
Length = arbytes(7)
|
|
AppCODE = arbytes(8)
|
|
Counter = arbytes(9)
|
|
RadioAdr = NumberFromByteArray(arbytes, 10, 13)
|
|
Billing_Volume = NumberFromByteArray(arbytes, 14, 17)
|
|
Alarm = arbytes(18)
|
|
PAM_status = arbytes(19)
|
|
PAM_RSSI = arbytes(20)
|
|
Meter_Type = arbytes(21)
|
|
Transmission_interval = NumberFromByteArray(arbytes, 22, 23)
|
|
LAT_interval = arbytes(24)
|
|
Current_Flow = NumberFromByteArray(arbytes, 25, 26)
|
|
Backward_Volume = NumberFromByteArray(arbytes, 27, 30)
|
|
Number_of_Dials = arbytes(31)
|
|
Volume_Unit = arbytes(32)
|
|
Meter_ID = NumberFromByteArray(arbytes, 33, 36)
|
|
OM_Status = arbytes(37)
|
|
OM_Transmission_Interval = NumberFromByteArray(arbytes, 38, 39)
|
|
Alarm_Mask_Active_Information = arbytes(40)
|
|
Leakage_Detection_Parameters = arbytes(41)
|
|
Broken_Pipe_Detection_Parameters = arbytes(42)
|
|
Battery_Remaining = NumberFromByteArray(arbytes, 43, 44)
|
|
Battery_End_Detected = NumberFromByteArray(arbytes, 45, 46)
|
|
Maximum_Flow = NumberFromByteArray(arbytes, 47, 48)
|
|
Time_of_maximum_Flow = NumberFromByteArray(arbytes, 49, 50)
|
|
Low_Battery_detected = NumberFromByteArray(arbytes, 51, 52)
|
|
Leak_Start = NumberFromByteArray(arbytes, 53, 54)
|
|
Leak_End = NumberFromByteArray(arbytes, 55, 56)
|
|
Magnetic_Tamper_Start = NumberFromByteArray(arbytes, 57, 58)
|
|
Magnetic_Tamper_End = NumberFromByteArray(arbytes, 59, 60)
|
|
Module_Remove_Start = NumberFromByteArray(arbytes, 61, 62)
|
|
Module_Remove_End = NumberFromByteArray(arbytes, 63, 64)
|
|
Backflow_Start = NumberFromByteArray(arbytes, 65, 66)
|
|
Backflow_End = NumberFromByteArray(arbytes, 67, 68)
|
|
Broken_Pipe_Start = NumberFromByteArray(arbytes, 69, 70)
|
|
Broken_Pipe_End = NumberFromByteArray(arbytes, 71, 72)
|
|
Log_Content = NumberFromByteArray(arbytes, 73, 74)
|
|
|
|
'Logging -Interval
|
|
'Logging -Interval
|
|
|
|
'Fixed -Date - Reading - Content
|
|
'Fixed -Date - Reading - Content
|
|
|
|
'Billing_day
|
|
|
|
'Actual_date_and_time
|
|
'Actual_date_and_time
|
|
'Actual_date_and_time
|
|
'Actual_date_and_time
|
|
|
|
'History_Error_Limit_ (days)
|
|
|
|
Customer_specific_text = StringHexDecodedFromByteArray(arbytes, 85, 93)
|
|
|
|
'Customer_specific_text_1
|
|
'Customer_specific_text_2
|
|
'Customer_specific_text_3
|
|
'Customer_specific_text_4
|
|
'Customer_specific_text_5
|
|
'Customer_specific_text_6
|
|
'Customer_specific_text_7
|
|
'Customer_specific_text_8
|
|
'Customer_specific_text_9
|
|
|
|
'Time_of_FDR_Reset
|
|
'Time_of_FDR_Reset
|
|
|
|
'Time_of_LOG_Reset
|
|
'Time_of_LOG_Reset
|
|
|
|
MeterSize = arbytes(98)
|
|
|
|
'A_CRC_MSB
|
|
'A_CRC_LSB
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Public Function getPamStatusText() As String
|
|
getPamStatusText = ""
|
|
Dim bitNr As Integer
|
|
|
|
Const MELDUNGEN = "PAM_CMD_UNKNOWN PAM_WRONG_AUTH PAM_EXPIRED_AUTH PAM_MIXED_TYPES PAM_OUT_OF_RANGE"
|
|
For bitNr = 0 To 7
|
|
If (PAM_status And 2 ^ bitNr) = 2 ^ bitNr Then
|
|
getPamStatusText = getPamStatusText & Split(MELDUNGEN, " ")(bitNr) & " "
|
|
End If
|
|
Next
|
|
getPamStatusText = Trim(getPamStatusText)
|
|
End Function
|
|
|
|
|