Hello! Readings from my sensors are very slow. 12-16s per reading.
I have three DS18B20-sensors wired to GPIO 4.
I used the example program which came with Codesys - then built my program in there.
I've read something about putting the onewire-stuff in another POU/task but I don't get it.
What goes inside the onewire-task? This code?
PROGRAMPLC_PRGVARÂ Â astrID:ARRAY[1..20]OFSTRING;Â Â ui:uINT;Â Â x:BOOL;Â Â rTemp:REAL;END_VAR
IFNOTxTHEN  x:=TRUE;  //scanfunction  FORui:=1TOMIN(Onewire_master.uiScannedDevices,20)DO    astrID[ui]:=Onewire_master.pasScannedDevices^[ui-1].StringRepresentation;  END_FOREND_IF
I'm ok with 750ms delay per sensor but 12-16s is too much. I am using the temperaturs to control some relays. With only one sensor configured it works fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
for temprature reading this should never be a problem... what application do you have which need faster temp?
We just read then onewire via kernel modul which is providey by RaspberryPI.org
so each reading is like for example:
cat /sys/bus/w1/devices/10-000802cfb15d/w1_slave
If you so this manually via console with your sensors guess you will see these delays too.
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello! Readings from my sensors are very slow. 12-16s per reading.
I have three DS18B20-sensors wired to GPIO 4.
I used the example program which came with Codesys - then built my program in there.
I've read something about putting the onewire-stuff in another POU/task but I don't get it.
What goes inside the onewire-task? This code?
I'm ok with 750ms delay per sensor but 12-16s is too much. I am using the temperaturs to control some relays. With only one sensor configured it works fine.
BUMP
Anyone, please?
Hi,
for temprature reading this should never be a problem... what application do you have which need faster temp?
We just read then onewire via kernel modul which is providey by RaspberryPI.org
so each reading is like for example:
cat /sys/bus/w1/devices/10-000802cfb15d/w1_slave
If you so this manually via console with your sensors guess you will see these delays too.
BR
Edwin