Hi,
How can I create a new device? I need to make communication between RasPi and my board through SPI port. There is an example for device MCP3008 but I can't find the way how to modify it
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"c:\Users\YourWindowsUsername\CODESYS Control for Raspberry PI\2.2.0.2\DataSheet\RaspberryPI_en.pdf"
The devices and libraries which you could use as startpoint are here:
"c:\Users\YourWindowsUsername\CODESYS Control for Raspberry PI\2.2.0.2\Devices"
"c:\Users\YourWindowsUsername\CODESYS Control for Raspberry PI\2.2.0.2\Libraries"
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There are examples good for startpoint overview, but now I want to create my own device for my own board with some binary IO. Is there any way to create a new device?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I work around IoDrvPiFace a and I trying to change channels in "SPI devices I/O Mapping". What is the way to do it? In method "IoDrvUpdateConfiguration" is part:
  //SetupI/Oarea
  pParameter :=IoMgrConfigGetParameter(m_pConnector, 1000);    (* inputs *)
  IF(pParameter<>0)THEN
    pParameter^.dwDriverSpecific :=0;          (* Device offset 0 *)
  END_IF
  pParameter :=IoMgrConfigGetParameter(m_pConnector, 2000);    (* outputs *)
  IF(pParameter<>0)THEN
    pParameter^.dwDriverSpecific :=0;          (* Device offset 0 *)
  END_IF
