Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Accessing the same GPIO PIN on RPI with IX FBs
Accessing the same GPIO PIN on RPI with IX FBs [message #1777307] Tue, 28 November 2017 10:01 Go to next message
Daniel Ng is currently offline Daniel NgFriend
Messages: 23
Registered: October 2017
Junior Member
Dear all,

I'm trying to access the same GPIO pin on a raspberry pi 3 with the sysfs module. As seen in the diagram below, the first instance of IX FB manages a read success. However, down the chain of function blocks where the 2nd instance of IX FB tries to read the same GPIO pin(13), there is a status " Could not read".

Is it not possible to access the same GPIO pin once a IX FB mapped to that pin is instantiated?

Thank you.

Regards,
Daniel

index.php/fa/31414/0/

Re: Accessing the same GPIO PIN on RPI with IX FBs [message #1777308 is a reply to message #1777307] Tue, 28 November 2017 10:05 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Once an IX is INITialized, it opens the file of sysfs to read the input. Initializing another FB to the same file will try to open the same file that's already open. May I ask why do you have 2 IX Blocks reading the same input?
Re: Accessing the same GPIO PIN on RPI with IX FBs [message #1777376 is a reply to message #1777308] Wed, 29 November 2017 02:29 Go to previous messageGo to next message
Daniel Ng is currently offline Daniel NgFriend
Messages: 23
Registered: October 2017
Junior Member
Dear Jose,

I have a digital input coming in on that pin. Which was why I was trying to create a software debouncing circuit to read from the same input in succession for a rising edge. Would there be a better way to do this? You can ignore the DebounceCount FB for now, it's not doing anything useful.

Thanks!
Regards,
Daniel
Re: Accessing the same GPIO PIN on RPI with IX FBs [message #1777402 is a reply to message #1777376] Wed, 29 November 2017 08:26 Go to previous message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
Hi,
I'm still not sure what you want to do. You could use the E_R_TRIG FB which gives you and output event on a rising edge. If you want to do something after a risign edge, you should use the output of this FB to trigger whatever you need. You could have a delay as you have, and a falling edge detection which stops the delay. In that case your rising edge will only go through if it stayed up for the time you specified. But I think it would be a better idea to look for information about the physical behaviour of the RPI and how does the sysfs in linux handles the bouncing (or have a physical debouncer), since doing it by software would be less efficient, I'd say.
Previous Topic:FORTE - Compile your own Function Blocks and code
Next Topic:Blinking applicaiton with Raspberry 3B QX could not write
Goto Forum:
  


Current Time: Fri Apr 19 05:27:00 GMT 2024

Powered by FUDForum. Page generated in 0.02998 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top