Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

PiFace Problem

JAPIB
2015-11-12
2015-11-28
  • JAPIB

    JAPIB - 2015-11-12

    Hello

    I updated CODESYS to SP7 Patch 3.
    I updated my raspberry Pi B with V3.5.7.10.
    I try exemple "PiFace.projet" and the other "PiFaceIoDrv.project". The only change from the originals projects is update for Devices, libraries, ...
    I use french CODESYS version

    They does not work. Input and Output of the PiFace card are not refreshed.
    With PiFace.Project : the SPI Bus does not work. I see a red triangle in front of SPI_Mster and PiFace.
    With PiFaceIoDrv.project : I see a red triangle in front of SPI_Mster but a green circle in front of PiFace.

    With all versions it worked well and there is no wiring change between the 2 versions.
    I made a mistake but where ? Someone already made this manipulation ?
    Thank you in advance for your ideas

     
  • eschwellinger

    eschwellinger - 2015-11-12

    Hi,
    is SPI enabled ?
    check by:
    sudo raspi-config
    check if you are on the right SPI bus
    (Guess we have two)
    BR
    Edwin

     
  • JAPIB

    JAPIB - 2015-11-13

    Hi Edwin
    I try your idea. SPI is enabled, it seems there is only one SPI bus (I use a Raspberry B).
    But it does not work
    Best regard

     
  • JAPIB

    JAPIB - 2015-11-13

    HI
    I solved my problem.
    1Β°) I update the kernel by :
    - sudo apt-get update
    - sudo apt-get dist-upgrade
    - sudo rpi-update

    2Β°) Then I checked the use of SPI bus.

    3Β°) And then I tested the card piface with the Piface Digital Emulator
    - sudo apt-get install python3-pifacedigital-emulator
    It works well.

    4Β°) Then I updated CoDeSys and everything works.

    Is the order of updates very important ? I don't know,but it works

    Best regard

     
  • mravlincek - 2015-11-25

    Hi there! I'm going to use this topic instead of opening a new one I'm completly new to Codesys and also Raspberry Pi with PiFace digital. I am stuck at the basics already. In the example project called PiFace.project we can find the "PiFace.byIn.0" and "PiFace.byIn.1" which clearly control the PiFaces input keys. But how do you know that? Are they listed in a library or something? How do i find other let's say if I connect a switch to other inputs? I hope you understand what I mean...

     
  • mravlincek - 2015-11-25

    Actually here is a screenshot of the project. How do you know that those inputs and outputs are named like those variables?

    IMG: ss.jpg

     
  • eschwellinger

    eschwellinger - 2015-11-28

    Hi,
    I try to explain what our idea is/was behind this on developing this with two solutions/posibilities to use it / add it to the device tree

    In the example / library and device description directory of the Pi delivery you find two independent approaches:
    1. Using the Piface by an ready to use IO Driver library see ->screenshot PifaceIodriver - with makes possible to map IO's in the IO Mapping tap

    1. Using the Piface without IO mappping - the system execute the implicit generated fb (Name of the instance is in that example PiFace -> this is how you have named the Piface in the device tree) and you see the variable/Input/Output definitions in the library

    Hope this helps to understand it a little bit more.
    Personally I would prefer to use 1.) this is more like all these fieldbus offer to map variables

    BR
    Edwin

    IMG: PiFaceIODriver.jpg

    IMG: PiFace2.jpg

     
  • mravlincek - 2015-11-28

    OK thanks, that clears it up a little bit. How about if I connect an external button to PiFace inputs, and another external LED light to the ouputs. How do I know how to "call" them or what their variables are? I will be working with Ladder Logic Diagram.

     

Log in to post a comment.