Control (sensor)

Syntax

<Path>.Sensors.id<Number>.Control:method
<Path>.sensorNo(<Number>).Control:method

The attribute Control designates a Method object, the sensor Control, which the sensor of the object designated by <Path> activates. A value, which you assign, has to be the reference to a Method (object) or the name of the Method.

As soon as the sensor calls this Method, it passes the Sensor-ID as optional parameter. When the Method expects an integer parameter, the sensor passes the Sensor ID to the Method; if you do not enter an integer parameter, the Method will be called without a parameter.

The second optional parameter of data type boolean shows the user if the front or the rear of the part triggers the control.

Data Type of the Value You Can Assign

You can assign a value of data type method.

Example

MyTrack.Sensors.id2.Control := &mySensorControl
MyTrack.Sensors.id2.Control := "mySensorControl"

Example

param triggeredSensorID: integer, Front: boolean, BookPosition: boolean
if Front 
/*¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
       the sensor was triggered by the front of the MU
_________________________________________________________________________*/

else
/*¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
       the sensor was triggered by the rear of the MU
_________________________________________________________________________*/

end
-- Apply the destination selected in the drop-down list
-- named/labeled 'SelectDestination/Dedicated Destination'.
var l: list
SelectDestination.getItems(l)

if DestinationActive.Value -- destination is active
    -- set new destination of the part
    @.Destination := l[SelectDestination.Value]
end
.MUs.Transporter:1.LoadBayType := "Track"
.MUs.Transporter:1.createSensor(1,"Length","self.OnSensor",true,false)
Note:

Creating and manipulating sensors via SimTalk for the Transporter only works if you select the loading space Types Track or Line!

Related Topics

Sensors

Control

sensorID

sensorNo