MWD Posted December 11, 2017 Report Share Posted December 11, 2017 Hi, I’m chasing my tail. With a ladder, what is the most efficient logic to log a single table row with the state of 6 inputs and write a row with a 0 or 1 transition of any single input? Can you point me to a sample that may help? I know I need to set a flag but am having trouble getting it correct. Thanks Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted December 12, 2017 MVP 2023 Report Share Posted December 12, 2017 I'm guessing you're using the Data Tables Write Row function block. Do you have a program you can post? Joe T. Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted December 12, 2017 MVP 2023 Report Share Posted December 12, 2017 If you don't have a program for Joe's ask..... To me it looks like you are trying to find the way of triggering a write each time there is a change. 1 Set up a count that has 1 added to it with each input that is on. No need to use rising pulses as we will reset this count every scan. 2 After the scan has gone past all the inputs that change, compare the count to the previous scan's count, which has been moved into a "storage" MI at the start of the scan. 3 If the count is different then you have had a change somewhere so there is your trigger. 4 At the start of the next scan, first move the count to the "storage" MI, then reset it to 0. The accumulation and compare process then proceeds each scan. If you are trying to track inputs that are changing rapidly, you will fill your table very quickly! cheers, Aus Link to comment Share on other sites More sharing options...
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