Helo!!!My Name is Andrei, and im from Russia. Sorry, for my English!
I have the problem, I wanna to connect 1-wire devices to my Raspberry Pi. Now I connect to my Rpi device DB18S20 (Temperature Sensor). Drivers for this device was in my codesys package. So I wanna connect to my raspberry some devices: DS2406 (Inputs-Outputs), DS2450 (Analog outputs), DS2890 (Analog inputs). There can I find drivers for this devices? Maybe I can do it?How?
Thanks for you answers!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) first check that device is finding in linux 1wire driver from ssh console..
2) change device xml file from archive for device description
3) make new lib from Onewire_DS18B20 and change function AfterReadInput, Evaluate.. to get data from steam linux device and provide to Codesys and vice versa.
ОК, Murdemon, I change device XML for device DS2406 (Device name, ID), but i don't understand how i can make new lib from Onewire_DS18B20?I put XML file into project Onewire_DS18B20, but i don't understand how i can change function AfterReadInput, Evaluate.. in this file?
use DS18B20.devdesc.xml and rename it to your DS2438 and generate a libary called
I have added both files the original and the new one.
Last step is to change the library in the methode 'evaluate'
IF_pMaster<>0THEN
  sPath:=DataPath;
  hFile:=SysFileOpen(sPath,ACCESS_MODE.AM_READ,ADR(result));
  IFhFile<>RTS_INVALID_HANDLETHEN
    fr(hFile:=hFile);
    IFfr.GetLine(ADR(sData),SIZEOF(sData))ANDLEN(sData)>3THEN
      IFRIGHT(sData,3)='YES'THEN
        xSignalOk:=TRUE;
      ELSE
        xSignalOk:=FALSE;
      END_IF
    ELSE
      xSignalOk:=FALSE;
    END_IF
    IFxSignalOkTHEN
      IFfr.GetLine(ADR(sData),SIZEOF(sData))THEN
        i:=FIND(sData,'t=');
        IFi>0THEN
          sData:=RIGHT(sData,LEN(sData)-i-1);
          IFsData='85000'THEN
            xSignalOk:=FALSE;
          ELSE
            rTemp:=STRING_TO_REAL(sData)*1E-3;
            SysTimeRtcConvertUtcToDate(SysTimeRtcGet(result),stdTimeStamp);
          END_IF
        ELSE
          xSignalOk:=FALSE;
        END_IF
      END_IF
    END_IF
  ELSE
    xSignalOk:=FALSE;
  END_IF
  SysFileClose(hFile);END_IF
