Snippets

Espec North America BrXgEx: Untitled snippet

Created by Myles Metzler last modified
import json
from chamberconnectlibrary.watlowf4 import WatlowF4

#example interface_params for RS232/RS485 on port 7 (windows) Modbus address=1
interface_params = {'interface':'RTU', 'baudrate':19200, 'serialport':'//./COM3', 'adr':1}

controller = WatlowF4(profiles=True, limits=[1], **interface_params) #bare minumum to setup the controller.
print controller.process_controller() #This call will automatically detect the correct loop configuration.

#Determine the correct number of "standard" loops
loops = [
    (i+1, 'loop')
    for i in range(controller.loops)
]

#Determine the correct number of cascade loops
loops += [
    (i+1, 'cascade')
    for i in range(controller.cascades)
]

# Print the currect status of all of the loops, both cascade and "standard"
for loop in loops:
    print '\n'
    print loop
    print json.dumps(controller.get_loop(*loop), sort_keys=True, indent=4)

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.