Some users do not want to deal with Rasbperry Pi and home-made sub-modules. Despite my intensive arguing, my brother refused to work with RPi and Linux. He just wanted to use something that works out-of-the-box.
In order to connect his already existing 1-wire net with the WAGO 750, we have ordered a "1-Wire Buskoppler SPS" module from esera automation. It converts RW232 to 1-Wire and can be plugged in directly to the service port of the WAGO PLC with the use of a connector offered by esera. In such a way the user can avoid buying a separate RS232 module (or RS484 if such a solution is chosen). With a price tag of 70 EUR the esera's 1-wire Buskoppler is a cheap solution. Here is, how it looks in with the controller itself:
The installation and launching of the module went surprisingly smooth. The module is powered by 24 VDC and offers 2 1-wire channels. The connection should be plugged in to the service port and.. voila! Everything starts to work.
On the website of esera automation one can find a complete example of a PLC program, which can be used to use the 1-wire module. Additionally the copy of the OWOS library is also there. Here are the needed steps:
1. Add the owos_9_1.lib library and other supportive libraries. One of them is oscat_basic_333.lib, which can be troublesome to use. The steps needed to include it in the program are described in a separate article.
2. Configure global variables to facilitate the communication.
The example delivered by the module's producer is extensive and foresees the use of various 1-wire devices. In my case we were only interested in reading DS1820 sensors. The definitions are as follows:
The DS1820_Anzahl variable should be equal to the expected number of used sensors. The predefined number can be greater without negative consequences. If, however, it is too small, the excessive sensors will not be visible.
The definition of the DS1820 array is set with 2 empty fields. Let's leave it like that and fill it in the later steps.
3. Add a program (named for example oneWire) and fill it as below:
4. Add a task in the Task Manager and run it every 80ms.
That should be enough to run the module. It does not suffice to use it. The sensors and their readings will not magically pup up in an array. Some configuration steps are needed. Compile, run the program and do the following:
1. Change the value of the global variable owp.ID_suchen.was_suchen.DS1820 to TRUE and press CTRL+F7 to write the new value to the executed code:
2. Change the value of the global variable owp.ID_suchen.neue_ID_suchen toTRUE. Once CTRL+F7 is pressed a network-search cycle will be run to find all new DS1820 sensors.
3. If new devices are found, the information about it will be visible at:
- the global variable owp.ID_suchen.anzahl_gefunden.DS1820, showing the number of discovered sensors
- the global array DS1820, where each field will be filled with the sensors' data.
4. Once a new sensor is found we need to modify the program in the Global Variables section. We need to extend the DS1820 array. Here is an example with information of a one discovered sensor:
By including the sensor IDs in the code we avoid searching for sensors once the PLC is restarted.
In order to simplify the whole process one can build a simple visualization, which would "tap" values of owp.ID_suchen.was_suchen.DS1820 and owp.ID_suchen.neue_ID_suchen variables and which would show the results of the searches.
Finally - the temperatures indicated by each sensor can be found within the global array DS1820 in fields called "Temperatur".
That's all there is to it :) If not for the German names of variables and function blocks and missing documentation in English, the launching of the 1-wire Busskopler would fit into the category of the easiest and most user-friendly PLC-related experiences. In the current installation the module reads 10 sensors connected to 1 channel. Consequently, it has still a lot of potential for further use without the need of installing a 1-wire hub.