Simple PC – PLC Communications Part II – A Case Study for Product Traceability

. Saturday, November 1, 2008

In our previous post we examined a simple application structure for basic PC – PLC communication.

In this post, we are going to focus on 'evaluate' part of the algorithm.

It is better to focus on evaluation in a case study, assume that we have three consecutive stations in an assembly line as follows:

Assume that each station is driven by distinct motors. We are going to study on Station Y.

If we are studying on a case, we need a scenario. Assume that we have an operator, say 'Mike', on assembly line.

Mike is working on Station Y and he is responsible for checking if boxes are good or not. He has two push buttons, one red and one green. He presses green button for good boxes and presses red for defected. Boxes come from Station X, and left Station Y towards Station Z after Mike's decision.

We also have a barcode reader on Station Y which is directly connected to PLC. A bar code reader connected to a PC requires a little trick that we are going to discuss later.

With Mike and other components, our system should seem as:

Now our goal is collecting information from boxes and matching them with their quality status.

Finally, we want a data table in our PC as follows:

Date Time Barcode Data Station Quality Status
10.10.2008 16:18:30 8463952819456 Station Y OK
10.10.2008 16:19:02 8392753021983 Station Y NOK
... ... ... ...

We can derive several reports with this data, we can use pivot charts to see summary, or we can develop a web page to present our data, it is not in this scope of this post.

When we think over scenario we see that events should happen step by step:

  • A new box arrives on Station Y

  • Barcode reader scans the barcode (Assuming that it never fails)

  • Mike pushes a button

  • Data is recorded

  • Box leaves Station Y and moves to Station X

Following informations can be supplied by PLC:

  • Product presence on station

  • Scanned barcode data

  • Which button is pushed

PC can only supply one information:

  • Confirmation of record created successfully.

We need to exchange information between PC and PLC and we must do it with a handshake protocol.

This handshake protocol is not the one used for PC – PLC communication. For example, it is not FINS protocol of Omron or it is not Modbus protocol.

We are already reading a part of PLC data memory and filling another part continuously with an endless loop, I mean we need a safe method to manage information carried by physical PC – PLC communication.

Following diagram is a sample protocol that can be used for our case:

Information exchange done in four steps.

Our next post we will continue on the same case study.

We are going to discuss:

  • What happens in T1, T2, T3 and T4 intervals ?

  • How can we organise internal structure of evaluation algorithm ?

  • Few tips about design

See you in next post!


Post a Comment


Search This Blog


About Me

My photo
Automation engineer especially working on PC software development. Formerly I was coding on PLC, but now I am using mostly Visual Basic on PC.