Writing my own batchsystem in wincc flex 2007

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
I have 3 parameters for a product:
Diameter
Lengte
Hoek (corner)

all reals...


I need some batching system with a batchlist.

Something like this:

On the batchscreen:

1.- Enter the parameters Diameter, Lengte and Hoek
2.- Enter a number of products that are needed

Then there have to be buttons like:

NEW
SEND TO LIST
DELETE FROM LIST
EXECUTE

There is also a batchnumber view, batchnumber generated by the PLC when hitting NEW.

So, when they click NEW, a new batch will be made. With send to list, they send the batch number with it's parameter to a batchlist.

They must have the possibillity to see a list on the panel.

They have to execute each batch locally on the machine from the batchlist.

After a batch is finished, it must be deleted from the list automatically.

Anyone who can help with this, I don't really know how to begin,

in wincc flex I have everything ready, maybe some screenshots if needed...
 
This is just to get you started. I would do something like this.

Create a UDT "recipe" with the required recipe data.
Then create a DB with for example these fields:
DB "batch"
..EDIT = UDT recipe // this is a scratchpad for the operator to edit
..ACTIVE = UDT recipe // this is the one that is running at a given time
..REPORT = UDT recipe // for writing the result in a CSV file via a script for example
..LIST = ARRAY[1..50] OF recipe. 50 is just an example.

In SCL you write blocks to

..Copy from EDIT to LIST. The batch number is automatically generated (Just increment a DINT, and let it run 0->1->..->99999999->0-1>..). If you must put the entry at the start, the end, or somewhere else is up to you.

..Copy from LIST to ACTIVE. How you decide which one to pick from the list is up to you. Remember to clear the LIST entry.

..Copy from ACTIVE to REPORT. In WinCC Flex you monitor the batch number of REPORT. When the value changes you start a function to archive the tags or start a script that logs the values to a CSV file.

You also have to decide what to do if a batch is interrupted halfways through the sequence.
 
hmmm

I'm trying to understand it.

The UDT contains the recipe parameters + batch info

In the DB I use the same UDT 3 times, EDIT, ACTIVE and REPORT.

I understand this right ?

The List thing is something I don't understand... This has to be an array of the UDT ?? Can this be done ? And there the data should be controlled with FIFO then ?

How can I show the batchlist in WInCC Flexible ?

What do you mean by a batch that can be interruped ? Can you give an example please


Thanks for the support Jesper


JesperMP said:
This is just to get you started. I would do something like this.

Create a UDT "recipe" with the required recipe data.
Then create a DB with for example these fields:
DB "batch"
..EDIT = UDT recipe // this is a scratchpad for the operator to edit
..ACTIVE = UDT recipe // this is the one that is running at a given time
..REPORT = UDT recipe // for writing the result in a CSV file via a script for example
..LIST = ARRAY[1..50] OF recipe. 50 is just an example.

In SCL you write blocks to

..Copy from EDIT to LIST. The batch number is automatically generated (Just increment a DINT, and let it run 0->1->..->99999999->0-1>..). If you must put the entry at the start, the end, or somewhere else is up to you.

..Copy from LIST to ACTIVE. How you decide which one to pick from the list is up to you. Remember to clear the LIST entry.

..Copy from ACTIVE to REPORT. In WinCC Flex you monitor the batch number of REPORT. When the value changes you start a function to archive the tags or start a script that logs the values to a CSV file.

You also have to decide what to do if a batch is interrupted halfways through the sequence.
 
Hi Combo,

Doing this in WinCCFlexible would be a challenge! I have done what you describe but in RSView32 using VB to manage the order list (many man hours of coding not even mine). I'd be tempted to do everything in the PLC and only use the HMI as a window into the data.

My advice is to keep the data management separate from the batch processing side of things.

UDTs are the key, make a UDT that contains your data requirements for each batch: batch ID, Lenght, Diameter, Hoek, Quantity. Make a datablock containing as many copies of the UDT as you want in your order list +1 for editing.

You then need to write a function that manipulated the data with actions such as Save New Record and Delete Record indexed by record number. Once you have this working you can add Insert Record and Move Record.

From the WinCCFlex end of things you'd need a table showing maybe 5 entries with I/O boxes linked to multiplex tags so that you can scroll up and down the data.

I'm out most of the day tomorrow but I'll try to have a look at your code tomorrow evening.

Nick
 
hey,

well, the recipe system is not needed anymore. A recipe is something like this:

25.3000.30

It's a productnumber that they have to enter. The decimal points are text objects in wincc flexible, the 3 numbers are the parameters coming from the product number.

