Sign in to follow this  
Followers 0
tipex

High-speed counter Interrupts ON CP1H

4 posts in this topic

In an attempt to learn using interrupts I'm trying to use an interrupt for position a conventional induction motor connected to a linear axis. The motor is controlled by a V7 frequency converter with profibus connectivity. After reading som docs on the comparison table and making interrupt execution from the value of the High Speed Counter I tried to make a small program to test with. As far as I can understand I need to make an position table and load it with CTBL. The docs states this instruction is only avaliable with CPU21/22/23, but CX-programmer should give me a warning if this is not compatible with CP1H, just like it does if i set the PLC to CPU11? So, I've made my self a table using MOV that looks like this; D100 = #0001; D101 = #1000; D102 = #0000; D103 = #0010; Load the table with CTBL #0 #0 D100 and sets a value for the High Speed Counter input using INI #10 #2 D10 where D10 contains #1000/999/1001 after I change it. Then I have a program which is set as Task Type: Interrupt Task 10 and it sets an output. But when I simulate this the run count for the interrupt never increases and the output never changes(using differential monitor). Is it my approach that is plain wrong or is it not possible to simulate it like this? interrupt.zip

Share this post


Link to post
Share on other sites
I'm most likely way of with the Counter. Tried som other experiments with just read//write/IO-simulation and it does not count or anything. Something smell like fubar.

Share this post


Link to post
Share on other sites
Does the high speed counter value change? If not Have you enabled the counter in the settings? Do you have the correct type of count for you input device (diff. phase, Up/down, etc)? Have the settings been sent to the PLC? Does the interrupt run when called manually using "TKON &8010"? Use "TKOF &8010" to stop it. I verify that interrupts are running by using "P_On" and "++(wordX)". WordX will increment each time the interrupt is cycled through.

Share this post


Link to post
Share on other sites
After some testing I conclude with that I can't simulate the high-speed counter the way I attempted. Probably just have to wait until I get the physical PLC before I can check if my approach is correct :/ Edited by tipex

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