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 » Using 4diac in Revolution Pi (RevPi) && IO accessing
Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843608] Tue, 10 August 2021 12:56 Go to next message
Tuojian Lyu is currently offline Tuojian LyuFriend
Messages: 18
Registered: October 2020
Junior Member
Hello,

I am recently thinking about how to use 4diac for RevPi. Since the RevPi OS is based on Rasbian that is a Linux-like OS, I can compile Forte and run it on RevPi, and also FBs can be deployed successfully.

The problem I have now is how to access IO modules of RevPi, e.g., digital/analog IOs, via FBs. I noticed in the document section of the forte docker container build, it mentions the Forte for RevPi is coming soon but I did not see any more updates about using 4diac in RevPi.

Does anyone have experience using 4diac on RevPi to access IOs?

Thanks for any help.
Re: Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843613 is a reply to message #1843608] Tue, 10 August 2021 18:58 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi,

Jose already did a very nice implementation for the revolution PI: https://git.eclipse.org/r/c/4diac/org.eclipse.4diac.forte/+/153699
I still have to do some legal homework to finally merge it into our public repo. But you should be able to use it.

Cheers,
Alois
Re: Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843630 is a reply to message #1843613] Wed, 11 August 2021 10:17 Go to previous messageGo to next message
Tuojian Lyu is currently offline Tuojian LyuFriend
Messages: 18
Registered: October 2020
Junior Member
Hi Alois,

Thanks for your reply.

I managed to compile the Forte with RevPi modules successfully, even though there was a known bug (stringlist.cmake with known argument IN0). This was solved via the patch you sent in another post.

However, I had a problem using IX and QX to access RevPi DIO. I attached my IX and QX configurations and Forte terminal log here. Seems the IX and QX are not initialized properly with the status "Wating for handle".

What would be the correct PARAMS format or should I do something else to solve this problem?

Br,
Tuojian
Re: Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843652 is a reply to message #1843630] Thu, 12 August 2021 09:23 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi,

the revpi allready follows our new IO infrastructure implementation (similar to modular wago and embrick). For this the PARAMS input is not used anymore but the instance name of the IX and QX function blocks. These names are mapped to the I/O pins of your IO modules.

The mapping itself is done in a seperate IO configuration. This IO configuration is again a 1499 FBNetwork. Typically we do it in a dedicated IO config resource in the target devices. There you need a master fb and in the order of the physical connection the IO module FBs daisychained with an adapter connection. With that 4diac FORTE can check if the right IO modules are connected in the right order on your backplane.

The IO module FBs have for every physical pin an string input where you can specify names of or you IX/QX blocks. On startup/init the mapping is performed.

For the revpi the master fb is the IORevPiCore, the IO blocks are IORevPiAIO and IORevPiDIO. Unforutnately I don't have the fbt files at hand. But you could manually reconstruct them from the Cpp files in patch.

I hope this helps,
Alois
Re: Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843672 is a reply to message #1843652] Fri, 13 August 2021 07:05 Go to previous messageGo to next message
Tuojian Lyu is currently offline Tuojian LyuFriend
Messages: 18
Registered: October 2020
Junior Member
Hi Alois,

Many thanks! I just found this new IO infrastructure is really an interesting idea to increase the reusability and flexibility of control applications.
I think what you mentioned above about the FB network of IO configuration is similiar to the master-slave modular architecture mentioned in this paper https://ieeexplore.ieee.org/document/8247577
I will try your solution and update here if there is any progress.

Br,
Tuojian
Re: Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843706 is a reply to message #1843672] Sat, 14 August 2021 17:55 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi Tuojian,

yes this paper describes that infrastructure. The infrastructure and the paper where the result of the BA thesis of Johannes Meßmer. For all new IO implementations we try to go that road.

BR,
Alois
Re: Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843771 is a reply to message #1843706] Tue, 17 August 2021 10:22 Go to previous messageGo to next message
Tuojian Lyu is currently offline Tuojian LyuFriend
Messages: 18
Registered: October 2020
Junior Member
Hi Alois,

After some work on the IO configuration FBN, the problem is now that FBs, including IORevPiCore, IORevPiDIO and IORevPiBusAdapter, could not be initialized successfully, even though I included and compiled the RevPi IO module patch.

Steps to reproduce:
1. Pull the RevPi patch

2. Select FORTE_IO and FORTE_IO_RevPiModularIO in CMake (other options are the same as default from the tutorial)
index.php/fa/40853/0/

3. Compile Forte successfully

4. Create SIFB, IORevPiCore, IORevPiDIO, and create an adapter, IORevPiBusAdapter.
index.php/fa/40855/0/
index.php/fa/40856/0/
index.php/fa/40857/0/

5. Create a separate resource and map those FBs to this IO config resource and deploy. Those FBs could not be initialized correctly. (NO deployment error)
index.php/fa/40854/0/

End of steps

I have two questions:
1. How to use an adapter in SIFB. From the tutorial, I only see how to use the adapter in basic FB and composite FB but not SIFB. How should I configure events links inside SIFB for the adapter? Or, I just need to drag and drop the adapter to its correct places (socket/plug) and that is all.

2. How do fbt files link to source files? Using the same names? I tried to test embrick IO config FBN and those FBs are working well. I noticed the core FB is called EBMaster but its corresponding source files are Master.cpp/.h under embrick module folder. How does the EBMaster FN link to Master.cpp/.h source files or binary files?
I suppose the fbt and its source files should use the same name so that RT knows where to find its binary. But when I check the EBMaster, it is not the case as I thought.

Br,
Tuojian
Re: Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843778 is a reply to message #1843771] Tue, 17 August 2021 17:18 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi Tuojian,

not sure if fully understand you first question. The application fragment you are showing looks good. However when you get NA on monitoring it normally means that the FBs and ports could not be found in your FORTE. Did you get any errors during deployment? What is the output in your deployment console.

Yes 4diac FORTE and 4diac IDE communication with each other on name basis. So if you have fbt files with the same names and the same interface as in the cpp files everything should be fine.

Alois
Re: Using 4diac in Revolution Pi (RevPi) && IO accessing [message #1843794 is a reply to message #1843778] Wed, 18 August 2021 14:39 Go to previous message
Tuojian Lyu is currently offline Tuojian LyuFriend
Messages: 18
Registered: October 2020
Junior Member
Hi Alois,

Many thanks for your hints. I finally found the problem that is because there is an error in CMakeLists.txt in the RevPi module.
When I correct the "if(FORTE_MODULE_RevPiModularIO)" to "if(FORTE_IO_RevPiModularIO)", it works eventually. This is because RevPi module is added to IO not MODULE via "forte_add_io(RevPiModularIO)".

My demo with two blinking LEDs and one button for testing the RevPi, DIO, OPC UA and LuaJIT:
index.php/fa/40861/0/

Br,
Tuojian
Previous Topic:MQTT Invalid ID
Next Topic:Uploading the 4DIAC Project Permanently
Goto Forum:
  


Current Time: Fri Apr 26 17:15:26 GMT 2024

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

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

Back to the top