Sign in to follow this  
Followers 0
Marco8037

Can not use correctely the function block in Twincat

3 posts in this topic

Hello everyone. I'm learning about twincat and I am using the Twincat demo version available for 30 days. I am using the library TcUtilities and I want to make on ladder the same code that I have seen on a Help manual for this library. That code is the following one: The code that I am trying to do in ladder is the following one: Why can I not connect the TON output (TON:Q) to the START input of NTGetTime(FB)? When I insert the NTGetTime(FB), that output is automaticaly connected to the NETID input, and I cannot change that connection. Is there any way to make the right connection as the code I have seen in the Help manual? Thank you everyone.

Share this post


Link to post
Share on other sites
There are a couple of things wrong with this code. Keep in mind that ladder diagram is nice because it allows you the capability to do some of the function block diagram programming but it is limited. First, the rung is always tied to the first/top input of a FB. If the first/top input of a FB is not of type BOOL (i.e. the first input of NT_GetTime is NETID, I am assuming it is not a BOOL) something different needs to be done. Right click on the rung and click on "BOX with EN." Second, to connect something to other inputs of a FB in ladder diagram, right-click on the short little line before the input, then "Insert at Block...", then "BOX". That box comes up as an AND box by default, but you can type in (or use the Input Assistant - F2 key) TON, or any other FB. So in your case your rung would probably look something like the attached jpg. Note: the last FB in the rung is added as a "BOX with EN" and then everything else is added to the front of that, so you have to work backwards sometimes when you are doing this. In this case the F_TRIG function block was added as the "BOX with EN" and then the rest. Let me know if you need any more help. Tom

Share this post


Link to post
Share on other sites
It has helped a lot.. You are right. In the ladder programming, sometimes it is necessary to start making the network from the end to the begining. I only didn't know that it was possible to add a box and transform it on a function block. For me this is a strange way to use the ladder diagram, since I am coming from standard PLC's, like Siemens and Omron, and on that PLCs it was possible to make the connections between any inputs and outputs blocks by a simple way and starting the diagram from the begining to the end. But now, with your help, I can make the same in the TwinCat system, but by a different way. Thank you very much.. Marco Nunes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0