WAGO Controller

Disclaimer

This information is provided “as-is” without any explicit or implied warranties as to its accuracy, safety, and applicability to any specific purpose. The author should not bear any responsibility for any use given by third parties to this information, and to the devices herein described. The user of this information and the devices herein described shall assume all risks and full responsibility for all aspects of their assembly and use.

Anybody building this controller must observe all standard laboratory/workshop safety practices, such as wearing adequate personal protective equipment, and must be conscious of all electrical hazards present. The equipment described here can pose risks of electric shocks, arcs, and fires if it is not properly assembled and operated. Electrical connections (especially those involving voltages higher than 50V) should always be done by persons qualified to do so, and knowledgeable about safe practices, such as proper grounding, proper isolation of potential shock sources, the use of fuses or circuit breakers to protect against short circuits and over-currents, etc.

Parts

The following components are needed to setup a WAGO-based solenoid valve controller. Some vendors shown on the table are specific to Northern California, and the prices are from those vendors. You will have to find vendors and specific prices for your area.

The best solenoid valves to use with this controller are the Festo ones, listed in the Solenoid Valves page. The valve wires are connected directly to the digital output modules, without the need for connectors.

WARNING: Do not connect 12V solenoids to this controller!

Documentation

A WAGO web page containing all the datasheets and manuals of the System 750 devices is here, and the following are links to the manuals of the specific devices used here:

Setup

To assemble all the modules together, follow this sequence (see this animation and section 5 of the Controller manual):

    1. Attach the Fieldbus Controller to the DIN rail
    2. Slide each digital output module onto the rail on the side of the Controller until is latches onto the DIN rail
    3. Slide the end module after the last digital output module

Instructions on the electrical connections for the different WAGO components can be found on their respective manuals. Power must be supplied to both the Fieldbus Controller and to the first digital output module.

IMPORTANT: The digital output modules deliver 24V DC, so make sure to connect only 24V solenoids to these modules. Additionally, the digital output modules already have freewheeling diodes, so the solenoid valves do not have to include diodes. See the Solenoid Valves page for a list of solenoid vendors and models.

Before a computer can communicate with the Fieldbus Controller, a valid IP address must be assigned to it. The easiest way to do this is using the BootP Server available for download from WAGO here. Follow this sequence, or watch this tutorial video:

    1. Download and install the BootP Server
    2. Disconnect the computer from the internet and assign to it a fixed IP address (such as 192.168.1.1)
    3. Connect the Fieldbus Controller to the computer either directly, using a cross-over ethernet cable, or through an ethernet switch
    4. Follow the BootP Server instructions on section 8.2.2 of the Controller manual to set the desired IP address.
    5. The best practice is to assign a static IP address to the Controller, but most labs and offices use DHCP to assign dynamic IP addresses to all devices, and requesting a static IP address from you IT administrators can be a headache. Additionally, many institutions make all static IP address part of their untrusted network, causing routing, accessibility, and security problems.
    6. To avoid all these complications, I recommend connecting the Controller to a second ethernet port on the computer, separate from the one used to connect to the internet, using a cross-over cable. Most workstations today come with dual ethernet ports, but an additional port can be easily added by an internal card or a USB-to-ethernet adapter. The second ethernet port can be configured to have IP address 192.168.1.1, gateway 192.168.1.1, and mask 255.255.255.0. The Controller can then be setup with IP address 192.168.1.x (x = 2 to 254), gateway 192.168.1.1, and mask 255.255.255.0. Note: These 192.168.1.x addresses can only be used if your computer is connected directly to the internet through your institution's wireless or wired network. If you use a WiFi or wired router of your own, it might already be using 192.168.1.x addresses, in which case you will have to assign totally different addresses to the second ethernet port on the computer and to the Controller.
    7. After setting up an IP address, the Controller can be configured via a built-in web interface.

Unless you want to use BootP to set the IP address every time you turn the Controller on, the BootP port should be disabled after setting the IP address for the first time:

    1. After using BootP to set the IP address for the first time, close the BootP server and use your web browser to go to that IP address
    2. Click on the Port link on the left side of the page
    3. Disable the BootP port
    4. Press the Submit button
    5. Restart the Controller

It is important that the Connection Watchdog be disabled on the Controller. If the watchdog is active, it will disconnect from the computer after a short period of inactivity. Follow these steps to disable it:

    1. Connect to the Controller using a web browser
    2. Click on the Watchdog link on the left of the screen
    3. Set the Connection Watchdog to 0ms
    4. Restart the Controller

IMPORTANT: To have the Controller recognize the digital output modules, and click on the "I/O Config" link on the left side of the main Web-based configuration page. Then click the button that says "create ea-config.xml". After than, the table on the I/O Config page should display the right number of digital output modules.

Valve Control Software

This is a simple Matlab function that performs basic valve control using the WAGO device: wagoNModbus.m

This code takes advantage of nested functions and the persistence of function workspaces when using handles to nested functions, as described by this example. This way of programming approximates the object oriented paradigm without using classes.

NOTE 1: This function uses the free NModbus Library. Download the latest version of the compiled NModbus package (not the source), and extract all the files to a folder called NModbus inside the same folder where you put the wagoNModbus.m file.

NOTE 2: The NModbus library is built using the .NET framework, which is only supported by Matlab R2009a and later releases. The wagoNModbus function will NOT work if you have a Matlab release earlier than R2009a.

This is a simple script for testing the wago function: wago_object_test.m

Please check this page every once in a while to see if there are updates to this code. Sometimes we find and fix bugs, or add extra functionality.

License and Attribution

Creative Commons License

The software/code you can download on this web site is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

By using this information and/or downloading the software/code, you agree to cite/acknowledge Rafael Gómez-Sjöberg, Microfluidics Lab, Lawrence Berkeley National Laboratory, Berkeley, CA 94720, in all publications that describe any work that used or was made possible by the information on this web-site.