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 » Can I connect function block input or output with variable? Like IEC61131-3(Can I connect function block input or output with variable? Like IEC61131-3)
Can I connect function block input or output with variable? Like IEC61131-3 [message #1791284] Wed, 27 June 2018 15:08 Go to next message
Henry Bao is currently offline Henry BaoFriend
Messages: 8
Registered: June 2018
Junior Member
Hello, does 4DIAC IDE support local or global variable like IEC61131-3, for example, I can use variable in F_ADD IN1/IN2/OUT, use variable is much flexible, IEC61131-3 support it, but I can not find in 4DIAC IDE, or I may have mistake to use 4DIAC IDE ?
Re: Can I connect function block input or output with variable? Like IEC61131-3 [message #1791290 is a reply to message #1791284] Wed, 27 June 2018 16:22 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

IEC 61499 does not have global variables. Therefore 4diac also does not support them. You can have local variables inside of FBs, which are called internal vars in IEC 61499.

Cheers,
Alois
Re: Can I connect function block input or output with variable? Like IEC61131-3 [message #1791955 is a reply to message #1791290] Mon, 09 July 2018 03:18 Go to previous messageGo to next message
Henry Bao is currently offline Henry BaoFriend
Messages: 8
Registered: June 2018
Junior Member
Hi Alois,

From the programming point of view, it is better have global veriables to connect to FBs, not only connect FBs to constant value or connect between FBs.

If I want to extend it, could you give me some suggestion for that?

Best Regards,
Henry
Re: Can I connect function block input or output with variable? Like IEC61131-3 [message #1791971 is a reply to message #1791955] Mon, 09 July 2018 08:45 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Hi Henry,

I disagree strongly that global variables are either needed, or improve something from the programming point of view. If you REALLY NEED to get a similar effect, you can also use PUBLISH/PUBL and SUBSCRIBE/SUBL, although I would recommend to restructure your program to eliminate the need for a global variable!

Best regards,
Martin

[Updated on: Mon, 09 July 2018 08:45]

Report message to a moderator

Re: Can I connect function block input or output with variable? Like IEC61131-3 [message #1791975 is a reply to message #1791971] Mon, 09 July 2018 09:30 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi,

I agree here with Martin and would add a strong warning towards the PUBL/SUBL approach as in my experience I noticed that these leads to very hard to understand and maintain programs.

There is a very good reason that IEC 61499 does not provide global variables: in distributed systems global variables are very hard to implement and to use correctly.

As I pointed out above maybe Basic Function Blocks with their internal vars and with the algorithm local vars (i.e., BEGIN_VAR i:INT; END_VAR) are the solution you are looking for.

Cheers,
Alois
Re: Can I connect function block input or output with variable? Like IEC61131-3 [message #1792003 is a reply to message #1791975] Mon, 09 July 2018 16:03 Go to previous messageGo to next message
Henry Bao is currently offline Henry BaoFriend
Messages: 8
Registered: June 2018
Junior Member
Hi Alois, I start to understand your suggestion by using Basic Function Blocks, I will change the concept of application programming. IEC61499 is really different concept than pure IEC61131-3 programming, even IEC61499 extend lots of feature from IEC61131-3.
Re: Can I connect function block input or output with variable? Like IEC61131-3 [message #1792036 is a reply to message #1792003] Tue, 10 July 2018 11:51 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi Henry,

Great that this is of help for you.

Cheers,
Alois
Previous Topic:E_DELAY/wait in ST
Next Topic:Guide from migrating from 61131-3 ST application to 61499
Goto Forum:
  


Current Time: Fri Mar 29 00:23:22 GMT 2024

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

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

Back to the top