Logic Machine Forum
1-wire DS2423 - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: 1-wire DS2423 (/showthread.php?tid=3126)



1-wire DS2423 - johanax - 25.01.2021

Hi,
is the 'DS2423 4kbit 1-Wire RAM with Counter, device supported.

Regards Johan


RE: 1-wire DS2423 - admin - 25.01.2021

It is supported, but you will have to use scripts to read/write data from/to it.


RE: 1-wire DS2423 - johanax - 25.01.2021

Thanks,
do you have an example to get me started.

Regards Johan


RE: 1-wire DS2423 - admin - 25.01.2021

First you need to find the unique ID of the 1-Wire device. It is shown in the UI or you can use a script to log all connected devices:
Code:
require('ow')
list = ow.list()
log(list)

Read counter values (change id value to your device ID):
Code:
require('ow')
id = 'ABCDEF123456'
c1, err1 = ow.readfile(id, 'counters.A', true)
c2, err2 = ow.readfile(id, 'counters.B', true)
log(c1, c2, err1, err2)