Go Down

Topic: ModbusIP_ENC27J60 crashing OneWire (Read 405 times) previous topic - next topic

Mumba

Jul 17, 2019, 03:21 pm Last Edit: Jul 18, 2019, 02:02 pm by Mumba
Hello, (first time poster here, so if I do something wrong im sorry)


following problem:
I want to read multiple(10) DS18B20 temperature Sensors using OneWire and then send them over to a B&R PLC using ModBus. I worked out two programms, one for each part. Both are working fine when they are uploaded to the arduino on their own. But as soon as i combine both programms, they both stop working. More specificyly it stops working as soon as I configure the Modbus with mb.config(). The OneWire-programm still detects that there are 10 sensors connected but i cant read any temperatures or addresses. I get -127 as  temperatures and zeros as addresses. I also cant ping  the shield anymore.
I use a Arduino nano with a ENC27J60 Ethernet Shield.


Code: [Select]
#include <OneWire.h>
#include <DallasTemperature.h>
//====================
#include <EtherCard.h>
#include <Modbus.h>
#include <ModbusIP_ENC28J60.h>

Those are the libs I am using. The libs Modbus and ModbusIP did i get from Github.


I hope someone is able to help me!
BR

Edit1: The arduino is here used as Server and the PLC as Client!

Edit2: When i dont Plug in the ethernet cable the code is working and i can read the temperatur sensors(Modbus part is not working because there is no Ethernet Cable to the switch/PLC)

Edit3: I rebuild my entire project on a Mega borad. Now, I can read the Senor, eventhough im uploading the whole project with the mb.config(). But I cant ping the Arduino. Using the Modbus programm only I can ping it and I can send data to the PLC

Go Up