gisce / iec870ree

IEC-870-5-102 for REE Spanish Electric meters
GNU Affero General Public License v3.0
13 stars 10 forks source link

¿"Canales registros"? #37

Closed danielcuellarp closed 1 year ago

danielcuellarp commented 2 years ago

Hello, does anyone know if this Circutor meter "Record Channels" configuration is implemented in the library and/or to which ASDU does it belong?

image

tinogis commented 2 years ago

You must use the extended protocol ASDU 162 (Instant values request) and the data you need by code/name and the returned ASDU parsed an stored in the related object:

# 163 response
INSTANT_VALUES_OBJECTS = {
    192: {
        'name': 'totalizadores',
        'object': 'TotalizadoresInstantaneos'
    },
    193: {
        'name': 'potencias',
        'object': 'PotenciaInstantanea'
    },
    194: {
        'name': 'I_V',
        'object': 'IVInstantaneos'
    }
}

There's an AppLayer function to make the request as seen in the example below:

        #### INSTANT_VALUES_OBJECTS name or code (Extended)
        logging.info("LEER VALORES INSTANTANEOS {}")
        instant_objects = ['totalizadores', 'potencias', 'I_V']
        logging.info("Get instant values")
        resp = app_layer.ext_read_instant_values(objects=instant_objects)
        print(resp.content)

A complet example is shown in https://github.com/gisce/iec870ree/blob/master/examples/ip_cliente.py

danielcuellarp commented 2 years ago

Hello, the request that you mention brings me the information of "instantaneous values" correctly, but what I need is the one of "record channels"

image

image

tinogis commented 2 years ago

We haven't found the ASDU neither REE neither IEC documentation that we have available. If anyone knows the ASDU and its structure, we can implement it.