Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming Mitsubishi A Series

Status
Not open for further replies.

BobCully

Industrial
Feb 23, 2002
6
On a standard(ish) processing machine that we produce, I have several (maybe 20) sequence programs running simultaneously. To step through each sequence I arrange a group of flags into a shift register- 8,12 or 16 bits long.
The first flag in the group (the lowest) is forced on when the sequence begins, and that flag controls that `Step' in the sequence. When that step finishes I give a SFL K1 instruction (shift left 1 position), which turns that step flag off and the next one on. It works fine.
Sometimes however things don't go as planned, and a switch (or something else) doesn't make and the sequence stalls. What I need is and indicator to tell me which step of the sequences is on at any time, and what I'm looking for is an elegant way to return a number corresponding to the position in the sequence of the `on' flag - just as a (step) number. For example, `M251 K2' defines a set of (K)2x4 flags starting at M251, M251 being the first bit and M258 being the 8th. I want a function that will hold in say register D250 the value 1 to 8 depending on which flag is set. I eventually want to have a page on the MMI to report the status of all these Sequences. I haven't been able to figure a way out of how to do it `in the back-ground' while the sequence is running. All I've been able to come up with is to include a line in each step of the sequence to say `INC D250', and then zero it at the end of the sequence, but its a bit messy.
Has anybody any thoughts?, do other PLC's have a neat command for doing this (and how does it work)? (but I'm not going to change!).
Regards
 
Replies continue below

Recommended for you

Not being familliar with Mitsubishi PLC's here is one way of doing it is:
Bit 1 is true it moves a 1 into the register
Bit 2 is true it moves a 2 into the same register
Etc. Etc.
Then if all bits are false move a 0 into it.
Then all you have to do is just display the value of that register. I am sure that someone with more knowledge on your plc will be of more help. Good luck.
 
Thanks for your reply Steve, and I'm sorry to have taken so long to respond. I've only just read it, and at first I thought it would be a very long winded way to do the job (but of course it will work). However, after a few minutes to allow the idea to sink in, I am sure I should be able to rig up a loop just to step through the no. of steps in that sequence.
Thanks again,
Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor