Sign in to follow this  
Followers 0
BoVice

how can i clear entire words?

4 posts in this topic

hello everyone, first ill give u an idea of what im doing. i have an increment instruction (590) used with the 1 sec clock pulse. when the incrementer reachs a certain value i want it to clear the data in the word addressed to it. im unsure what instruction to use, at first i thought i could use a reset, but from what i can tell, you can only reset one bit of the word....just had a brain fart as i was typing this, would resetting every bit simultaniously of the word i want to clear work?...any help would be appreciated

Share this post


Link to post
Share on other sites
Have a look at the MOV(21) instruction. It will move a value in the defined register. Use @MOV to only execute it once (one scan) on the rising edge of the execution condition. If you want to clear the register move 0. I guess you use a compare instruction to check the incrementer value? Use the equal flag to fire the @MOV and it will set the incrementer to 0 once it equals the compare operand. Hope this helps!

Share this post


Link to post
Share on other sites
Just be sure to us a constant indicator in front of the 0. For instance, use the MOV function to move a #0 (BCD/Hex) or an &0 (Decimal) into the desired word address. In this case # and & insert the same value as 0 is 0 whether it is HEX or Decimal. If you just do a MOV 0 into an address, it will move the value in Channel 0 (CIO area on newer PLCs) into the desired word addres. Many times this confuses programmers. If you have an older PLC, #0 will be your only option. Good luck!

Share this post


Link to post
Share on other sites
Thanks Michael for pointing out the non-obvious that I sometimes take as obvious

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