PESensor: OnProductBlocking

Invoked when the sensor ‘Blocked’ property value changes to true

Note: This event does not support multiple subscription. Previous subscription will be lost if subscribe twice.

Event

void xxxxxxxxxxxxxxxxx (sender: object, product: Product);

Parameters

Name Type Description
sender Object The object associated with the changed property
product Product The blocking product item

Example

function OnSimulationStart() {
    LogDebug("OnSimulationStart called");
    SubscribeToEvent("OnProductBlocking", "PESensor1", "PE Sensor", handleproduct);
}

function handleproduct(sender, product) {
    LogDebug("handleproduct:");
    MoveProduct(product, "Conveyor2", 0.3);
}