from sensors_actuators_k004b.sensors_http import SensorsHttp 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()
# 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()
from sensors_actuators_k004b.actuators_modbus import ActuatorsModbus from time import sleep import os client_address_actuators = os.environ["EX9132_ADDRESS"] client_port_actuators = os.environ["EX9132_PORT_2"] am = ActuatorsModbus(client_address_actuators, client_port_actuators) # sleep(3.0) am.set_ex9024(opening_level = 0.0) # sleep(3.0) print am.get_ex9024() am.disconnect_from_client()