Attention: without implementing/adapting the 'evaluate' in this new OneWire_DS2438.library to your DS2438 sensor it will not work this is the missing step to do!
If you need the information how to work with libraries, read the following faq section:
l viewtopic.php?f=22&t=5641&p=10677#p10677 l
You and sure you need to install the new device description to the device repository.
After doing this you could add your new Onewire device, see screenshot.
If it works then you please publish the library and devdesc here for other users?
l viewforum.php?f=23 l
bin neu hier im Forum und hänge am gleichen Problem.
Ich bekomme keine gültigen Werte vom DS2438.
Die lib und device-repo's von Edwin habe ich integriert.
Da bekam ich allerdings zuerst einen Ãœbersetzungsfehler. Es wurde in der device-repo noch auf den FB "OneWire_DS18B20" referenziert
Ich habe dann die DS2438.devdesc.xml geändert auf OneWire_DS2438, so wie der FB in der lib auch aufgerufen wird.
Der Treiber läuft aber leider immer noch nicht an.
Im Pfad /sys/bus/w1/drivers/w1_slave_driver/26-0000017c96bd habe ich:
id, name, rw, uevent
Die Datei w1_slave gibt es nicht.
Hat es schon jemand geschafft einen DS2438 zu integrieren?
PS: Ich bin unterwegs mit raspbian jessie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am currently working on a driver for the DS2408 which I will publish once complete.
I have written a new device descriptor and library. Both are installed and when the device is added the function block is created successfully.
I am having an issue with the path to the device. Taking the driver for DS18B20 as a model, I have accessed the path to the device from the property , however when I run has the value
I have set the parameter in my test application for the device to and so expected to be .
So it appears that the OneWire function block is not reading the parameter value and is using a default. Without access to the source of OneWire I'm finding this hard to debug.
The Connector part of my device descriptor is below.
    <ConnectormoduleType="500"interface="Raspberry.Onewire"role="child"explicit="false"connectorId="1"hostpath="-1">
      <InterfaceNamename="local:PCI">1-wirebus</InterfaceName>
      <Slotcount="1"allowEmpty="false">   </Slot>
      <HostParameterSet>
        <ParameterParameterId="1"type="std:STRING">
          <Attributeschannel="none"download="true"functional="false"onlineaccess="read"/>
          <Default>'XX-AABBCCDDEEFF'</Default>
          <Namename="local:Id393218">Uniquedeviceaddress</Name>
          <Descriptionname="local:Id393218.Desc">1-wireaddressofthedevice</Description>
        </Parameter>
      </HostParameterSet>
      <DriverInfoneedsBusCycle="false">
        <RequiredLiblibname="Raspberry 1-wire DS2408"vendor="Cozens Software Solutions Ltd"version="0.0.0.0"identifier="IoDrvDS2408">
          <FBInstancebasename="$(DeviceName)"fbname="OneWire_DS2408">
            <InitializemethodName="Initialize"/>
            <CyclicCallmethodname="AfterReadInputs"task="#buscycletask"whentocall="afterReadInputs"/>
            <CyclicCallmethodname="BeforeWriteOutputs"task="#buscycletask"whentocall="beforeWriteOutputs"/>
          </FBInstance>
        </RequiredLib>
      </DriverInfo>
    </Connector>
