Hi all,
The latest release of PyHamilton has nearly all of the pH Module functions integrated. Here is an example script that shows how to call each function:
import os
from pyhamilton import (HamiltonInterface, LayoutManager, normal_logging, ph_initialize,
initialize, ph_req_battery_data, ph_measure, ph_measure_dynamic,
ph_request_calibration, ph_request_probe_data, ph_request_technical_data,
ph_calibrate, ph_washer_initialize, ph_washer_wash, ph_washer_terminate,
ph_dryer_initialize, ph_dryer_start, ph_dryer_stop, ph_dryer_terminate)
import logging
lmgr = LayoutManager('deck.lay')
if __name__ == '__main__':
with HamiltonInterface(simulate=True) as ham_int:
normal_logging(ham_int, os.getcwd())
initialize(ham_int)
#pH Module Commands
ph_initialize(ham_int, comport = 1, simulate = True)
ph_req_battery_data(ham_int, module_id = 0)
ph_measure(ham_int, module_id = 0, temperature = 30.0, probePattern = '1111')
ph_measure_dynamic(ham_int, module_id = 0, temperature = 30.0,
precision = 50.0, timeout = 5, probePattern = '1111')
ph_request_probe_data(ham_int, module_id = 0)
ph_calibrate(ham_int, module_id = 0, cal_level = 1, cal_value = 5.0,
cal_temperature = 25.0, probe_pattern = '1111')
# Washer Commands
module_id = ph_washer_initialize(ham_int, 1, True)
ph_washer_wash(ham_int, module_id = 0, cycle_num = 3)
ph_washer_terminate(ham_int, module_id = 0)
# Dryer Commands
ph_dryer_initialize(ham_int, 1, True)
ph_dryer_start(ham_int, module_id = 100)
ph_dryer_stop(ham_int, module_id = 100)
ph_dryer_terminate(ham_int, module_id = 100)