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 » Control System app for Beckhoff Using OPC-UA
Control System app for Beckhoff Using OPC-UA [message #1791557] Mon, 02 July 2018 13:16 Go to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Dear 4Diac-cers,

I am new to IEC 61499 environment, I have implemented a few academic projects in FBDK IDE.

I have a Beckhoff PLC and a mini paper pulp processing plant, for which I am planning to create a forte RTE, on which my designated Control App which (will be) made in Eclipse 4Diac IDE run. I will be using OPC-UA as a communication protocol between them.

The first Stage of the project will be to implement, the Process simulation using 4DIAC RTE on OPC-UA and than, the PLC for Pulp paper process plant. The simulator has been already implemented in Node JS.

Just before getting started, I want to ask a few questions.
• Suggest me, how I can go about creating a forte Runtime Environment for a PLC, which has its own Function Blocks?
• Can the generic Function blocks provided by 4Diac be used to program a proprietary PLC, and can one setup a RTE for the same or I can download a certain library for my task?

I will keep on posting my progress and ambiguities during the course of the project duration.

Thank you in advance.

Br,
Ahsan
Re: Control System app for Beckhoff Using OPC-UA [message #1791559 is a reply to message #1791557] Mon, 02 July 2018 13:29 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Hi,

although I am not 100% sure if I understood correct, what you want to do, I throw in my 2 cents.
For your first question, regarding how to create a FORTE with custom function blocks, please refer to the the online help of 4diac (https://www.eclipse.org/4diac/en_help.php)

To your second questions: Quick answer: No
Longer answer, Beckhoff PLCs are based on the IEC 61131 standard, which, besides it is a cycle-based execution environment without event, does NOT define a standardized way, how a programming tool shall interact with the run-time environment. In fact, Beckhoff's TwinCAT utilized the Visual Studio compiler suite to compile a specific executable, which implements the program designed in TwinCAT.

So there are three ways to proceed from here:
1. Use OPC UA to also communicate with TwinCAT - should work as OPC UA is a standard. I have never done this, so I cannot provide any hints here.
2. Use Beckhoff's ADS interface to communicate with TwinCAT - I have already done this, works ok, but you cannot do real-time control over ADS (same as OPC UA), but you can set reference values easily via ADS and have the control algorithm programmed in TwinCAT.
3. Implement/find a working EtherCAT master stack - Depending on your requirements the Simple Open EtherCAT Master could be sufficient for your task. With that, you can completely replace TwinCAT and communicate directly with the Beckhoff components controlling your plant.

Best regards,
Martin
Re: Control System app for Beckhoff Using OPC-UA [message #1791698 is a reply to message #1791559] Wed, 04 July 2018 10:16 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Thank you Martin for your detailed answer, I have already started investigating your approach. Will update if I get somewhere :-)
I will appreciate a few more suggestions/approaches form other members.
Thank you.

Best Regards,
Ahsan Zia

Re: Control System app for Beckhoff Using OPC-UA [message #1792869 is a reply to message #1791698] Wed, 25 July 2018 09:14 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Hi All,
I have developed my control application using 4Diac.
Control application consist of a composite block, which in turns encapsulate 6 different composite blocks.
Now, I have to connect my application to the process simulator, using OPC-UA.
Can someone guide me how to establish communication between them?

Thank you.

Best Regards,
Ahsan Zia
Re: Control System app for Beckhoff Using OPC-UA [message #1792886 is a reply to message #1792869] Wed, 25 July 2018 11:29 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
Can you explaing the architecture a little bit more? Where's FORTE running? What do you want to connect? Is the 4DIAC application for the Simulation or for the actual PLC?
Re: Control System app for Beckhoff Using OPC-UA [message #1792888 is a reply to message #1792886] Wed, 25 July 2018 11:54 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Hi Jose,
Thank you for your reply.
The application is for the simulator at this time.. after that it will be modified for the actual PLC (later in August or Sept), for the timewe are want to establish a connection with the simulator.
The application takes 31 inputs, from which we have considered 20 primary inputs, 16 BOOL, 4 UNIT. to run the initial tests.
Different FB ""should"" give output on the bases of what combination of inputs have been energized. Inputs represent different valves and pumps.
for example: form the process AB , needs the combination of valves V1, V2, and V3 with Pump P1, which the liquid start flowing between A to B.
Please also check the first message of this thread.

Best Regards,
Ahsan Zia

  • Attachment: 101.JPG
    (Size: 94.91KB, Downloaded 155 times)
Re: Control System app for Beckhoff Using OPC-UA [message #1792890 is a reply to message #1792888] Wed, 25 July 2018 12:11 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
Ok, I think I get it now, but I still don't know where exactly you need help now. Do you wan to offer the inputs as OPCUA vairables that the PLC can trigger and then offer the outputs also sa OPCUA variables?
Re: Control System app for Beckhoff Using OPC-UA [message #1792897 is a reply to message #1792890] Wed, 25 July 2018 12:57 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Please look at the logic diagram below.

I hope you get a better idea from that.
  • Attachment: Logic.JPG
    (Size: 33.31KB, Downloaded 172 times)
Re: Control System app for Beckhoff Using OPC-UA [message #1792899 is a reply to message #1792897] Wed, 25 July 2018 13:06 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

did you have a look at our opc ua documentation yet? I think there it is quite clearly described how to connect to OPC UA servers for reading and writing data.

Furthermore I noticed that in your CFB you are duplicating events. That means for one input event you are sending two output events. Maybe that it is not what you want. also I would expect that a basic FB would be more efficient for the tasks you need.
Re: Control System app for Beckhoff Using OPC-UA [message #1792939 is a reply to message #1792899] Thu, 26 July 2018 08:12 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Dear Alois,
The snapshot I pasted in the above thread is, what we want my FB to work like. 5 different function blocks (almost) on the same concept are created.
Which (Should) perform operation and give the desired outputs.
We are planning that each of the CFB should perform individual for each individual process in the simulator. It might not be logically correct but its what we are intending to do.
I have been working with UA expert for a while now, recently we have implemented a JS code and used it to read and write data for UI.

BR,
Ahsan
Re: Control System app for Beckhoff Using OPC-UA [message #1792978 is a reply to message #1792939] Thu, 26 July 2018 19:42 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Dear Ahsan,

thanks for the clarification.

Regarding OPC UA. following our docs you can the easily connect to forte with UA expert.

Alois
Re: Control System app for Beckhoff Using OPC-UA [message #1793656 is a reply to message #1792978] Mon, 13 August 2018 11:18 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Dear All,
I have compiled, open62451 enabled Forte. Tested it with the examples in the documentation, and implemented the control logic for the application in 4Diac.
Currently, I looking for method(s) to connect the 4diac application to my JS Simulator using OPC-UA for reading and writing of the data?
The JS simulator already uses UA expert for reading and writing of data.


BR,
Ahsan
Re: Control System app for Beckhoff Using OPC-UA [message #1793673 is a reply to message #1793656] Mon, 13 August 2018 19:57 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi Ahsan,

if I understand your post above correctly then it means that your simulator is offering values for reading and writing as server and that you can use UA Expert as client to read and write to/from it. If this is the case please have a look in the 4diac's OPC UA documentation under the Client section. There I think it is described how you can read and write data on a remote server.

I hope this helps.

Cheers,
Alois
Re: Control System app for Beckhoff Using OPC-UA [message #1793706 is a reply to message #1793673] Tue, 14 August 2018 11:36 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Dear Alois,
Thank you for your reply.
Yes, you are right. I have already went through client /server documentation, but still looking for more explanation.
I am wondering is there some more documentation regarding the same topic?

BR,
Ahsan
Re: Control System app for Beckhoff Using OPC-UA [message #1793857 is a reply to message #1793706] Fri, 17 August 2018 11:28 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

As far as I know there is not more available. I think you'll hae to experiment a bit.
Re: Control System app for Beckhoff Using OPC-UA [message #1793905 is a reply to message #1793857] Mon, 20 August 2018 08:05 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Dear All,
I have tested all the values coming from different nodes by the method you helped me do last Thursday.
My application takes 31 values in total, out of which, 27 BOOL values, 4 UNIT values.
Initially, I was thinking to make composite blocks for each of the nodes, to read and write the values, but I guess that is not possible.

index.php/fa/33848/0/

If I go by the procedure by implementing the same logic for each nodes, it will be quite messy, there will be dozens of tabs at the same time to operate the application.

I have a few question regarding the application.
*What procedure of implementation should I follow to keep the application as simple as possible? What are your recommendations?
*There should be one Client/Publish (node) per EMB-RES?


Best
Ahsan
  • Attachment: NwBlck.JPG
    (Size: 208.80KB, Downloaded 961 times)

[Updated on: Mon, 10 September 2018 09:10]

Report message to a moderator

Re: Control System app for Beckhoff Using OPC-UA [message #1796501 is a reply to message #1793905] Mon, 15 October 2018 12:01 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Dear All,

I am trying Beckhoff's ADS interface to communicate with TwinCAT. I guess now we can achieve real-time control over ADS.
which compiler is recommended for compiling ADS lib from Beckhoff? I am having trouble building it with VS 2017.

Thanks.
Br,
Ahsan
Re: Control System app for Beckhoff Using OPC-UA [message #1796505 is a reply to message #1796501] Mon, 15 October 2018 13:15 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Hi Ahsan,

I am assuming you want to use this library
https://github.com/Beckhoff/ADS

I compiled it with VS 2017 without problems, excluding the tests.

Please also note, that ADS is NOT real-time capable, as it operates via TCP.
It is mainly for changing or reading process parameters and such stuff.

Best regards,
Martin
Re: Control System app for Beckhoff Using OPC-UA [message #1796580 is a reply to message #1796505] Tue, 16 October 2018 10:33 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Yes, I am using this same library.

Thank you.
Br,
Ahsan
Re: Control System app for Beckhoff Using OPC-UA [message #1796668 is a reply to message #1796580] Wed, 17 October 2018 09:36 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Dear Martin,
Is there any documentation or tutorial for the compiling or usage of the ADS library?
I am having trouble, not getting any detailed documentation for the method to follow.

P.S: I get the following error when compiling the library using VS17.

Thank you.
Best Regards,
Ahsan Zia
  • Attachment: ADS.JPG
    (Size: 37.87KB, Downloaded 126 times)
Re: Control System app for Beckhoff Using OPC-UA [message #1796675 is a reply to message #1796668] Wed, 17 October 2018 11:34 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Dear Ahsan,

as I am not involved with the ADS library project, my knowledge is limited. You can ignore the error regarding fructose, as this is only needed for the tests for the library.
The solution for the first error is given in the error message itself, so just add the stated define to your project.
The middle error will disappear as soon as the first error is resolved.

Best regards,
Martin
Re: Control System app for Beckhoff Using OPC-UA [message #1796818 is a reply to message #1796675] Fri, 19 October 2018 12:14 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Hello All,

Are there any documentations or tutorials on usage of the ADS library?

Br,
Ahsan


Re: Control System app for Beckhoff Using OPC-UA [message #1796830 is a reply to message #1796818] Fri, 19 October 2018 13:55 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

HI,

you mean in 4diac, or in general how ADS is working. For the later there is a nice introduction at the Beckhoff web-page [1]. For 4diac we are still working on some docs. This will take some more time.

[1] https://infosys.beckhoff.com/english.php?content=../content/1033/tcadsdll2/html/tcadsdll_intro.htm&id=
Re: Control System app for Beckhoff Using OPC-UA [message #1796907 is a reply to message #1796830] Mon, 22 October 2018 08:16 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Hi Alois,
Yes, no problem. Please keep me informed about the documentations for the 4Diac.
I have been looking into ADS documents on the Beckhoff for a while.

BR,
Ahsan
Re: Control System app for Beckhoff Using OPC-UA [message #1797804 is a reply to message #1796907] Tue, 06 November 2018 14:54 Go to previous messageGo to next message
Ahsan Zia is currently offline Ahsan ZiaFriend
Messages: 36
Registered: July 2018
Member
Hi All,
Is there any update regarding the ADS library?

BR,
Ahsan
Re: Control System app for Beckhoff Using OPC-UA [message #1798627 is a reply to message #1797804] Wed, 21 November 2018 10:34 Go to previous message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Hi,

the ADS module has been added to the 4diac 1.10.0 RCs. So in order to use it you have to compile the Beckhoff ADS library from GitHub, and then configure FORTE's CMake settings accordingly where the compiled lib is located.

Before you can use an ADS connection in FORTE you first have to configure the ADS server you want to communicate with, via the ADS_SERVER_CONFIG FB. Then you can use the IO interface FBs to send and receive data values via ADS.
Which variable is accessed via the IO FBs is set via the PARAMS IN, in the following format <ADSServerFriendlyName:Full-qualified_Var_Name>. E.g., you configured an ADS server with the friendly name MyServer, and this Server sports a variable in this global variable list (usually called GVL) named MyVar, the PARAMS In would look like this: MyServer:GVL.MyVar.

If FORTE is running on an machine without an ADS address (so usually this means no TwinCAT is installed), you also have to set a local ADS address via the SET_LOCAL_ADS_ADDRESS FB.

Best regards,
Martin
Previous Topic:Changes in forte_sync.cpp
Next Topic:4DIAC forte sending too many watch request/respond packets
Goto Forum:
  


Current Time: Thu Mar 28 12:48:38 GMT 2024

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

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

Back to the top