from sensors_actuators_k004b.sensors_modbus import SensorsModbus
import time
import os

client_address_sensors = os.environ["EX9132_ADDRESS"]
client_port_sensors = os.environ["EX9132_PORT_1"]

sm = SensorsModbus(client_address_sensors, client_port_sensors)

k = 0

while k < 5:

    print sm.get_mc602_flowrate()
 
    print sm.get_mc602_temperature_inlet()
    
    print sm.get_mc602_temperature_outlet()
    
    print sm.get_rtm1_0()

    print sm.get_rtm1_1()

    k += 1

'''
k = 0

time.sleep(2.0)

while k < 200:
Beispiel #2
0
# Modbus Connection Parameter - Port 1 Sensor, Port 2 Actuator
sensor_client_address = os.environ["EX9132_ADDRESS"]
sensor_client_port = os.environ["EX9132_PORT_1"]
actuator_client_address = os.environ["EX9132_ADDRESS"]
actuator_client_port = os.environ["EX9132_PORT_2"]

# http Connection Parameter
server_address = os.environ["WT_ADDRESS"]
server_port = os.environ["WT_PORT"]

#Infozwecke
#print server_address
#print server_port 

sm = SensorsModbus(sensor_client_address, sensor_client_port)
am = ActuatorsModbus(actuator_client_address, actuator_client_port)
sh = SensorsHttp(server_address, server_port)
valve_open = 1.0
valve_closed = 0.0



# Rudimentaere Steuerung

try:

    while True:

        rtm1_0 = sm.get_rtm1_0()
        rtm1_1 = sm.get_rtm1_1()
import numpy as np
import time
import os

sensor_client_address = os.environ["EX9132_ADDRESS"]
sensor_client_port = os.environ["EX9132_PORT_1"]

actuator_client_address = os.environ["EX9132_ADDRESS"]
actuator_client_port = os.environ["EX9132_PORT_2"]

sensor_server_address = os.environ["WT_ADDRESS"]
sensor_server_port = os.environ["WT_PORT"]

am = ActuatorsModbus(actuator_client_address, actuator_client_port)
sm = SensorsModbus(sensor_client_address, sensor_client_port)
sh = SensorsHttp(sensor_server_address, sensor_server_port)

for k in np.linspace(0.15,0.6,46):
    
    opening_level = k

    am.set_ex9024(opening_level = opening_level)
    
    t_start= time.time()

    while time.time()- t_start < 60:
      
        flowrate = sm.get_mc602_flowrate()
        temperature_inlet = sm.get_mc602_temperature_inlet()
        temperature_outlet = sm.get_mc602_temperature_outlet()