Logic question!:(

sutton

Lifetime Supporting Member
Join Date
Mar 2003
Location
Singapore
Posts
74
Dear all,

It’s a long time that I didn’t post PLC program question. But now I’m facing a new difficulty in solving logic problem for my new machine project. This project is quite tricky, as it require more memory functions.

The diagram below is an example of my project. I assume 4 workstations in here. On every work cycle the indexer will spin 72 degree. Each station will consist of digital laser sensor and digital probe, which is connected to the PC. So the PC will receive data on each cycle and determine whether the part inspection is Pass or Fail. The PC will give signal to the PLC then (this is done by using Delphi software).

1. When the part had finished all workstations and back to unload station, then the PLC will show all the result at the touch screen.
2. If inspection on all stations is Pass, then the tower light show green light.
3. If any inspection Fail, then the red light will blink.

I know how to work out the motion of the machine. However, I have no clue how the PLC can store the data of each station and only show it when the part is back to the unloading station.

Can anyone help me on this? Please give suggestion. Thank you!

vmi.jpg
 
I'd start with something like this:

Set aside four locations in PLC memory. Since at this point the only information is pass/fail use bits - if you wanted to record the type or nature of the fail then words would be appropriate. Next, allocate a counter and assign it a preset of five.

Now, when a new part enters the machine the PC sends a signal to the PLC to reset its counter and all of the pass/fail bits (or words). When the inspection is done at the first station the PC sends at least two signals to the PLC: 1. A signal to increment the counter. 2. The state of the pass/fail inspection. If you use indirect addressing the PLC can determine for itself in which word/bit to store the inspection data. If not using indirect addressing, the PC will send the data to a specific word allocated to store the data for a particular station. For argument's sake, let's send a 1 (one) if the part passes inspection.

When the part is returned to the load/unload station a final signal is sent to the counter input which brings it to its preset of five. The DONE state of the counter enables a rung which tests the state of all four of the inspection results. These are in series so that all must be OK for the green light to come on. If the counter is done and any one of the inspection results is NOT good, the logic to flash the yellow beacon is enabled.

Since the inspection result of each station is recorded, its state can also be presented on the HMI with some sort of indicator.

The part is unloaded and the cycle repeats.
 
This application is similar to mulderm's product tracking question. It would be worthwhile to read through THAT THREAD, especially from ndzied1's post (post #5) on. If you only care about pass/fail, you can use a bit shift. If you want to keep track of specific data, then a word shift is better suited to the task. The word contains the inspection data for each part, and this word moves (shifts) around from station to station with the part.

beerchug

-Eric

P.S. The drawing REALLY helped explain your project!... (y)
 
A very classic flexible and easy-to-use program could be based on a bit shift as follows, shifted when the motion controller is used. Allows several parts to be simultaneously present on the machine.

Example of register's length (as needed) :
- 24 bits for each station (result zone),
- 24 bits for each interval and for the unload station.

A result code is serialized on the shift register, and built, loaded or modified by each station. Each station can write bits, digits or a complete word. This allows for example the station 3 to react according to checker's results from station 1.

Decide how many multi-checkers results have to be stored at each station. Methods for data storage : 1) basically write bits in digits (one digit per station is simple). 2) write digit combinations. 3) choose a numeric value for each checker's function and use add/substract methods to calculate and load the shift register. More results : add bits to the register's length or (sometimes easier) use the same method with two, three, four... parallel serial-coded shift registers.

Decode your bits/digits/words... when values come to the unload station.The HMI and lights programs only read this final zone and only react when a part has finished the cycle.

Hope this helps.

Laurent
 
how to do the BSL??

thanks guys for your reply.

Doug_P, i can understood how to work out the program the way you told me. However, it's not only one part that go in the indexer from load to unload sequence. One cycle is 72 degree spin. on the next cycle, the new part will come in so the memory will be used as the previous part.

