Giter Club home page Giter Club logo

contadores-energ-a_python's Introduction

Manual en desenvolupament

TO DO

icra-tarifes-optic

Autors: Lluis Bosch ([email protected]) & Felix Hill ([email protected])

Aquest paquet inclou:

  • Intèrpret de trames del Protocol IEC 60870-5-102 (processa.py)
  • Un creador de trames de bytes (crea.py)
  • Una funció per enviar trames i llegir la resposta (pregunta.py)
  • Una funció per extreure corba horària de potència d'un ASDU 11 (processaA11.py)

Raspberry Pi connectada a un comptador Actaris SL762B, al sensor òptic (port serial, RS232)

https://www1.itron.com/local/Spain%20Product%20Portfolio/ACE%20SL7000%20tipo%20762-EL-ES-04.14.pdf

Idea general:

	+-------------------+      crea.py        : l'usuari crea una trama                                    
	|      USUARI       |      processa.py    : la trama és traduïda a llenguatge humà         
	+-------------------+      pregunta.py    : la trama és enviada al comptador, i aquest respon
	  |               ^        processaA11.py : extreu la potencia d'una trama de resposta ASDU 11
	  |               |        
	  v               |
	 crea.py          |
	  |               |
	  |               |
	  v               |
	 TRAMA----->processa.py
	  |               ^
	  |               |
	  v               |
	 pregunta.py    TRAMA
	  |               ^
	  v               |
	+-------------------+
	|     COMPTADOR     |
	+-------------------+

ASDUS implementats (peticions): 122, 123, 134, 183, 190

#Inici El primer que s'ha de fer és editar l'arxiu config.py, i després testejar si el Raspberry envia trames correctament:

	vim config.py
	python test.py

Després, s'ha de crear un script com ara usuari.py per fer les peticions desitjades. Exemple

	import crea     as C
	import pregunta as P

	#login
	P.pregunta(C.creaTramaVar(0b01110011,C.creaASDU183(1))) #request user data & send password=1
	P.pregunta(C.creaTramaFix(0b01011011)) #request class 2 data

	#prova asdu 190 amb registre 11 (Curva de carga) i direccio 9,10,11
	P.pregunta(C.creaTramaVar(0b01110011,C.creaASDU190(11,10,C.creaTemps(21,7,16,0,0),C.creaTemps(22,7,16,0,0))))
	while 1:
		P.pregunta(C.creaTramaFix(0b01011011)) #request data
		P.pregunta(C.creaTramaFix(0b01111011)) #request data (flip FCB)

Scripts a nivell usuari:

  • usuari.py
  • usuari_extreuPotencia.py

Exemple de resposta script usuari_extreuPotencia.py:

01/07/2016 01:00 114 kW
01/07/2016 02:00 113 kW
01/07/2016 03:00 108 kW
01/07/2016 04:00 110 kW
01/07/2016 05:00 107 kW
[...]

Dades Rasbperry ICRA:

  • ip local: 192.168.103.63
  • ip externa: 84.89.61.64

Dades de la connexió serial --> config.py:

	port = "/dev/ttyUSB0"
	baudrate=9600
	bytesize=8
	parity=serial.PARITY_EVEN
	stopbits=1
	xonxoff=False
	rtscts=False
	dsrdtr=False
	timeout=1 

Com fer un grafic amb la comanda gnuplot

	plot [FILE] using [X]:[Y] with line
	plot "icra-20160701.txt" using 2:3 with line

Referències:

contadores-energ-a_python's People

Stargazers

Mario Izquierdo avatar

Watchers

James Cloos avatar Miguel Alonso Abella avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.