In pdf "Creating own Runtime System Components and I/O Drivers" on page 12 is:
but after modifying this values, in project nothing was change, I want to add some IO bytes more.
V.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Maybe it is not easy to understand what I need. So, can someone add an input or outbut byte in IoDrvPiFace.library? I need to see it in SPI Devices IO Mapping.
Thanks, Viktor
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
No answer
I believe anyone want to to help but its not clear what I want.
At first, we are developing control system based on Raspberry Pi and additional FPGA boards. Its mean mainly for cnc controller LinuxCNC but we looking for additional field of use of same hardware. We are done with IO binary board (16inputs/16outputs) and I trying to make IO driver for Codesys. More info about system for LinuxCNC: https://youtu.be/ZJOIYXu7SeI
It is possible to help me and show how to modify and add some more I/O which are visible in
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if you want provide an SPI Driver for your device you need to add your library and your devicedescription for your device.
Maybe PiFace_Io_driver is the startpoint you need.
In the device description which you find here:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.2.0.2\Devices\PiFaceIOdrv.devdesc.xml"
library here:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.2.0.2\Libraries\IoDrvPiFace.library" </yourwindowsusername></yourwindowsusername>
This documentation for the runtime toolkit is not really useful for adapting Drivers for raspberry pi, this is more or less used if you buy the toolkit
and adapt a driver in C.
This SPI/I2C and other devices are implemented in IEC Code and need additional a devicedescription.
For Information on how to develop IEC libraries see the Store pdf and additional the FAQ section here in the Forum for best practice on
how to devel libraries (two instances on opens the library the second CODESYS instance open the project and test/debug your code even step into the library is possible )
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I already tried all this steps what you wrote. Something if working something not.
Consider the example, original PiFace_IO_Driver:
Is it possible to add some new variable by editing PiFaceIOdrv.devdesc.xml or IoDrvPiFace.library?
I assume yes and for someone who are experienced in codesys is it question of few steps and few minutes.
If someone can, pls describe me how to add any variable to this place. Step by step or something in particular what can help me to move to forward, not only general here is examples good for start.
Thank you in advance for any help
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am facing the very same situation as OP.
I want to add interface variables (IO Mapping) but don't know how to to that.
Did someone update the documentation? If yes where to find it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Zitat:
I want to add interface variables (IO Mapping) but don't know how to to that.
Edwin helps me with some points. Here is simple modified program PiFace with added variables. https://www.dropbox.com/s/c0zie4snrtgyrl2/Example_project.zip?dl=0
Look mainly to "IoDrvReadInputs" and "IoDrvWriteOutputs" there is connection between project and library
Regards
Viktor
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your link seems dead, would it be possible for you to repost it ? I am in a similar situation and that would be of great help, I need to develop a SPI library for a raspberry hat in order to use it with codesys and I am a bit confused on how to do it.
Thank you in advance,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Old link on dropbax is dead, I will add one what will work. This is modified PiFace driver communicating with board PiDiCNC via SPI https://youtu.be/G4Is4D764dU m
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
How can I create a new device? I need to make communication between RasPi and my board through SPI port. There is an example for device MCP3008 but I can't find the way how to modify it
HI,
see the documentation here for details:
"c:\Users\YourWindowsUsername\CODESYS Control for Raspberry PI\2.2.0.2\DataSheet\RaspberryPI_en.pdf"
The devices and libraries which you could use as startpoint are here:
"c:\Users\YourWindowsUsername\CODESYS Control for Raspberry PI\2.2.0.2\Devices"
"c:\Users\YourWindowsUsername\CODESYS Control for Raspberry PI\2.2.0.2\Libraries"
BR
Edwin
There are examples good for startpoint overview, but now I want to create my own device for my own board with some binary IO. Is there any way to create a new device?
Ok, I got it, this pdf, page 17
Thanks
I work around IoDrvPiFace a and I trying to change channels in "SPI devices I/O Mapping". What is the way to do it? In method "IoDrvUpdateConfiguration" is part:
In pdf "Creating own Runtime System Components and I/O Drivers" on page 12 is:
but after modifying this values, in project nothing was change, I want to add some IO bytes more.
V.
Maybe it is not easy to understand what I need. So, can someone add an input or outbut byte in IoDrvPiFace.library? I need to see it in SPI Devices IO Mapping.
Thanks, Viktor
No answer
I believe anyone want to to help but its not clear what I want.
At first, we are developing control system based on Raspberry Pi and additional FPGA boards. Its mean mainly for cnc controller LinuxCNC but we looking for additional field of use of same hardware. We are done with IO binary board (16inputs/16outputs) and I trying to make IO driver for Codesys. More info about system for LinuxCNC:
https://youtu.be/ZJOIYXu7SeI
It is possible to help me and show how to modify and add some more I/O which are visible in
Hi VikTan,
if you want provide an SPI Driver for your device you need to add your library and your devicedescription for your device.
Maybe PiFace_Io_driver is the startpoint you need.
In the device description which you find here:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.2.0.2\Devices\PiFaceIOdrv.devdesc.xml"
library here:
"c:\Users\<yourwindowsusername>\CODESYS Control for Raspberry PI\2.2.0.2\Libraries\IoDrvPiFace.library" </yourwindowsusername></yourwindowsusername>
This documentation for the runtime toolkit is not really useful for adapting Drivers for raspberry pi, this is more or less used if you buy the toolkit
and adapt a driver in C.
This SPI/I2C and other devices are implemented in IEC Code and need additional a devicedescription.
For Information on how to develop IEC libraries see the Store pdf and additional the FAQ section here in the Forum for best practice on
how to devel libraries (two instances on opens the library the second CODESYS instance open the project and test/debug your code even step into the library is possible )
BR
Edwin
Hi, thanks for answer
I already tried all this steps what you wrote. Something if working something not.
Consider the example, original PiFace_IO_Driver:
Is it possible to add some new variable by editing PiFaceIOdrv.devdesc.xml or IoDrvPiFace.library?
I assume yes and for someone who are experienced in codesys is it question of few steps and few minutes.
If someone can, pls describe me how to add any variable to this place. Step by step or something in particular what can help me to move to forward, not only general here is examples good for start.
Thank you in advance for any help
Hi VikTan,
give me some time to generate some more documentation for this..
BR
Edwin
I'll be very grateful
I am facing the very same situation as OP.
I want to add interface variables (IO Mapping) but don't know how to to that.
Did someone update the documentation? If yes where to find it?
Edwin helps me with some points. Here is simple modified program PiFace with added variables.
https://www.dropbox.com/s/c0zie4snrtgyrl2/Example_project.zip?dl=0
Look mainly to "IoDrvReadInputs" and "IoDrvWriteOutputs" there is connection between project and library
Regards
Viktor
Hello VikTan,
Your link seems dead, would it be possible for you to repost it ? I am in a similar situation and that would be of great help, I need to develop a SPI library for a raspberry hat in order to use it with codesys and I am a bit confused on how to do it.
Thank you in advance,
Hello everybody,
I want to use RC522 rfid IC with raspberry pi:
https://www.amazon.de/gp/product/B00QFD ... UTF8&psc=1
It supports both spi an i2c. Any suggestion where to start?
Thanks,
Gergö
Old link on dropbax is dead, I will add one what will work. This is modified PiFace driver communicating with board PiDiCNC via SPI
https://youtu.be/G4Is4D764dU m