top of page
Search
Writer's pictureIvaylo Fiziev

Material Flow


Materials are used in every production line. These are goods of any kind needed to make the final product. It is also important to deliver them in the right moment in time so the line does not stop waiting for them. If materials are delivered too fast the line will be clogged. At the end proper material flow guarantees better cycle times.

So one of the key aspects of virtual commissioning is how you introduce parts in your simulation. Removing parts from the scene is also important in the virtual environment. In Process Simulate the approach is to use part appearances. e.g. a part is used like a blue print in order to create multiple instances of it. Each instance is known as a 'part appearance' and is used in a specific use-case (conveyor, gripper etc.). These objects are temporary (they live during simulation only) and are usually destroyed on simulation reset.

Process Simulate is already famous for its complex material flow. Especially when it comes to part arrays (palletizing). So the effort is to reduce the complexity when working with part appearances.

You may call me boring but here we again leverage the SCL interpreter. The material flow use case seems like the perfect automation scenario. We just need to enable it in the script. How? A couple of functions were introduced lately.

  1. CREATE_PART_APPEARANCE(PART:STRING, LOC:"ABS_LOC"):VOID

  2. DELETE_PART_APPEARANCE(PART:STRING, LOC:"ABS_LOC", RANGE:LREAL):VOID

NAME - the part name. a part with this name should exist in the study.

LOC - the absolute location (relative to the working frame) where the part appearance will be created. If missing the absolute location of the underlying resource will be used.

RANGE - the radius of a sphere (mm) around the absolute location. any part within the range will be deleted


That is all fine but how do I know the part name? Here we have a gap in the design of the application. Parts are not visible in line simulation mode. Scripts and signals on the other hand are primarily available in this mode ?!? Why is this you may ask? Well … it is a legacy that we need to live with … To get the part name you have two options:

a) switch to standard mode where parts are listed in the object tree and copy the name from there - this might be expensive depending on the study size

b) generate appearances for the line operation and find the one that you need in the object tree - here you cannot copy the name. shit!

So this is a pain I admit.

Let's assume you've got the name somehow. Then a possible script might look like this:


FUNCTION_BLOCK "MAIN"
VERSION:1.0
VAR_INPUT
partName : STRING := 'Part1'; // The name of the origin part
clk : BOOL; // The clock signal
deg : INT := 90; // angle around the Z axis
END_VAR
VAR
trigger : R_TRIG; // Positive edge trigger
END_VAR
VAR_TEMP
newLoc : "ABS_LOC";
END_VAR
BEGIN
#trigger(CLK:=#clk);
if #trigger.Q then
OFFSET_ABS_LOC(
RZ:=DEG_TO_RAD(#deg),
OUT=>#newLoc);
CREATE_PART_APPEARANCE(
PART:=#partName,
LOC:=#newLoc);
end_if;
END_FUNCTION_BLOCK

In v2307 we added one more function (OFFSET_ABS_LOC) that allows for relocating the part appearance relative to the absolute location of the underlying resource. This is useful when creating arrays of appearances or simply changing the orientation. The function allows for doing offsets by X,Y,Z as well as rotations around the X,Y,Z of the original location.

If you need an array of part appearances simply call the functions in a loop.


for #i := 0 to 5 do
OFFSET_ABS_LOC(
Y:=#i * 200, // offset by Y from the location of the resource
OUT=>#newLoc);
CREATE_PART_APPEARANCE(
PART:=#partName,
LOC:=#newLoc);
end_for;

Now you know how to automate your material flow without complex modeling in Process Simulate. You can even reuse the script for other similar use-cases by introducing input parameters for the offsets/rotations.

Nice!


22 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page