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 » Subscribe_1(Simple Subscribe_1 example)
Subscribe_1 [message #1836417] Sun, 03 January 2021 06:02 Go to next message
Asterios Badios is currently offline Asterios BadiosFriend
Messages: 15
Registered: January 2021
Junior Member
Hi

I wish to recive a simple TCP/IP message, (see picture)

I have a python program sending every second a message

on the RTE I get this ?
CBSDSocketInterface: bind() failed: Permission denied

No Idea where to go from here ?,
Is it something I am not setting on the SUBSCRIBE_1 Fb ?

Thank you

Regards
Asterios
Re: Subscribe_1 [message #1836427 is a reply to message #1836417] Sun, 03 January 2021 16:29 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1224
Registered: January 2014
Senior Member
Hi Asterios,

there are several issues in your approach. First of all per default 4diac FORTE will use UDP/IP and expect an UDP multicast address when you use a SUBSCRIBE FB. If you would like to receive TCP messages you need to use a SERVER FB and use localhost and a port as address.

The second issue is that you are using a port number below 1024 these are special port numbers and typically you need a admin rights to use these.

Finally when you are sending data to 4diac FORTE you also need to consider the data packet format. In the default case we are using an ASN.1 compact encoding as defined in IEC 61499-1 Annex F and the extensions from the IEC 61499 Compliance Profile for Feasibility Demonstrations [1]. 4diac FORTE is very flexible and you can also define your own encoding. Details can be found in our network communication documentation section [2]. Already supported protocols are described here [3].

I hope this helps you.
Cheers,
Alois

[1] https://www.holobloc.com/doc/ita/index.htm
[2] https://www.eclipse.org/4diac/en_help.php?helppage=html/development/forte_communicationArchitecture.html
[3] https://www.eclipse.org/4diac/en_help.php?helppage=html/communication/communicationIndex.html
Re: Subscribe_1 [message #1836530 is a reply to message #1836427] Wed, 06 January 2021 23:51 Go to previous messageGo to next message
Asterios Badios is currently offline Asterios BadiosFriend
Messages: 15
Registered: January 2021
Junior Member
Hi Alois

I apprechiate the support, have gotten alot further, thank you

It is my first time playing with 4diac and IEC61499, I can see the benifits, I have 25 year experence in PLCs so hopfully once I get started I should not need to much of your time.

1/ How do I know its working ? Having probem decoding RD_1, from previous message how do I attached a word array ?
Like IEC1131 can I have global word arrays and attached it to the RD_1 pin ?
Screen shot 1, RTE and IDE running on my laptop, RTE working properly ? what is that error message ?

2/ On my Desktop PC, could not connect th server FB RD pin to the INT2INT ? both running ubuntu 20 10.

screen shot 2 also shows python program sending out a TCP/IP message and a example of a Fuji PLC recving a TCP/IP message in a word array,
Also the IDE that can't connect Pins.

Again, apprechiate the suport
Regards
Asterios
Re: Subscribe_1 [message #1836554 is a reply to message #1836530] Thu, 07 January 2021 11:54 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1224
Registered: January 2014
Senior Member
Hi Asterios,

happy to hear that.

However I'm concerned that you are not able to do data connections? Are you running on 4diac IDE 1.13.0? Are your FBs mapped? If yes please unmap them first and remap them. We have a minor issue that slipped trough. Will be fixed in 1.13.1 coming out hopefully next week.

The messages in your 4diac FORTE console are perfectly fine. They are mostly debugg messages for 4diac FORTE developers.

In order to configure your Server FB to expect WORD arrays. You need an FB with a WORD array input. The data format for sending word arrays is explained in the link [1] from my last post.

I hope this helps.
Alois
Re: Subscribe_1 [message #1836584 is a reply to message #1836554] Fri, 08 January 2021 07:15 Go to previous messageGo to next message
Asterios Badios is currently offline Asterios BadiosFriend
Messages: 15
Registered: January 2021
Junior Member
Hi Alois

RE not able to do data connections, yes both systems are running 1.13.0 and same OS, used the same install for both, the only difference is the one not working is in a VM, no stress will wait for update

RE Word array,
Could not connect the SERVER_1 RD_1 pin to the DI1 pin of my FB
see attached PDF
shows made a simple FB with word array in and word outs
shows definition of a WORD arry,

Assume the RD_1 ANY type would connect to my My_WA1 ?

Regards
Asterios
Re: Subscribe_1 [message #1836627 is a reply to message #1836584] Sun, 10 January 2021 07:10 Go to previous messageGo to next message
Asterios Badios is currently offline Asterios BadiosFriend
Messages: 15
Registered: January 2021
Junior Member
Hi Alois

Further to my last message, after playing around for may hrs got my FB to connect SERVER FB by making my DI1 ping a WORD array, as you said.
Now on line can see my FB working,
Can I confirm that to get my FB to work I have to export my FB and include them in my own FORTE RT. ?
If so there there clearer instruction how to do this in Linux ?

Regards
Asterios
Re: Subscribe_1 [message #1836637 is a reply to message #1836627] Sun, 10 January 2021 19:19 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1224
Registered: January 2014
Senior Member
Hi Asterios,

Hi I can only refer you to our documentation for building 4diac FORTE from source [1] and the tutorial for developing your own FBs [2]. Sofar people with Linux experience never had any issues with it.

BR,
Alois


[1] https://www.eclipse.org/4diac/en_help.php?helppage=html/installation/install.html#ownFORTE
[2] https://www.eclipse.org/4diac/en_help.php?helppage=html/4diacIDE/createOwnTypes.html
Re: Subscribe_1 [message #1836643 is a reply to message #1836637] Mon, 11 January 2021 02:46 Go to previous messageGo to next message
Asterios Badios is currently offline Asterios BadiosFriend
Messages: 15
Registered: January 2021
Junior Member
Hi Alois

Thank you for your message, followed the instructions so must missed something ?

Under Linux what I am not clear is where I put the exported FB
Does this look correct ?

sudo apt-get -y install build-essential
sudo apt-get -y install git

git clone https://git.eclipse.org/r/4diac/org.eclipse.4diac.forte
cd org.eclipse.4diac.forte

# Export from IDE my FB
# Put in a folder call EXT_MODULES in org.eclipse.4diac.forte
# put the CMakeLists.txt

./setup_posix.sh
cd bin/posix
make

Attached is my FB it is only a test for adding 2 number together ?

Regards
Asterios



  • Attachment: MyFB.h
    (Size: 1.96KB, Downloaded 16 times)
  • Attachment: MyFB.cpp
    (Size: 1.72KB, Downloaded 15 times)
  • Attachment: CMakeLists.txt
    (Size: 0.07KB, Downloaded 15 times)
Re: Subscribe_1 [message #1836646 is a reply to message #1836643] Mon, 11 January 2021 08:05 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1224
Registered: January 2014
Senior Member
Hi,

no the recommended praxis is to have your build directories and your fbs outside of the org.eclipse.fordiac.forte directory:

your working dir
|- build
| |- first build
| |- second build
| - org.eclipse.fordiac.forte
| - ext modules
| |- first ext module
| | |- MyFB.h
| | |- MyFB.cpp
| | |- CMakeLists.txt
| |- second ext module

With that you better separate your code from our code. For that I recommend the described cmake process using cmake gui. Especially when latter you want to do cross compiling this setup and cmake gui has quite some advantages.

BR,
Alois
Re: Subscribe_1 [message #1836678 is a reply to message #1836646] Tue, 12 January 2021 04:04 Go to previous messageGo to next message
Asterios Badios is currently offline Asterios BadiosFriend
Messages: 15
Registered: January 2021
Junior Member
Hi Alois

Thank you for your recommendations, using cmake gui now,

See attached screen shot ,
managed to use cmake gui to make FORTE (using latest 1.13)
included my FB
Still on the IDE shows N/A
a bit lost where to go now ?

Regards
Asterios

Re: Subscribe_1 [message #1836685 is a reply to message #1836678] Tue, 12 January 2021 07:41 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1224
Registered: January 2014
Senior Member
Hi Asterios,

Thanks for the screenshot this really helped me to find the issue. The problem is that the external modules directory can not directly hold one module. The intention is to have there one or more module subdirectories. So you should create at your ext_mod a further directory with your fblib and put there your cpp, h, and cmakelist.txt. With that in CMake gui after running Configure again a new FORTE_MODULE_yyyy will apear (should be marked red and on the top. By activating this module your FB will be added to your 4diac FORTE.

I hope this helps,
Alois

PS: In 4diac IDE there is a Deployment console view (window->show view->others...->4diac IDE->Deployment Console) this will show you the deployment process and any errors during deployment. There you should have gotten the error message unsupported type. This would hint that your type is still not in your self built 4diac FORTE
Re: Subscribe_1 [message #1836699 is a reply to message #1836678] Tue, 12 January 2021 13:09 Go to previous messageGo to next message
Asterios Badios is currently offline Asterios BadiosFriend
Messages: 15
Registered: January 2021
Junior Member
Hi Alois

Deleted the VM and started again, this time it all worked
Thank you for your support

One more question, just coming from a PLC background,
Is there a concept in 4DIAC of GLOBAL VARIABLES ?
and how would you handle RETENTIVE memory ?

Regards
Asterios
Re: Subscribe_1 [message #1836706 is a reply to message #1836699] Tue, 12 January 2021 15:24 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1224
Registered: January 2014
Senior Member
Hi Asterios,

great to hear that it works.

The language IEC 61499, which 4diac implements, does not have any global variables. So also 4diac does not have such.

I would handle RETENTIVE memory with dedicated SIFB function blocks.

Alois
Previous Topic:Error compiling forte 1.13 with open62 1.0.5
Next Topic:Response from HTTP request
Goto Forum:
  


Current Time: Sun Jun 13 03:52:17 GMT 2021

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

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

Back to the top