Eric and Laurent. Thanks for telling me to use shift register. however, i dont have any idea how to use it and how to work out the BSL function. i did read through the previous thread posted by ndzied1. But i'm using Mitsubitshi PLC, which is different from the AB PLC. I couldn't find the BSL block as the way they discussed. is there anyway i could get any reference? is there any example that i can learn how to work it out?

i'll try to learn it fast. please advise. thank you!
 
Help is just a click away?

Try looking here. Mitsubishi has all the data for your particular plc and you should be able to download all that you need. Or, try your local Mitsubishi rep and get him/her involved in helping you. I believe you have been give some really good starting points here on this thread, however, your ability to interpret and implement them may take some time. It is not easy to start out with plcs trying to program fairly involved sequences. I feel for your circumstance, but that is the way most opportunities have come to us in this field. I have worked on jobs over the years that I sometimes thought were out of my league. But, perseverance is the key. Working through some of the suggestions from here on your end will help you develop and then you can also come back with a "hey I tried this and found that..." All of us want to help you succeed.
 
Bit shifting is ok only if you have to deal with one bit of information (such as good/bad or present/missing for example). It is not suitable for more compex tasks so you might consider alternatives. I was working on indexing tables and conveyors where certain operation is done on each station. I needed to keep track on number of features that parts might have, status of each operation etc. Not big deal, I simply used words instead of bits. If you need more memory, use group of words (or even whole file if needed). As the parts index, move the information with it so that each station has full checklist for part that is processed. If you are using Delphi, all you have t do is create datatype (or record) for one part (or station of the table). Reset it when it is in starting position and fill it in as job is done. When table is indexed, just move the content of one record into next one (you will have five of them).
This is just an idea, hope it helps.
 
No FIFO function available on FX0N

Thanks randylud and panic mode,

your advises are worth for me to remember. thanks really. I'm always practise it until i manage to develope my own skills.

I did get a good mitsubitshi manual and learnt how to use FIFO and BSR functions. I was able to get some clues how to solve it using FIFO function. however, i was stuck eventually as the PLC i am using is FX0N series. That mean i couldn't use the FIFO function which is not available on FX0N.

so right now i tried to use Bit Shifting function. I have yet to get the right sequence but i promise i'll come back to show you guys the way i tried.

meanwhile if FIFO function is avoid here, will i still be able to solve it? or is there any other alternatives that i can try?

thank a real lot.
 
Not using Delphi too.

oh yea, just to let you guys know that Delphi software which is carried by my colleage. she wasn't able to develope the function i'm looking for so i must do it with PLC. There is a Delphi software provided by the supplier when we bought all the Digital sensors and probes. so my colleage is only to modify the program. So it's all down to me to solve the logic problem i;m currently facing.

I'll give a big try to solve this. thanks.
 
You can write you own FIFO by using SFTL instruction for example.
If one bit is not enough try to use words like in this example.
Words D30-D35 are used as FIFO. D30 is input and D35 is output. To change the length of the table simply use different value instead of K5 (see BMOV instruction). If you use K14, FIFO output would be word D44 (30+14=44).

Hope this helps

fifo.jpg
 
Last edited:
My solution to this problem is similar to Doug_P solution. But instead of using just 1 memory location, 4 memories location are needed. These 4 locations are station1, station2, station3 and station4. These memory locations are word. For simplicity, let say these words are 8 bits. When a part arrives at station1, bit 1 or 0 is shifted into word1(station1). For argument's sake, let say it is a 1 (picture 1) . When the next part come, the previous part is shifted into bit 1 of word 1. The new part is shifted in to bit 0 of word2(station2). Again, let say that it is a 0 (picture 2).

bits
7 6 5 4 3 2 1 0
station1(word1) 1 <=======picture 1
station2(word2)
station3(word3)
station4(word4)


bits
7 6 5 4 3 2 1 0
station1(word1) 1 0 <=======picture 1
station2(word2) 1
station3(word3)
station4(word4)

