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 » Auxiliary variables(Create auxiliary variables to use in a program)
Auxiliary variables [message #1862728] Fri, 22 December 2023 21:59 Go to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
Hello, I have a question regarding the creation of variables. Suppose I want to create a 32-bit variable that will be stored in the memory of the RT1060 microprocessor. Do I need to create a block that stores this memory so I can use it in another situation, for example, to store the state of a button? Or does the forte compiled within it already store this data in memory?
My idea is to use the IW block for this. Do you have any examples of this?
Re: Auxiliary variables [message #1862729 is a reply to message #1862728] Fri, 22 December 2023 23:32 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

With the information you provide this is hard to say. In general the input and output blocks will store at there pins the last state. Examples are the wago modular io or embrick.
Re: Auxiliary variables [message #1862743 is a reply to message #1862729] Tue, 26 December 2023 12:44 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
Hi Alois, in the case i think about an auxiliary variable, like use in PLC. Can i create auxiliary variables in 4 diac?
Re: Auxiliary variables [message #1862750 is a reply to message #1862743] Wed, 27 December 2023 15:46 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

I'm not sure what you mean with auxiliary variables. If you mean global variables, then the answer is no. IEC 61499 does not have global variables in its language definition. However FB hold the variables on their inputs, outputs and their internal variables.
Re: Auxiliary variables [message #1862810 is a reply to message #1862750] Fri, 29 December 2023 18:06 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
It's possible to work with int and float variables in 4Diac? Do you have some example to do this? Where i can define these variables in 4diac? Have some block to do that?

[Updated on: Fri, 29 December 2023 18:34]

Report message to a moderator

Re: Auxiliary variables [message #1862812 is a reply to message #1862810] Fri, 29 December 2023 22:01 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Eclipse 4diac supports all IEC 61131-3 elementary data types, as well as Structs and arrays [1]. You can use these as input, output, or internal variables of your FB.

[1] https://en.wikipedia.org/wiki/IEC_61131-3
Re: Auxiliary variables [message #1862823 is a reply to message #1862812] Sat, 30 December 2023 12:58 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
In 4diac how can i use these blocks? Do you have some example in 4diac with the blocks?
Re: Auxiliary variables [message #1862824 is a reply to message #1862823] Sat, 30 December 2023 14:16 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

I'm sorry I don't think I understand your question. Did you already had a look on our tutorials?
Re: Auxiliary variables [message #1862827 is a reply to message #1862824] Sat, 30 December 2023 18:17 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
Yes Alois, i read the tutorials and made the examples. My question is about create variables to be used in my program. By example, i use this variable to read a button, but use her another time to activate some output. Like with plc. In the image, the coil DNi is a internal variable to be used in the line 3. I want know if in 4diac this is possible. If i can define a variable int or real. And use this variable where i want in my application.
Re: Auxiliary variables [message #1862831 is a reply to message #1862827] Sat, 30 December 2023 21:53 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

For reading a button you would have an IX block. You can connect the output of this block to several of your other block to check the value and perform according control actions. The same is for analog inputs where you would have an IW or ID block, followed by an according conversion.
Re: Auxiliary variables [message #1862957 is a reply to message #1862831] Mon, 08 January 2024 18:26 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
Hello, can i create a REAL variable using blocks in 4diac?
Re: Auxiliary variables [message #1862958 is a reply to message #1862957] Mon, 08 January 2024 19:04 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

If I understand your question correct I think the answer is no. But you can have blocks with REAL variables as inputs and outputs.
Re: Auxiliary variables [message #1862960 is a reply to message #1862958] Mon, 08 January 2024 19:58 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
Thanks Alois. In the case i will create a IO block with inputs and outputs with the type REAL.
Re: Auxiliary variables [message #1862962 is a reply to message #1862960] Mon, 08 January 2024 19:59 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Ah now I understand you. I think the more generic approach that Eclipse 4diac currently follows would be to us an IW and then an WORD_TO_REAL block.
Re: Auxiliary variables [message #1862963 is a reply to message #1862962] Mon, 08 January 2024 20:01 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Or maybe even a custom AI block with a word input and REAL input for the upper and the lower range of your sensor which is then converting to the REAL value you need. Because I would expect that the analog input is just delivering the ADC value as 16 bit integer or?
Re: Auxiliary variables [message #1862964 is a reply to message #1862963] Mon, 08 January 2024 20:09 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
The input Analog of RT1060 is 12 bits. In the case i will construct this block AI to use this like a variable. And when i need of the value i use this block. Thanks for the help Alois.
Re: Auxiliary variables [message #1862965 is a reply to message #1862964] Mon, 08 January 2024 20:13 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Yes in this case the combination of QW with an AI block seems to be the right thing.

Happy to help!
Re: Auxiliary variables [message #1863055 is a reply to message #1862965] Fri, 12 January 2024 20:54 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
Hello Alois, I'm working on development and I would like to understand the following question. My client wants me to create variables of 3 types in my 4diac application. A bool, a DINT and a REAL. If it were an application in C it would be like this:
bool A;
intB;
float C;
To do this, would I have to create this in a SIFB or is there a block that could do this?
Re: Auxiliary variables [message #1863072 is a reply to message #1863055] Sun, 14 January 2024 17:13 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi André,

not sure if I can answer this in a forum post without more information. Would it make sense that we setup a vritual meeting to discuss a bit more the requirements of your client?

BR,
Alois
Re: Auxiliary variables [message #1863081 is a reply to message #1863072] Mon, 15 January 2024 10:31 Go to previous messageGo to next message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
Hi Alois, ok. When you can?
Re: Auxiliary variables [message #1863082 is a reply to message #1863081] Mon, 15 January 2024 10:35 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

I'll write you an email with dates. In which timezone are you located?
Re: Auxiliary variables [message #1863083 is a reply to message #1863082] Mon, 15 January 2024 10:36 Go to previous message
André Soçva is currently offline André SoçvaFriend
Messages: 83
Registered: November 2023
Member
Brazil
Previous Topic: Variable Movers (assignment)
Next Topic:modbus multi-connection
Goto Forum:
  


Current Time: Sat Apr 27 22:33:19 GMT 2024

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

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

Back to the top