Sign in to follow this  
Followers 0
MickeyBob

Refresh I/O In Interrupt

1 post in this topic

I need help figuring out how best to update I/O from a timed interrupt on a CJ1M-CPU21. I have an application where the majority of the time the interrupt is disabled. It is enabled when the value on an analog input exceeds a threshold and is disabled again when the input exceeds a second threshold. I want to refresh the same input value used to enable the interrupt from within the interrupt with the IORF(097) instruction. However, when I enable the interrupt, I immediately get the "Interrupt Task Error Flag" which, according to the Instruction Reference Manual (W340-E3-04), indicates that "IORF(097) was executed in an interrupt task without disabling Special I/O cyclic refreshing." The manual goes on to further say "If cyclic refreshing with the Special I/O Unit isn’t disabled, IORF(097) might be executed during cyclic refreshing resulting in a non-fatal Duplicate Refresh Error and turning ON the Interrupt Task Error Flag (A40213)" I suppose I could disable normal (i.e., cyclic) updating of the input from the setting dialog in CX-Programmer but this would make the input value unavailable when the timed interrupt is disabled. I don't want the interrupt enabled all the time because of the processing overhead. To overcome this problem, I could institute another interrupt that is enabled all the time and it only updates the input. Is this the right way to do this? What are the alternatives? According to the manual, the error is non-fatal. Does this mean the I/O update collision occurred but it didn't really harm/affect the input value? When the error occurs, the error LED on the CPU is turned on and it remains on. Is there a way to reset the error flag in code? Assuming the collision doesn't really mess up the input value, is there a way to "mask" the error? I'll appreciate any insight you guys can provide. Thanks, MickeyBob

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