For the rest of the parts that will come in, assume that they all pass (1). When the first bit that is shifted into word1 is at bit #4(one cycle has completed), the first part that come into station1 has hit the load/unload station. The picture would look like picture 3.

bits
7 6 5 4 3 2 1 0
station1(word1) 1 0 1 1 1 <=======picture 1
station2(word2) 1 0 1 1
station3(word3) 1 0 1
station4(word4) 1 0

What now left to do is to check bit 4 of word1, bit 3 of word 2, bit 2 of word3 and bit 1 of word4. So when do we know to scan these bits? Of course this will be scanned every rotation except for the first cycle. For the first cycle, you only scan it when the part hit the load and unload station.

Like Doug_P suggested, use some kind of counter. Also use shift register to shift bits.
 
For some reason, the picture that i drew did not appear the way I want it. Sorry everyone for the confusion. And also, they are suppose to be picture 1, picture 2 and picture 3.
 
still trying....

Thanks bunny and panic mode,

Bunny, i still learning your technique. I'm not sure if i got the right notion of how you solve it. I drew a picture here, would you please tell me if it is right?

I tried to use the STFL function to shift bit from D0 to D4 for every cycle scan. But that function is not available to be used for shifting data. the Source and Destination is used for X, Y and M.
In this case, how could i shift the K1 from D0 to D1 then eventually to D4? :(

Panic mode, i tried to simulate the BMOV function in the LLT as the way you thought me. But why it is not the same with FIFO function? or did i do it wrongly?

I'll keep trying and come back later. Cheers guys.

vmi.jpg
 
Well FIFO stands for "first in - First out".
It doesn't matter that size of the data we
are talkin about this simply indicates sequence
of data manipulation.

If the data you want to rotate is simply on single
bit, you can use bit shift instruction. bit0 is
your first postion (rotary table or whatever you
want to apply it to). Once the table is indexed
you shift the data register so the bit follows
the part. One bit is not much of information.
It can describe only two states - 0 or 1.
When applied to process this could mean
part present or part missing. Or you can use it
to indicate that operation was succesfull or not etc.
Good example was tracking bottles on the line.
Obviously, this cannot be used to indicate a value
such as weight or length or quantity such as:
"bin on station_A contains 23 bolts".
Once you get to situation more than one bit is required
you can make FIFO to move word (16-bit) of information,
or group of words making a recipe for example etc.
If all you need is bit, your FIFO can still use words.
Just decide which bit in the word you want.

For example you can use bit0. That would make bit D30.0
input and D35.0 an output of your little 5-stage FIFO.
You might want to use bit6 for example - not a problem
simply use D30.6 and D35.6 (the same bit for other
stations will be D31.6, D32.6, D32.6 etc.)

When you trigger shifting, the content of data register
is moved:
from D34 to D35,
from D33 to D34,
from D32 to D33,
from D31 to D32,
from D30 to D31.

So if you are using say bit6 for example you would insert
value into D30.6 and wehn indexing occurs this bit is moved
to D31.6 and next time to D32.6 etc.
This is of course not very efficient but it works.
As said, if one bit of information is all you need
you should rather take a look at bit shifting
instructions.
 

Similar Topics

Good morning crew! Ok my logic works but I am missing something. When the start button is pushed it should like the red light for 4sec then shut...
Replies
13
Views
351
Hey. I am new to PLCs and LogixPro. A friend and I have been trying to build this diagram and instructions using LogixPro500. Could anyone help us...
Replies
15
Views
1,188
A question was proposed to me at work after a programmer complained about '=' being both a comparative operator and also an assignment operator...
Replies
16
Views
3,864
We've got a sump pump which is switched on/off at the HMI by clicking a button on the screen then a physical pushbutton on a console, using this...
Replies
50
Views
12,076
The attached files shows a rung modified by the Migration Tool. Can anyone explain the purpose of the added parallel branch? I figure it has to do...
Replies
3
Views
1,735
Back
Top Bottom