In this example:

25 = productnumber

3000 = Length

30 = corner


So the recipes are not needed anymore. This idea comes from my boss. This way I don't need the recipe system of wincc flexible.


I can follow what you mean in the rest of what you wrote. I'm gonna try to assamble something in the way you are telling.

The most difficult thing to do (that I think), is to show the batchlist, is todo fifo in an array of 50 UDT's, and some stuff around this.

I'll try something out, and place the code here if I have something, then you can check it too.

Thanks for your help !!




Manglemender said:
Hi Combo,

Doing this in WinCCFlexible would be a challenge! I have done what you describe but in RSView32 using VB to manage the order list (many man hours of coding not even mine). I'd be tempted to do everything in the PLC and only use the HMI as a window into the data.

My advice is to keep the data management separate from the batch processing side of things.

UDTs are the key, make a UDT that contains your data requirements for each batch: batch ID, Lenght, Diameter, Hoek, Quantity. Make a datablock containing as many copies of the UDT as you want in your order list +1 for editing.

You then need to write a function that manipulated the data with actions such as Save New Record and Delete Record indexed by record number. Once you have this working you can add Insert Record and Move Record.

From the WinCCFlex end of things you'd need a table showing maybe 5 entries with I/O boxes linked to multiplex tags so that you can scroll up and down the data.

I'm out most of the day tomorrow but I'll try to have a look at your code tomorrow evening.

Nick
 
Step further

Okay, I'm a step further, check the attachement.

So, I made 1 UDT containing the recipedata and the batchdata.

When making a new batch in winccflex, then we enter tags in DB3 (BATCH BUILD).

When we hit Confirmbutton, the Builded batch is veriefiëd for empty fields. The Batchnumber was generated by the PLC. When we hit the confirmbutton and everything is okay, then the batch is send to the Batchlist (DB2 = BATCH_LIST).

The operator has to activate the batches, when DB1 is empty (all values zero) then he can activate the first one in the list. When activating, the first UDT data is send out of DB2 to DB1 (BATCH_ACTIVE). This data is used todo the run. The quantity (aantal) is checked continouesly and stops the machine when it is reached.

I donno how to do the fifo thing in the DB2 (Batch_List) with UDT's. I don't know how to show a list in Flexible..., and other things are still confusing to me, but you guys help a lot, thanks !!!


I have time until friday, then it have to work because we have to show it to the customer.
 
Combo,

Attached is an updated copy of the program that you posted. I've added FC86 fcBatchMan to handle adding new batches to the end of your order list and fetching the next batch from the top of the list.

I've made a new DB (DB4) for the order list with a slightly different structure to your own. I'm sure there are others here abouts that could help you out with arrays in SCL but it isn't a language I know.

FC86 is written in LAD/STL but it seems logical that there must be a much neater solution for array handling in a loop using SCL anyone care to post an example?

I've tested the code in the simulater and it seems to work OK but I only tested it with 4 batches because it's bed time.

I'm away now for a couple of days so good luck! I'll try to log on on Tuesday evening to see how things are progressing.

Nick
 
heyhey

Thanks for you help !!!

I'll try it out...

I was trying in SCL allready.

But if it works in STL, why not :)

Thanks,

I'll test it...


Manglemender said:
Combo,

Attached is an updated copy of the program that you posted. I've added FC86 fcBatchMan to handle adding new batches to the end of your order list and fetching the next batch from the top of the list.

I've made a new DB (DB4) for the order list with a slightly different structure to your own. I'm sure there are others here abouts that could help you out with arrays in SCL but it isn't a language I know.

FC86 is written in LAD/STL but it seems logical that there must be a much neater solution for array handling in a loop using SCL anyone care to post an example?

I've tested the code in the simulater and it seems to work OK but I only tested it with 4 batches because it's bed time.

I'm away now for a couple of days so good luck! I'll try to log on on Tuesday evening to see how things are progressing.

Nick
 

Similar Topics

I'm thinking of writing my own PID instruction for an AB PLC, because I'm constantly annoyed by how much I have to "help" the inbuilt PID...
Replies
55
Views
31,248
Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
5
Views
298
Hello all, I'm currently working on a servo motor linear positioning system (ball screw). I'm all set up regarding communication between my HMI...
Replies
1
Views
112
Hello All: I have a Windows 10 PC running a FTView ME Station 10.00. I have a .mer file version 6.00. It has been running well on it for a long...
Replies
1
Views
181
My R55 Ingersollrand is tripping on motor overload and im falling to see the trip history it is writing Acquarring texts
Replies
0
Views
141
Back
Top Bottom