top of page
Search
Writer's pictureIvaylo Fiziev

Driving Conveyors


Conveyors are major building blocks of every factory. In Process Simulate we have support for them since quite long ago. Users are already familiar with defining the conveyor, creating control points etc. But how do you drive the conveyor? How do you adjust its speed and direction during simulation? In general: How do you apply certain behavior to it? Until we had SCL this was pretty impossible. Logic blocks (LBs) could be used maybe but they are limited to a single expression. And how could someone implement complex logic using a single expression? Users were really struggling with this dilemma. They end up writing very complex, unreadable expressions that cannot be debugged easily. So there is the need of something else.

The script allows you to organize your logic easily by adding different statements to your code. This makes defining behavior really easy.

For the conveyors we now have three functions in SCL:

  1. CONVEYOR_POSITION():LREAL - returns the current position of the conveyor

  2. DRIVE_CONVEYOR(POS:LREAL):VOID - moves the conveyor to its new position

  3. ENABLE_CONTROL_POINT(NAME:STRING, VALUE:BOOL):VOID - enables/disables a control point

To control the speed of the conveyor in positive direction you can use this:


DRIVE_CONVEYOR( CONVEYOR_POSITION() + #velocity * #timeStep / 1000 );


where:


#velocity - the speed in mm/sec

#timeStep - the time step in msec


To drive the conveyor in the negative direction just provide a negative velocity.

Simple stuff but quite powerful. Now you can even start/stop the conveyor based on some condition with a simple IF statement.


IF CONVEYOR_POSITION() < 1000 THEN

DRIVE_CONVEYOR( CONVEYOR_POSITION() + #velocity * #timeStep / 1000 );

END_IF;


The logic is up to you do define. As long as you can express it in the code it will work exactly as you need it to work. We developed these functions while working on the function blocks controlling drives (telegrams). They work particularly well with Telegram 1/2 since they provide the velocity that is then applied to the conveyor. A really nice match I would say.


BTW here is a simple trick for getting the time step. Just get the simulation time after the first step.


IF (#timeStep = 0) THEN

#timeStep := SIM_TIME(); // simulation time in msec

END_IF;


If you need a custom step just provide it in the script.


ENABLE_CONTROL_POINT function enables you to manipulate conveyor control points during simulation. For example: A stopper control point can be disabled temporary until a certain condition is met.

Let me know if you have any questions/suggestions.

See you!




29 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page