FreeRollerConveyor: CreateBlockage
Called to set a blockage on the free roller conveyor at the specified distance from the beginning of the free roller conveyor with an optionally specified handle. The handle returned is the blockage handle to reference this blockage. If a handle was specified it will be the same handle returned.
By calling CreateBlockage with the same handle the blockage can be moved to a new distance.
Using a Product object as the blockage handle can be used to create a blockage linked to a product.
Function
blockageHandle CreateBlockage(distance: double, blockagehandle: integer)
Parameters
Name | Type | Description |
---|---|---|
distance | Double | The distance of the blockage from the beginning of the free roller conveyor in the units chosen when the project was created (metres or feet) |
blockagehandle | Integer | Optional. If not specified, returns a new handle otherwise returns the handle specified |
Return Value
a blockage handle, will be used to remove the blockage.
Example
var oBlockConv;
var oConv = GetComponentByNameAndType("FreeRollerConveyor1", "Free Roller Conveyor");
function OnSimulationStart() {
LogDebug("OnSimulationStart called");
oBlockConv = oConv.CreateBlockage(1);
SetTimerEx(1234, 5000, "ClearBlockage", null);
MoveProduct(CreateProduct(), "Conveyor1", 0);
}
function ClearBlockage(timerid, object) {
LogDebug("Products=" + oConv.ProductCount );
oConv.RemoveBlockage(oBlockConv);
}