ShoeSorter: OnEncoderReached

Invoked when the transport encoder reaches the value which is set when subscribed.

Note: This event does not support multiple subscription. Previous subscriptions must be unsubscribed before new subscriptions are added.

Event

void xxxxxxxxxxxxxxxxx(sender: object, encoder_value: UInt32);

Parameters

Name Type Description
sender transport The transport which is running the encoder
encoder_value UInt32 The value of the encoder reached in millimeter for metric(metres) and inches for imperial(feet) units

Example

Subscribe to “OnEncoderReached” event callback exposed by the component with the value in millimeter for metric(metres) and inches for imperial(feet) units.

Below event will be triggered when encoder value reaches to 1000 (millimeter or inches depends on the project units)

Note: The DistanceTravelled property only updates at interval set by the user in System Properties. It is possible that when this callback is invoked the DistanceTravelled property value is not same as the value given to the callback.

SubscribeToEvent("OnEncoderReached", "ShoeSorter1", "Shoe Sorter", OnEncoderReached, 1000);
...
function OnEncoderReached(sender,value)
{
	LogDebug("Callback is called at encoder value : "+value)
}