The function block calls in the body of the function block, looks like this
EvaluateOutput();SUPER^.BeforeWriteOutputs();
What have I missed that is causing to be incorrect?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A little further information if it helps. In my driver library I have temporarily ignored the value of and hard coded the value I expected. The result is that my driver is now functional, I can set output bits and read back the state. However I notice that the device status of the is "Not Running", I suspect that is related.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
DavidCozens hat geschrieben:
A little further information if it helps. In my driver library I have temporarily ignored the value of and hard coded the value I expected. The result is that my driver is now functional, I can set output bits and read back the state. However I notice that the device status of the is "Not Running", I suspect that is related.
I'm leaving these comments here in case they help others. The issue appears to have been something to do with the history of edits. Deleting and recreating the devices it all sprang into life. I'll post drivers when they are complete.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2017-02-26
Originally created by: PI_Mü
Hi ,is there any progres with the bib for the DS2438?
Thanx in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Helo!!!My Name is Andrei, and im from Russia. Sorry, for my English!
I have the problem, I wanna to connect 1-wire devices to my Raspberry Pi. Now I connect to my Rpi device DB18S20 (Temperature Sensor). Drivers for this device was in my codesys package. So I wanna connect to my raspberry some devices: DS2406 (Inputs-Outputs), DS2450 (Analog outputs), DS2890 (Analog inputs). There can I find drivers for this devices? Maybe I can do it?How?
Thanks for you answers!!!
Hi Andrei...
You need change
1) first check that device is finding in linux 1wire driver from ssh console..
2) change device xml file from archive for device description
3) make new lib from Onewire_DS18B20 and change function AfterReadInput, Evaluate.. to get data from steam linux device and provide to Codesys and vice versa.
DS18B20.zip [256.83 KiB]
ОК, Murdemon, I change device XML for device DS2406 (Device name, ID), but i don't understand how i can make new lib from Onewire_DS18B20?I put XML file into project Onewire_DS18B20, but i don't understand how i can change function AfterReadInput, Evaluate.. in this file?
Murdemon, Thank you so much for you help!!!
DS2406.devdesc.xml [2.42 KiB]
Horocho... add me in skype: ladimko... you allready check 1-wire device in linux console.. it is create device for new IC connected to 1-wile line..?
Hi guys...
I`m also looking for DS2438...can you share your success ?
Thanks a lot
Ok i will contact with you. Send me your email to: e dmitriy.murashov@automation-engineering.ru e
Does anybody know how to create new Device Description, for example from D18B20 to DS2438 ???
Hi acter,
use DS18B20.devdesc.xml and rename it to your DS2438 and generate a libary called
I have added both files the original and the new one.
Last step is to change the library in the methode 'evaluate'
Attention: without implementing/adapting the 'evaluate' in this new OneWire_DS2438.library to your DS2438 sensor it will not work this is the missing step to do!
If you need the information how to work with libraries, read the following faq section:
l viewtopic.php?f=22&t=5641&p=10677#p10677 l
You and sure you need to install the new device description to the device repository.
After doing this you could add your new Onewire device, see screenshot.
If it works then you please publish the library and devdesc here for other users?
l viewforum.php?f=23 l
BR
Edwin
OneWire_DS2438.library [199.32 KiB]
DS2438.devdesc.xml [2.51 KiB]
DS18B20.devdesc.xml [2.51 KiB]
@Erwin: thanks a lot for the "manual", normally I
m Siemens PLC programmer, I
m learning....I try it and if I have a success, of course, I share it...Go for it !!!
at begin I found one problem...if I understand Evaluate fcn, it`s reading file in /sys/bus/w1/28-xxxxxxxxxxxxxx...
but I see a directory of new sensor, but inside there are different files, than in DS18B20 directories...
I Googling...and there is no support for DS2438 in RasPi kernel...
Any idea ?
Hi,
maybe the following links helps:
http://www.raspberrypi.org/forums/viewt ... 44&t=50755
http://rants.dyer.com.hk/rpi/humidity_1w.html
not really sure...
BR
Edwin
Hello Edwin,
If we need write (not read) some date to our onewire device... witch method we have to overwrite?
Thank you.
Hallo zusammen,
bin neu hier im Forum und hänge am gleichen Problem.
Ich bekomme keine gültigen Werte vom DS2438.
Die lib und device-repo's von Edwin habe ich integriert.
Da bekam ich allerdings zuerst einen Ãœbersetzungsfehler. Es wurde in der device-repo noch auf den FB "OneWire_DS18B20" referenziert
Ich habe dann die DS2438.devdesc.xml geändert auf OneWire_DS2438, so wie der FB in der lib auch aufgerufen wird.
Der Treiber läuft aber leider immer noch nicht an.
Im Pfad /sys/bus/w1/drivers/w1_slave_driver/26-0000017c96bd habe ich:
id, name, rw, uevent
Die Datei w1_slave gibt es nicht.
Hat es schon jemand geschafft einen DS2438 zu integrieren?
PS: Ich bin unterwegs mit raspbian jessie
I am currently working on a driver for the DS2408 which I will publish once complete.
I have written a new device descriptor and library. Both are installed and when the device is added the function block is created successfully.
I am having an issue with the path to the device. Taking the driver for DS18B20 as a model, I have accessed the path to the device from the property , however when I run has the value
I have set the parameter in my test application for the device to and so expected to be .
So it appears that the OneWire function block is not reading the parameter value and is using a default. Without access to the source of OneWire I'm finding this hard to debug.
The Connector part of my device descriptor is below.
The function block calls in the body of the function block, looks like this
What have I missed that is causing to be incorrect?
A little further information if it helps. In my driver library I have temporarily ignored the value of and hard coded the value I expected. The result is that my driver is now functional, I can set output bits and read back the state. However I notice that the device status of the is "Not Running", I suspect that is related.
I'm leaving these comments here in case they help others. The issue appears to have been something to do with the history of edits. Deleting and recreating the devices it all sprang into life. I'll post drivers when they are complete.
Originally created by: PI_Mü
Hi ,is there any progres with the bib for the DS2438?
Thanx in advance