Sign in to follow this  
Followers 0
Guest baden

Comparison table

12 posts in this topic

I have been trying to program a cpm2a with no luck.  I am trying to make the register comparison table to work with my high speed counter but have not found out how to make it work.  I have tried everything that I can think of. I am using a range comparison and only using two subroutines(0 and 1).  I have put FFFF in the last six subroutine places.  I have tried to automatically start it with the CTBL command and the INI command.  I have made sure that the lower limit does not exceed the upper limit.  I have verified the encoder is sending pulses by use of the PRV command.   Along with the comparison table I have been using the add and subtract BCD command to put into my comparison table.  Will this affect the comparison table? If so, can I get around this still using the add and subtract command? Along with all of this my Z phase will not automatically reset the PV and I have been using the software reset.  I have made sure DM6642 is in accordance to all this.  0100 for zphase and software reset and 0110 for just software reset. If you need more information please ask.  Thank you for reading and your time. God Bless, Will Baden

Share this post


Link to post
Share on other sites
When you choose a setting of 0100, you must use the combination of the Z-phase and the software reset.  Therefore you need to turn on bit 25200 all the time for the Z-phase to work all the time.    

Share this post


Link to post
Share on other sites
Thanks Jay.  You helped out a lot.  I will being using your info and will report back when I have tried them. God Bless, Will Baden

Share this post


Link to post
Share on other sites
Ok I have done what you suggested jay.  I do not have the ctbl command on all the time.  But I can only use it once when I find my z phase and home it out.   I guess I should tell you what I am doing.  I am writing a program for an indexer and need to rotate to the 0, 90, 180, and 270 degree positions.  So I am using the comparison table to "feel" my way into it.  At 10 degrees from position(if I am going to 90 it would be 80) I shut off my rapid air solenoid.  At 2 degrees from position (88 degrees) I shut off my creep and extend a shot pin to lock it in position. I am using the range comparison for fear that the target comparison will not be caught in time for the shot pin alignment.   I am integrating this system into a cnc mill.  The mill has eight external m codes that go high when they are selected in the mills program.  They stay high until it receives an m-finish signal.  So I use those m codes to keep my ctbl function high for the duration of the indexing process.  But I have not been able to use it for this function. I have though made it work for my homing process.  In this process I tell the indexer to rotate ccw until the z-phase is high.  Then to get off of the z-phase (since I get an error when it stays on the z-phase and there is a ctbl function) in the cw direction.  Then I call my comparison table to go to 0 degrees and set the lock pin. If you have any suggestions on different ways to do it I am all ears. Thanks again! God Bless, Will Baden

Share this post


Link to post
Share on other sites
Go back to basics and confirm that you know how the CTBL function works.  Use the program in the manual (it works.) and start changing one thing at a time.  What you are trying to do has been done many times.  Also examine what you have in your subroutines.  Put an INC instruction in both subroutines to verify they are being triggered.  Also, since you have four positions and a slow down and stop subroutine, why not build all eight subroutines rather than using add and subtract? I am enclosing the section of the manual with the example program. Pages_from_W353_E1_2._CPM1A_CPM2A_CPM2C_SRM1_Opera

Share this post


Link to post
Share on other sites
Hey jay I can't seem to download the file.  Can you help me out here?  Where else can I go to get this file? Thanks God Bless Will Baden

Share this post


Link to post
Share on other sites
Jay, I think we found another bug. The file name of your PDF was too long. I see the PDF on the server, but the link gets chopped off. Here is a direct link for that same PDF: http://www.mrplc.com/....ion.pdf OR CLICK HERE FOR DIRECT DOWNLOAD Thanks, Chako

Share this post


Link to post
Share on other sites
I have been working on the program most of the day.  I am having troubles with the comparison table itself now.  I want to have the bits that go high within the subroutine to shut off after one scan time.  This will make sure that I can move the next time.  I would also like to know why when I re register my ctbl command with new values in the table, the values do not actually change in the command itself.    Therefore I can not move to my second position since the values have been met.  I have tried to reset AR11 bits to shut off my comparison results and still come up with nothing.  I verify that it is shut off with my prv command.  I think what I am having trouble with is scan time versus interrupt time.  I would like a little help with this. Thanks again, God Bless, Will Baden

Share this post


Link to post
Share on other sites
What happened to the idea of having four separate sets of slowdown and stop setpoints rather than doing the math and moving the new setpoints?   If all else fails, throw out the concept of CTBL and go to using CMPL aginst the counter value.  Since you got a slowdown setpoint, I bet it would be as accurate.  

Share this post


Link to post
Share on other sites
Thanks for replying.  With the latching thing I can not understand.  My understanding of the ctbl range function is that when it is within the range it will call the subroutine accordingly.  But that is not the case.  It is as if the subroutine lasts for one scan and then does not continue. But all the while the range comparison is still met.  I have gotten past most of this today so far.  I have used the set adn reset with great results.  And also I am doing what you suggested about using four different tables.  This is working wonders.  It is starting to work now.  But with one big problem.  I can home out and find the 0 degree value fine.  Both my conditions were met and I verified that by the prv command.  I then send out an ini to stop my comparison.  Following that I send an m code to index to say 90 degrees.  I am rotating towards ninety and my first condition is met but once the first is met my comparison table is shut off.  So my second condition (the stop condition) is never met.  But it does not stop here.  Just out of curiosity I throw the SAME m code back in and everything works fine.  Both conditions are met and my comparison table is shut off via my ini.  I have searched the program for anything that might shut off my comparison but come to nothing. Once again I am drawing a blank.  You have helped me out a lot and I would like to thank you for putting up with my elementary education on plcs and my horrible explanations of what I am trying to do.  Thanks. God Bless, Will Baden

Share this post


Link to post
Share on other sites
That's what this forum is for.

Share this post


Link to post
Share on other sites
Jay with your help I have gotten the indexer to work.  And through my first project as a plc programmer I have found one big downside to picking up plc programming.  The new programmer has the tendency to rush things since he/she thinks it is a fairly simple concept.  They fail to read the instructions thoroughly and decipher themselves.  Thank you for putting up with my ignorant questions and failing to read the obvious.  I will take this experience and learn from it. Thank you and take care. God Bless, Will Baden

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