This is an old revision of the document!


Automatic restart of the 1-Wire bus

The 1-Wire bus is prone to EMI which can result in sensors being “stuck” and disabling the whole bus communication. With our PLCs you are able to turn the power off for the whole 1-Wire bus and forcing the sensors to reset.

In Mervis, the property controlling the power supply for the 1-Wire bus is called OW_off_1. By setting the value to true, the bus will be disconnected from the power supply and by resetting back to false the power supply will be connected back.

You can reset the power supply manually, but with the help of commerror attributes, you can let Mervis do it automatically. The attributes are available on the particular device or the whole channel and they indicate when the Mervis wasn't able to read the datapoints.

We will start the project in the Full mode, attaching to the controller, creating a FBD program and setting a task executing this program. Next we create ModbusTCP channel for the IOs of the PLC and 1-Wire channel for the 1-Wire bus. Then deploy the solution and detect the 1-Wire sensors. Your workspace should look like this:

As you can see, we have one 1-Wire thermometer, which we renamed to “office”. Now double click on the 1-Wire channel in the Left panel. You will be presented by all the available datapoints:

The most important is the attribute commerror which indicates if there is a communication error with any of the connected sensors. The attribute's type is bool and when the value is TRUE, it means there is a communication error and once the error disappears, the attribute is FALSE. As you can see, attribute of the same name is in the section office. This attribute indicates communication error only for the sensor called office.