carlospetry77
Hello, i'm working on a User Defined POU for a MOTOR. If i declare a variable for a Timer, i.e. TON. Can i use Q state for a contact? For example, if i've TON0. Can i use TON0.Q for a NO contact? I need to declare individually? 

captura2.png 
Or i need to add a Coil on "Q"?
Captura.png 
On the other hand, if i like to put a time of 5 seconds to TON0 (PT), this value is declared where? in variable declaration sheet? 

Sorry for my bad english.
Thanks!
Quote 0 0
thiagoralves
The usage of TON0.Q is more appropriate for Structured Text programs. Using it in ladder logic will require some "hot glue", therefore it is not recommended. The right way of doing it is creating a variable and connecting it to the Q output of the timer, exactly like what you did with TON0_Q. For the time period, you can use a variable like your TON0_PT and define its initial value (Valor Inicial) to be T#5s. This is the correct way of declaring time in IEC 61131-3. If this is a fixed time delay and won't be manipulated in your program (i.e. you won't change it from 5s to 6s during the execution of the program) you can use a static declaration instead of a variable. Just right click on the editor -> add variable, and then on the expression field you can type T#5s. This is what is called a "static variable", or in other words, a variable that never change its value. This is a good idea to keep you variables list more clean
Quote 0 0
carlospetry77
The usage of TON0.Q is more appropriate for Structured Text programs. Using it in ladder logic will require some "hot glue", therefore it is not recommended. The right way of doing it is creating a variable and connecting it to the Q output of the timer, exactly like what you did with TON0_Q. For the time period, you can use a variable like your TON0_PT and define its initial value (Valor Inicial) to be T#5s. This is the correct way of declaring time in IEC 61131-3. If this is a fixed time delay and won't be manipulated in your program (i.e. you won't change it from 5s to 6s during the execution of the program) you can use a static declaration instead of a variable. Just right click on the editor -> add variable, and then on the expression field you can type T#5s. This is what is called a "static variable", or in other words, a variable that never change its value. This is a good idea to keep you variables list more clean


Perfect! Thank you. I've more questions. Have any manual of OpenPLC editor or only reference page. In this case, can i write some explanations about blocks with examples, time diagram and definitions and next you add this to OpenPLC Editor's manual? Because, a lot of blocks and functions haven't "help menu".

In reference page, you can add the title of User Defined Function Blocks. Because, a lot of people like me, are building blocks that probably are in the forum of User Defined Function Blocks. It's matter of order.
There is an example of LOGO! Siemens:
Captura.png 
Thanks. Have a nice day!
Quote 0 0
carlospetry77
I've other question. I'm looking for IEC 61131-3 manual to declare values correctly. The ebook costs U$D 340! It's not free?
Quote 0 0
thiagoralves


Perfect! Thank you. I've more questions. Have any manual of OpenPLC editor or only reference page. In this case, can i write some explanations about blocks with examples, time diagram and definitions and next you add this to OpenPLC Editor's manual? Because, a lot of blocks and functions haven't "help menu".

This would be great. One major thing that this project lacks is documentation. If you can help by writing documentation about each block, this would be fantastic.
I've other question. I'm looking for IEC 61131-3 manual to declare values correctly. The ebook costs U$D 340! It's not free?

Yes, the standard is quite expensive. However, you don't have to buy the standard to learn about IEC 61131-3. Reading the user manual of other PLC suites compatible with IEC 61131-3 usually is enough. Beckhoff has a pretty good online help system: https://infosys.beckhoff.com/english.php?content=../content/1033/tcplccontrol/html/tcplcctrl_plc_data_types_overview.htm&id=6553024148646624664
This online manual has information for pretty much every block OpenPLC Editor has (since they are actually defined in the IEC 61131-3 standard anyway)
Quote 1 0
carlospetry77

This would be great. One major thing that this project lacks is documentation. If you can help by writing documentation about each block, this would be fantastic.

Yes, the standard is quite expensive. However, you don't have to buy the standard to learn about IEC 61131-3. Reading the user manual of other PLC suites compatible with IEC 61131-3 usually is enough. Beckhoff has a pretty good online help systemhttps://infosys.beckhoff.com/english.php?content=../content/1033/tcplccontrol/html/tcplcctrl_plc_data_types_overview.htm&id=6553024148646624664
This online manual has information for pretty much every block OpenPLC Editor has (since they are actually defined in the IEC 61131-3 standard anyway)


Perfect. Tell me about format of manual, do you have any idea in mind? If i wrote for SR function, next how upload this info? Or if you like, i can send you via email.

If you agree, i can start with Standard Function Blocks. Where i can see the internal mechanism of blocks? This help me to understand better the blocks.

Best regards. Carlos
Quote 0 0
thiagoralves
Hi Carlos, thank you for your help. I think it would be good to follow the format of the commercial PLC manuals (Beckhoff, CODESYS, etc). For instance, you can write the documentation for the SR block according to Beckhoff online manual: https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclibstandard/html/tcplclibstandard_sr.htm&id=2125413652015709846

You can find the source code (in structured text) for each block at OpenPLC Editor\matiec\lib. For example, the code for the SR and RS blocks is at OpenPLC Editor\matiec\lib\bistable.txt. However, the behavior of these blocks are well defined in the IEC 61131-3 standard, therefore you can pretty much copy the description, time diagram and examples from manuals of commercial tools as it will be exactly the same for OpenPLC.

Just send me the documentation in a text document over email (or you can even post it here in a .zip compressed file), and I can copy/paste it into the website. You will do a great favor to all new users by writing the documentation for these blocks. Thanks!
Quote 1 0
carlospetry77
Hi Carlos, thank you for your help. I think it would be good to follow the format of the commercial PLC manuals (Beckhoff, CODESYS, etc). For instance, you can write the documentation for the SR block according to Beckhoff online manual: https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclibstandard/html/tcplclibstandard_sr.htm&id=2125413652015709846

You can find the source code (in structured text) for each block at OpenPLC Editor\matiec\lib. For example, the code for the SR and RS blocks is at OpenPLC Editor\matiec\lib\bistable.txt. However, the behavior of these blocks are well defined in the IEC 61131-3 standard, therefore you can pretty much copy the description, time diagram and examples from manuals of commercial tools as it will be exactly the same for OpenPLC.

Just send me the documentation in a text document over email (or you can even post it here in a .zip compressed file), and I can copy/paste it into the website. You will do a great favor to all new users by writing the documentation for these blocks. Thanks!


No problem. This is a community. And none of us is born with knowledge. So it's good to collaborate.

Let's go step by step. 

Bye!
Quote 0 0