goner Posted February 29, 2012 Report Posted February 29, 2012 Hi, I have a application, where is 100 different products. Operator chooses the correct program from the push wheel ( http://uk.farnell.com/te-connectivity-alcoswitch/dps9131ak/switch-digital-push-wheel-bcd/dp/1701060) . PLC reads the code and activates according to the number on the push wheel a memory bit e.g. M60.0 . When the operator changes the program from the push wheel , the I need to reset the machine and reset some memories. I found a easy solution for it. I made added an OR instruction, with 100 inputs. In every input is a positive edge instruction. One for every product. So I have 100 positive edge instructions here. M60.0 - M69.7 M100.0 - M102.3 Is there a way to make this big OR instruction shorter or replace with some special function?
Crossbow Posted March 1, 2012 Report Posted March 1, 2012 If they are dialing in a number in BCD, can't you just do a compare in the program to see what number was dialed in? When you start a product, store the number to a register. Then when the number on the wheels doesn't match the stored number, do your resets and preparation for the next number and then overwrite the saved number.
Moggie Posted March 11, 2012 Report Posted March 11, 2012 (edited) You could write your own function to check for a BIT turning on - Edge evaluation, rising, word by word L MW 150 //Load old input value (edge memory bit) L MW 60 //Load input value T MW 150 //Transfer current input value into old value (edge memory bit) XOW //Link old value and input value using "EXCLUSIVE OR" L MW 60 //Load input value AW //Link result with input value using "AND" T MW 102 //Transfer result to "rising" pulse memory word L 0 <>I = M 0.1 M0.1 will be "HIGH" for one program scan every time a bit goes HIGH in the word MW 60. Just repeat the code for every MW you want to check. This was written for an S7 300; STL/IL is not supported in the 1200 but should convert easily. Use of a MD will check for 32bits at a time instead of 16bits at a time with MW Edited March 11, 2012 by Moggie
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