importjsonfromchamberconnectlibrary.watlowf4importWatlowF4fromchamberconnectlibrary.watlowf4timportWatlowF4Tinterface_params={'interface':"RTU",'baudrate':19200,'serialport':'//./COM6'}try:controller=WatlowF4T(alarms=8,# the number of available alarmsprofiles=True,# the controller has programmingloops=1,# the number of control loops (ie temperature)cond_event=9,# the event that enables/disables conditioning (9 is key 1)cond_event_toggle=False,# is the condition momentary(False), or maintained(True)run_module=1,# The io module that has the chamber run outputrun_io=1,# The run output on the mdoule that has the chamber run out putlimits=[5],# A list of modules that contain limit type cards.loop_event=[0,2,0,0],# A list of event #'s that enable/disable a control loopcascade_ctl_event=[7,0,0,0],# the event that enables PTCON**interface_params)print'Found a "%s" controller\n'%controller.process_controller(False)exceptExceptionasexc:controller=WatlowF4(profiles=True,loops=1,loop_event=[0,8],cond_event=7,limits=[1],**interface_params)try:ifcontroller.loops:controller.get_loop_units(1)else:controller.get_cascade_units(1)print'Found a "%s" controller\n'%controller.process_controller(False)exceptException:print'The connected controller is Likely a WatlowF4T in compatibility mode.'print'You must disable compatibility mode of the WatlowF4T to use it.'exit(1)#Determine the correct number of "standard" loopsloops=[(i+1,'loop')foriinrange(controller.loops)]#Determine the correct number of cascade loopsloops+=[(i+1,'cascade')foriinrange(controller.cascades)]# Print the currect status of all of the loops, both cascade and "standard"forloopinloops:print'\n'printloopprintjson.dumps(controller.get_loop(*loop),sort_keys=True,indent=4)
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.