Raspberry Pi 1-wire, i2c SPI IO tags

Hello
Iv very new for Raspberry and D2000 programming
couldn’t find in docs or tutorials an example so i have a few questions:
1 how i can create a tag to read 1-wire data f.e DS18B20 temperature probe
2 how to read data from i2c sensors
3 to use DS3231 RTC any special programming required?
Thanks!

  1. Ad “how i can create a tag to read 1-wire data f.e DS18B20 temperature probe”.
    I have no experience concerning work with 1-wire communication, however, based on several 1-wire manuals and tutorials (e.g. DS18B20 temperature sensor - One wire interface - a start - Raspberry Pi - Xojo Programming Forum or https://www.waveshare.com/wiki/Raspberry_Pi_Tutorial_Series:_1-Wire_DS18B20_Sensor ) you have to first connect to sensor and enable 1-wire interface (and configure it to a specific GPIO pin, unless the default pin 4 is selected).
    Then, you should see a file /sys/bus/w1/devices//w1_slave where is ID of your specific sensor.
    The file can be read and processed either by an ESL script, using e.g. FIO_OpenRead or FIO_ReadWholeFile and then check whether the 1st line contains YES (CRC is ok) and 2nd line contains t=<temperature> - and convert the string to a float using StrToR.
    Or, depending on the D2000 version, you can use the Generic User Protocol on a File I/O line and let the D2000 KOM process read the contents of a file into a text I/O tag. Then this tag can be processed (e.g. in an ESL script or in an Eval Tag - again, check the existence of YES and find “t=” string and convert the following temperature to a float number.

  2. Ad “how to read data from i2c sensors”
    As for IIC bus, I again have no direct experience. Judging from Raspberry Pi SPI and I2C Tutorial - SparkFun Learn and examples available in this tutorial, you can talk to IIC device using the <wiringPiI2C.h> library. So, if you are familiar with C/C++, you could use the D2000 KomAPI interface to create your own communication driver as a dynamic library (.so on Linux/RPI) and let D2000 KOM process load and use your driver (implementing IIC communication).
    The D2000 installation contains a sample Modbus implementation as a C-based driver.

  3. Ad “to use DS3231 RTC any special programming required?”
    This is a Raspberry-related question. From reading Adding a Real Time Clock (RTC) to the Raspberry Pi - Pi My Life Up it seems to me that the hwclock utility is used to read time from this hardware clock (and possibly also set its time for the first time).

Good luck - and let us know whether you were successful and what problems you had to overcome!