ct8356 Posted November 21, 2014 Report Posted November 21, 2014 I created a timer inside a function block, as you would inside a normal section. (I gave it number 0001 and put a #20 inside). I then created a contact inside the function block, typing in t1 (which usually works in a normal section), however, in the FB it does not recognise it (the contact label remains red). What do I need to do to make it work? I am using the CJ2M controller.
Michael Walsh Posted November 21, 2014 Report Posted November 21, 2014 You have to create a timer variable with a name. You have to do this for every memory address inside a function block. Just like you cannot use D0 directly inside a MOV instruction inside a function block (You would have to create a variable name and then use AT functionality to do so). Then use the name for the timer number and the timer contacts, like this: 1
P23 Posted April 8, 2021 Report Posted April 8, 2021 Hello @Michael Walsh.. I am trying to put a timer inside function block and I have attached the code with this post. I don't think the program is scanning or going into the FB when I simulate. I tried google to check for the AT functionality that you mentioned, but no luck. Can you pls help? Regards, P23
Michael Walsh Posted April 12, 2021 Report Posted April 12, 2021 Looking at your code, your coffee_stop bit will only turn off for 1 scan. It will then immediately turn back on and the timer will start timing again. The problem is not the timer in side the FB, but the code as written.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now