Activity for I/O Drivers

  • bnewman bnewman created ticket #4

    Struct datatype Documentation is confusing

  • wbj0t wbj0t posted a comment on a wiki page

    Hi, Ingo! Im very glad to see this page and your work. But I cant understand many of things. For example: in the IoDrvFb: cDriverName In the device description I see only libname, and Device name, what the drivername ?:) and many other fields I dont know what to set and how to start tesing them and what for my attention the first time. And other fields in the iodrv system libs. Where I can learn this? I need to understand every step, every field in the xml and in the Fbs. Thanks you! And what are...

  • alimans alimans posted a comment on a wiki page

    Hi everybody, As I did not still findout a proper answer for my question no.3 above, it would be highly appreciated if anybody can answer my question. For reference I repeated my question as bellow: In case of any problem in device or driver (for example disconnecting or cable unplug) How could I send errors to the codesys? What is the best practice to handle such a situation?

  • alimans alimans modified a comment on a wiki page

    Thank you for your kind respond, Ingo! 1- The "IoConfigLateInit" trick got the job done! But, still for some functions like "IoDrvWriteParameter" I could not place break point. 2- Regarding the page, as you set it correctly, I mean pages like EtherCAT and so on. A sample page for this you can find as attachment. So how could I write a plugin and use it in my IO Driver? Because my device uses several configuration and also has some diagnostic registers that would be perfect if I could show them to...

  • alimans alimans modified a comment on a wiki page

    Thank you for your kind respond, Ingo! 1- The "IoConfigLateInit" trick got the job done! But, still for some functions like "IoDrvWriteParameter" I could not place break point. 2- Regarding the page, as you set it correctly, I mean pages like EtherCAT and so on. A sample page for this you can find as attachment. So how could I write a plugin and use it in my IO Driver? Because my device uses several configuration and also has some diagnostic registers that would be perfect if I could show them to...

  • alimans alimans modified a comment on a wiki page

    Thank you for your kind respond, Ingo! 1- The "IoConfigLateInit" trick got the job done! But, still for some functions like "IoDrvWriteParameter" I could not place break point. 2- Regarding the page, as you set it correctly, I mean pages like EtherCAT and so on. A sample page for this you can find as attachment. So how could I write a plugin and use it in my IO Driver? Because my device uses several configuration and also has some diagnostic registers that would be perfect if I could show them to...

  • alimans alimans posted a comment on a wiki page

    Thank you for your kind respond, Ingo! 1- The "IoConfigLateInit" trick got the job done! But, still for some functions like "IoDrvWriteParameter" I could not place break point. 2- Regarding the page, as you set it correctly, I mean pages like EtherCAT and so on. A sample page for this you can find as attachment. So how could I write a plugin and use it in my IO Driver? Because my device uses several configuration and also has some diagnostic register that would be perfect if I could show them to...

  • Ingo Ingo posted a comment on a wiki page

    Hi Alimans, thanks for the feedback! 1) To debug, you can easily set the compiler define "IoConfigLateInit". That will instruct our device object to execute the Init code of your driver in the first Task-Cycle. This way, you can easily set a breakpoint in your library and debug it. 2) Which pages to you mean in detail? Most of them are just coming from specific configurator plugins. So when you see the configuration pages in EtherCAT or Profinet or s.th., those are developed specifically for this...

  • alimans alimans modified a comment on a wiki page

    Hi Ingo, Thank you for your nice introduction. I have created a library successfully based on your prepared templates and now, I have following questions: 1- How could I possibly debug my developed FB library that implementing the I/O driver interface library. This also can help me to check the data that are going back and forth between device description and the FB library to know better how things are working and which other options I have. 2- I found out that some other device drivers have more...

  • alimans alimans posted a comment on a wiki page

    Hi Ingo, Thank you for your nice introduction. I have created a library successfully based on your prepared templates and now, I have following questions: 1- How could I possibly debug my developed FB library that implementing the I/O driver interface library. This also can help me to check the data that are going back and forth between device description and the FB library to know better how things are working and which other options I have. 2- I found out that some other device drivers have more...

  • drewegatti drewegatti modified a wiki page

    Home

  • drewegatti drewegatti modified a wiki page

    Home

  • drewegatti drewegatti modified a wiki page

    Home

  • i-campbell i-campbell modified a wiki page

    Generic

  • Ingo Ingo modified a wiki page

    Generic

  • i-campbell i-campbell posted a comment on ticket #3

    task 2 of 4 - DONE https://forge.codesys.com/forge/wiki/IO%20Drivers/ DONE https://forge.codesys.com/drv/io-drivers/database/Home/ Todo https://forge.codesys.com/drv/io-drivers/doc/Generic/ The last page is not publicly editable, so it is still todo. Should we also update the list of existing drivers, or just leave them as 0004?

  • i-campbell i-campbell modified a wiki page

    Home

  • hermsen hermsen modified a wiki page

    Home

  • Ingo Ingo modified a wiki page

    Generic

  • Ingo Ingo modified a wiki page

    Generic

  • FabioPD FabioPD posted a comment on a wiki page

    Hello I have read all online documentation , I create the xml file and the library for the AM2315 with an empty project (i don't know how to use SVN in codesys) . I tried this code in my library instance in my project (PLC_PRG) TeH: AM2315FB; TeH.usiAddress:= 0 ; TeH.TimeSchedule:= T#200MS; TeH(); TeH.AfterReadInputs(); and the main code of lib is: SUPER^(); CASE _iState OF 0: IF usiAddress = 0 THEN usiAddress := 16#5C; END_IF IF SUPER^.init() THEN _iState := 5; END_IF 5: Timer.pt := TimeSchedule;...

  • Ingo Ingo posted a comment on a wiki page

    Yes, you need to use CODESYS SVN. But don't worry about the license. Whenyou use it with CODESYS Forge, you can use it w/o a license. Indeed you are right. The workflow with CODESYS SVN is not well known, yet. So a tutorial might be good.

  • FabioPD FabioPD posted a comment on a wiki page

    Hello Ingo I can't undestand how to merge the io-drivers-code-r13-trunk folder in my codesys project.... Have I to use SVN and install CODESYS SVN or I can do without? The process how to build a driver is not clear!

  • Ingo Ingo modified a comment on a wiki page

    Hi Fabio, no moderation necessary. Just create your own driver project by clicking on "register project" in driver neighborhood. Then describe your work in the wiki of the project, upload all code and devdescs to SVN, and you are done. To register your driver ID, just go to database and add it there.

  • Ingo Ingo posted a comment on a wiki page

    Hi Fabio, no moderation necessary. Just create your own driver project by clicking on "register projec" in [/drv]. Then describe your work in the wiki of the project, upload all code and devdescs to SVN, and you are done. To register your driver ID, just go to [/drv/io-drivers/database] and add it there.

  • FabioPD FabioPD modified a comment on a wiki page

    If I create it with this tutorial , after that can the moderator add the driver in the list?

  • FabioPD FabioPD modified a comment on a wiki page

    Ok thank you hope you will help me ...

  • Ingo Ingo modified a comment on a wiki page

    Ok thank you hope you will help me ...

  • FabioPD FabioPD posted a comment on a wiki page

    Ok thank you hope you will help me ... Il mer 26 feb 2020, 22:43 i-campbell ian.campbell.aus@gmail.com ha scritto: Hi Fabio, you've found the driver section already! Yes you will need to create your own driver. I look forward to seeing it, and or lending pointers where needed. Sent from forge.codesys.com because you indicated interest in https://forge.codesys.com/drv/io-drivers/doc/Generic/ To unsubscribe from further messages, please visit https://forge.codesys.com/auth/subscriptions/

  • i-campbell i-campbell posted a comment on a wiki page

    Hi Fabio, you've found the driver section already! Yes you will need to create your own driver. I look forward to seeing it, and or lending pointers where needed.

  • FabioPD FabioPD posted a comment on a wiki page

    Hello can I create a driver for the I2C AM2315 (https://learn.adafruit.com/am2315-encased-i2c-temperature-humidity-sensor/arduino-code) ? or there are some packages to download? Thanks a lot!

  • i-campbell i-campbell posted a comment on ticket #3

    Task 1 of 4 - Complete I have identified the pages that need changing, and shown who has permission to edit those pages. I have also identified the 5 exisiting drivers that use the 0004 vendor ID currently. So it remains: Decisions: whether there is consensus for this suggested change? whether there is consensus for then updating existing drivers from 0004 to 0003? Pages that suggest using 0004: @ingo : https://forge.codesys.com/forge/wiki/IO%20Drivers/ https://forge.codesys.com/drv/io-drivers/database/Home/...

  • i-campbell i-campbell created ticket #3

    Vendor code 0003 should be the vendor ID for open source drivers

  • i-campbell i-campbell posted a comment on a wiki page

    Today I learned that vendor ID 0003 is for Open Source, and vendor ID 0004 is for CODESYS Configs. Not 100% sure what Configs are, but it is clear we should be using 0003 for Forge Open Source drivers.

  • i-campbell i-campbell modified a wiki page

    Home

  • i-campbell i-campbell posted a comment on a wiki page

    The page you linked suggests using "<id>0004 ....</id>" https://forge.codesys.com/drv/io-drivers/doc/Generic/?limit=25#device-identification suggests 0004 as well https://forge.codesys.com/drv/io-drivers/doc/I2C/ suggests 0003 For a new I2C device, I can't decide.

  • Ingo Ingo posted a comment on a wiki page

    Hi Ian, this is what counts for open source drivers: https://forge.codesys.com/drv/io-drivers/database/ If you use another range, or you don't register your ID, you are not safe against conflicts with deivers from others.

  • i-campbell i-campbell posted a comment on a wiki page

    Can you please clarify if we should use 0004 or 0003 as the vendor ID? I see in the documentation and some of the projects, these vendor IDs are used interchangeably.

  • BG_Automation BG_Automation modified a comment on a wiki page

    The led is a bool, all I can do with the LED is turn it on or off. The odd part to me is the ppFrame is a also a bool and it works good, but the output LED does not. I set the LED to true in my program and the value does not pass through into the library. *** Update, after playing with the code for a little bit, I found out I had to add it to my program. I was just trying to force the value to make it work. Once I added a LED coil to my program as a coil it started to work. Thanks again for your...

  • BG_Automation BG_Automation posted a comment on a wiki page

    The led is a bool, all I can do with the LED is turn it on or off. The odd part to me is the ppFrame is a also a bool and it works good, but the output LED does not. I set the LED to true in my program and the value does not pass through into the library.

  • Ingo Ingo posted a comment on a wiki page

    Looks good! Which data type is the vqriable LED? You know, that for a boolean channel, just one bit is copied. The line: pParameter^.dwDriverSpecific := ... ... is storing the address of the variable of your driver FB in the structure of the parameter. This address is then used in ReadInputs/WriteOutputs to copy the I/O data quickly there.

  • BG_Automation BG_Automation posted a comment on a wiki page

    I have this partially working, but I seem to be missing something. My driver copies the first Channel Output which is a BYTE, but does not copy the boolean. It looks like the channel map stops at the first byte. I have read through the xml file over and over again, it pretty much matches what you have in the Can you please explain how this line works? pParameter^.dwDriverSpecific := ADR(_MCP3008.auiValue[i]); I don't understand how the channel map number of channels increments, looking at the line...

  • Ingo Ingo posted a comment on a wiki page

    The MCP3008 driver is doing it this way. Step 1) Implement the I/O Driver Interface. For this, the driver defines a new FB, implenting this interface: FUNCTION_BLOCK IoDrvMCP3008 EXTENDS IoDrvBase Step 2) Instantiate the driver FB in your devdesc: <RequiredLib libname="Linux SPI MCP3008" vendor="Open Source" version="1.0.0.0" identifier="deviceLib"> <FBInstance basename="$(DeviceName)" fbname="IoDrvMCP3008"> <Initialize methodName="Initialize" /> </FBInstance> </RequiredLib> Step 3) instantiate your...

  • BG_Automation BG_Automation posted a comment on a wiki page

    Thanks for confirming the code. Knowing the code is good forced me to look in a new direction. The python line of code [spi.open(0,1)] was the area I needed to focus on. I read some website that said spi.open(0,1) meant open port 0 in mode 1. Then I found out it meant open port 0 using device 1. I changed the settings in the SPI master on the in the device parameters. I put as spidev0.1 instead of spidev0.0. Then everything started to work. Thanks for the help!

  • BG_Automation BG_Automation posted a comment on a wiki page

    Your comments above helped out a lot but I am a bit confused on how to create the methods for IoDrvReadInputs/WriteOutputs. I added these two methods to my library and they don't seem to be called. So lets say I have my Output to Relay1. I added this to my host parameter section as with an attribute of being an output. It shows up in my IO Map channel list in my project and I map a value to Relay1. All of this works for me so far, but I am lost on how the data moves from my project to the library...

  • BG_Automation BG_Automation posted a comment on a wiki page

    I figured out the problem with communicating over the SPI bus. I though this line of code in Python [spi.open(0,1) ] meant open port 0 in mode 1. I found out that this actually means open port 0, device 1. In the SPI master device I needed to replace the value in the SPI Port parameter from '/dev/spidev0.0' with '/dev/spidev0.1'. Once I did this everything started working. I am moving on to complete the driver. Thanks for your help, confirming the code told me to look in a new direction.

  • Ingo Ingo posted a comment on a wiki page

    Your code looks good. I expect, that you are missing some init code. Did you already try "strace" on your python script? I would either try strace or a python debugger to get a better understanding of the python code. In CODESYS you can't do much wrong. Except that you might have the wrong device or frequency configured in the SPI master of your project. Especially the frequency can be important, as on some raspbian versions, the highest possible frequency was not limited correctly. Therefore you...

  • BG_Automation BG_Automation posted a comment on a wiki page

    I am having trouble writing to the SPI bus. I have a python script I am trying to translate to codesys. SPI Master settings in codesys: Max Hz 500000 bits per word is 8 port mode is 1 Python addr = 0 cmd = 0x12 //Toggle Relay param1 = 1 //Relay 1 param2 = 0 GPIO.setmode(GPIO.BCM) RELAYbaseADDR=24 ppFRAME = 25 ppINT = 22 GPIO.setup(ppFRAME,GPIO.OUT) GPIO.output(ppFRAME,False) #Initialize FRAME signa time.sleep(.001) #let Pi-Plate reset SPI engine if necessary GPIO.setup(ppINT, GPIO.IN, pull_up_down=GPIO.PUD_UP)...

  • Ingo Ingo posted a comment on a wiki page

    Hi Brian, I think I understand your situation a bit better now. 1) module file I would recommend to stay with one file. Modules are just additional devices, defined in the same device description file. They share virtually every possible tags with the devices, except those, which are identifying the device in the device repository. So, you can define a module parallel to the device in your device description: ... </Device> <Modules> <Module> <ModuleId>1704</ModuleId> <DeviceInfo> <Name name="localStrings:Name1704>Digital...

  • BG_Automation BG_Automation modified a comment on a wiki page

    Yes, I did locate the SPI template titled SPI_Template.devdesc.xml, I probably did not explain myself well enough based on your response. I am looking for a template to create a plug in SPI module to plug into a connector slot. I did not see a template for a SPI_Modules_V1.0.xml file. I have successfully created 8 slots, now I want to create a module to plug into one of the slots. I also would like to see how to iterate through each module and and perform an action based on the module type. For example,...

  • BG_Automation BG_Automation posted a comment on a wiki page

    Yes, I did locate the SPI template titled SPI_Template.devdesc.xml, I probably did not explain myself well enough based on your response. I am look for the template to create a plug in SPI module to plug into a connector slot. I did not see a template for a SPI_Modules_V1.0.xml file. I have successfully created 8 slots, now I want to create a module to plug into one of the slots. I also would like to see how to iterate through each module and and perform an action based on the module type. For example,...

  • Ingo Ingo posted a comment on a wiki page

    Did you already check the [SPI] page? Additionally you can find an SPI Template driver in the code repository.

  • BG_Automation BG_Automation modified a comment on a wiki page

    If I want to create a module file for a SPI bus device, what module filter do I use. For example, an ethercat fieldbus module uses a description file like this: <ethercatmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:nonamespaceschemalocation="EtherCATModule.xsd"></ethercatmodule> Is there a SPI module? Since the device I am using has multiple types of devices, I thought plugging modules would be the best.

  • BG_Automation BG_Automation posted a comment on a wiki page

    If I want to create a module file for a SPI bus device, what device description do I use. For example, an ethercat fieldbus module uses a description file like this: <ethercatmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:nonamespaceschemalocation="EtherCATModule.xsd"></ethercatmodule> Is there a SPI module?

  • aliazzz aliazzz modified a comment on a wiki page

    No, You should declare a BYTE in the PLC Code byBitfield : BYTE; Then you can address each bit as follows; byBitfield.0 := xMyBool0; .. byBitfield.7 := xMyBool7; Try to avoid own DUT's (enums, structs) in the Devdesc.xml and stick to basic primitives like BYTE, DINT, REAL, WORD etc. This will make your life easier in editing the devdesc.xml. Offcourse if you want to use them, no problem, but you have to declare them in your code AND the devdes.xml file, so in two seperate places! Good luck

  • aliazzz aliazzz modified a comment on a wiki page

    No, You should declare a BYTE in the PLC Code byBitfield : BYTE; Then you can address each bit as follows; byBitfield.0 := xMyBool0; .. byBitfield.7 := xMyBool7; Try to avoid own DUT's (enums, structs) and stick to basic primitives like BYTE, DINT, REAL, WORD etc. This will make your life easier. Good luck

  • aliazzz aliazzz modified a comment on a wiki page

    No, You should declare a BYTE in the PLC Code byBitfield : BYTE; Then you can address each bit as follows; byBitfield.0 := xMyBool0; .. byBitfield.7 := xMyBool7; Try to avoid own DUT's (enums, structs) and stick to basic primitives like BYTE, DINT, REAL, WORD etc. Good luck

  • aliazzz aliazzz posted a comment on a wiki page

    No, You should declare a BYTE byBitfield : BYTE; Then you can address each bit as follows; byBitfield.0 := xMyBool0; .. byBitfield.7 := xMyBool7; Good luck

  • BG_Automation BG_Automation posted a comment on a wiki page

    I have a question about the structures. I will start with the BIT structure. It looks Should the code read TYPE Bitfield : STRUCT Bit0 : Bit; Bit1 : Bit; Bit2 : Bit; Bit3 : Bit; END_STRUCT END_TYPE Device Description <BitfieldType basetype="std:BYTE" name="Bitfield"> <Component identifier="Bit0" type="std:BOOL"> <Default /> ....

  • Ingo Ingo modified a wiki page

    SPI

  • Ingo Ingo posted a comment on a wiki page

    Thanks for the report!

  • Ingo Ingo modified a wiki page

    SPI

  • BG_Automation BG_Automation posted a comment on a wiki page

    Suggested Edit: SPI Transfer You might have noticed the few lines above: aby[0] := 1; << aby[1] := 16#80 + SHL(usiChannel AND 7, 4); aby[2] := 0; aby[3] := 0; IF NOT transfer(pabyTxBuffer:=ADR(aby) , pabyRxBuffer:=ADR(aby) , udiLen:=3 , uiDelayus:=0) THEN _iState := 1000; END_IF

  • aliazzz aliazzz modified a wiki page

    Home

  • aliazzz aliazzz modified a wiki page

    Home

  • aliazzz aliazzz modified a wiki page

    Home

  • aliazzz aliazzz modified a wiki page

    Home

  • Ingo Ingo created ticket #2

    SPI / I2C Howto

  • aliazzz aliazzz modified a comment on a wiki page

  • Ingo Ingo modified a wiki page

    Generic

  • Ingo Ingo created ticket #1

    IoDrvFB: Error in Logger after download

  • codesys.com codesys.com modified a wiki page

    Driver FB

  • Ingo Ingo modified a wiki page

    Home

  • Ingo Ingo modified a wiki page

    Driver FB

  • Ingo Ingo committed [r13]

    Added device description and exported documentation

  • Ingo Ingo committed [r12]

    Initial Import of the FB I/O driver template

  • Ingo Ingo committed [r11]

    Created directory ...

  • codesys.com codesys.com modified a wiki page

    Driver FB

  • Ingo Ingo modified a wiki page

    Home

  • aliazzz aliazzz modified a wiki page

    Home

  • aliazzz aliazzz modified a comment on a wiki page

    Hi, MCP3008 only handles inputs, could you please add the following; AI, AO, DI, DO examples? This way nobody has to reinvent the wheel, monkey see, monkey do.

  • Ingo Ingo modified a wiki page

    Driver FB

  • Ingo Ingo modified a wiki page

    Driver FB

  • Ingo Ingo modified a wiki page

    Driver FB

  • Ingo Ingo created a wiki page

    Driver FB

  • Ingo Ingo modified a wiki page

    IndexMain

  • aliazzz aliazzz modified a comment on a wiki page

    ...

  • aliazzz aliazzz posted a comment on a wiki page

    Hi, About: IoDrvReadInputs / Iodrvwriteoutputs I am seriously stuck on the Iodrvwriteoutputs method... When downloading my code, CODESYS throws runtime exceptions. Can someone show me some driver example in where outputs are written via this mechanism? Thank you in advance! PS MCP3008 only handles inputs

  • aliazzz aliazzz posted a comment on a wiki page

    Hi, About: IoDrvReadInputs / Iodrvwriteoutputs I am seriously stuck on the Iodrvwriteoutputs method... When downloading my code, CODESYS throws runtime exceptions. Can someone show me some driver example in where outputs are written via this mechanism? Thank you in advance! PS MCP3008 only handles inputs

  • Ingo Ingo posted a comment on a wiki page

    I tried to explain that by reworking parts of this chapter. Hope it helps...

  • Ingo Ingo modified a wiki page

    Generic

  • Ingo Ingo modified a wiki page

    Generic

  • aliazzz aliazzz posted a comment on a wiki page

    <Attributes channel="input" download="true" functional="false" offlineaccess="write" onlineaccess="readwrite"/> => Please explain these meta tags, as they are important ;-)

  • aliazzz aliazzz modified a wiki page

    Home

  • Ingo Ingo modified a wiki page

    Generic

  • codesys.com codesys.com modified a wiki page

    IndexMain

  • Ingo Ingo modified a wiki page

    Generic

  • Ingo Ingo modified a wiki page

    Generic

  • Ingo Ingo modified a wiki page

    Home

  • Ingo Ingo modified a wiki page

    Home

1 >