<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to turn on a GPIO from a device function block</title><link href="https://forge.codesys.com/drv/relay-pi-plate/discussion/general/thread/0e1bf5739b/" rel="alternate"/><link href="https://forge.codesys.com/drv/relay-pi-plate/discussion/general/thread/0e1bf5739b/feed.atom" rel="self"/><id>https://forge.codesys.com/drv/relay-pi-plate/discussion/general/thread/0e1bf5739b/</id><updated>2022-09-29T13:43:11.946000Z</updated><subtitle>Recent posts to How to turn on a GPIO from a device function block</subtitle><entry><title>How to turn on a GPIO from a device function block</title><link href="https://forge.codesys.com/drv/relay-pi-plate/discussion/general/thread/0e1bf5739b/?limit=25#7ecd" rel="alternate"/><published>2022-09-29T13:43:11.946000Z</published><updated>2022-09-29T13:43:11.946000Z</updated><author><name>lwalbert</name><uri>https://forge.codesys.com/u/lwalbert/</uri></author><id>https://forge.codesys.comba299a16f6469b3f76baf256834dc3c9148fbec6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, I was working on libraries for Pi-Plates in codesys back in 2019 too :)&lt;br/&gt;
I was struggling with the same issue as you regarding GPIO25. &lt;br/&gt;
Looks like you cannot access the GPIO25 outside a task eg. changing state within the library for each read/write cycles in a for loop.&lt;/p&gt;
&lt;p&gt;But I found a workaround: Connecting a optocoupler controlled by CS1 (chip select) to toggle GPIO25 towards Pi-Plate wire. and adjusting SPI communication speed/frequency and delay, I got it working.&lt;/p&gt;
&lt;p&gt;I decided to update and publish my work on github today :)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/lwalbert/piplates-CodeSys" rel="nofollow"&gt;https://github.com/lwalbert/piplates-CodeSys&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Lennart&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to turn on a GPIO from a device function block</title><link href="https://forge.codesys.com/drv/relay-pi-plate/discussion/general/thread/0e1bf5739b/?limit=25#9adc" rel="alternate"/><published>2019-12-07T16:20:25.684000Z</published><updated>2019-12-07T16:20:25.684000Z</updated><author><name>BG_Automation</name><uri>https://forge.codesys.com/u/briangehrke/</uri></author><id>https://forge.codesys.com35eb0459c1fce8904414f797f5e16a16e9683dd1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I need to link a GPIO to a function block.  I think I just need to point the address to the GPIO when the function block is initialized.  Then control the output when needed.&lt;/p&gt;
&lt;p&gt;Output 25 turns on just before the SPI transmits to the relay board then turns off afterward.  I don't know what is used for, but I am going to follow what the creator of the relay board did. &lt;/p&gt;
&lt;p&gt;Any suggestions?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>