Commit 75f58d22 authored by root's avatar root
Browse files

update script

parent c60128da
......@@ -229,16 +229,18 @@ if __name__ == '__main__':
#print list (rx_change_address)
#FRAME TA-MODULE
tx_slave_ta='\x02\x03\x00\x01\x00\x02'
tx_slave_ta = '\x02\x03\x00\x01\x00\x02'
tx_slave_ta = tx_slave_ta + m.get_crc(tx_slave_ta)
#FRAME TC-MODULE
tx_slave_tc='\x01\x03\x00\x03\x00\x03'
tx_slave_tc = '\x01\x03\x00\x03\x00\x03'
tx_slave_tc = tx_slave_tc + m.get_crc(tx_slave_tc)
while True:
#READ THE PARAMETERS
rx_slave_ta=m.raw(tx_slave_ta + m.get_crc(tx_slave_ta))
rx_slave_tc=m.raw(tx_slave_tc + m.get_crc(tx_slave_tc))
rx_slave_ta=m.raw(tx_slave_ta)
rx_slave_tc=m.raw(tx_slave_tc)
#TA-MODULE
result_slave_ta = get_values_ta(rx_slave_ta)
......
......@@ -181,12 +181,13 @@ Para poder mostrar los datos por pantalla, basta con utilizar la función *print
def print_values(result):
print 'Sensor', result[0]
print '----- MEASUREMENT -----'
print 'Voltage of phase A', result[1]
print 'Current of phase A', result[2]
print 'Voltage of phase B', result[3]
print 'Current of phase B', result[4]
print 'Voltage of phase C', result[5]
print 'Current of phase C', result[6]
if len(result)==6
Please register or sign in to reply
print 'Voltage of phase A', result[1]
print 'Current of phase A', result[2]
print 'Voltage of phase B', result[3]
print 'Current of phase B', result[4]
print 'Voltage of phase C', result[5]
print 'Current of phase C', result[6]
print '--------------------------'
```
......
......@@ -52,12 +52,6 @@ if __name__ == '__main__':
tx='\x01\x03\x00\x03\x00\x03'
rx=m.raw(tx + m.get_crc(tx))
i = None # Current
t1 = None # Temperature 1
t2 = None # Temperature 2
while True:
i = None # Current
......
......@@ -72,14 +72,14 @@ def print_values(result):
: type result: array
"""
print '----- MEASUREMENT -----'
print 'Voltage of phase A', result[0]
print 'Current of phase A', result[1]
print 'Voltage of phase B', result[2]
print 'Current of phase B', result[3]
print 'Voltage of phase C', result[4]
print 'Current of phase C', result[5]
if len (result)==6
print 'Voltage of phase A', result[0]
print 'Current of phase A', result[1]
print 'Voltage of phase B', result[2]
print 'Current of phase B', result[3]
print 'Voltage of phase C', result[4]
print 'Current of phase C', result[5]
print '------------------------'
if __name__ == '__main__':
m=modbus.Modbus()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment