SELECT real-valued function SELECT real-valued function Syntax SELECT (device_type, mode) Function Return the unit number that is currently selected by the current task for the device named. Parameters device_type Keyword that identifies the type of device that is to be selected. The only valid type is ROBOT. The device-type keyword can be abbreviated. mode Optional real value, variable, or expression (interpreted as an integer) that specifies the mode for the function. If this parameter is omitted or has the value 0, the function returns the number of the unit currently selected, or 0 if no unit is selected.
If mode has the value -1, the function returns the total number of units available for the specified device. Details This function returns either the number of the specified device that is currently selected, or the total number of devices connected to the system controller. Multiple devices of the same type are supported only if your system includes the optional eV+ Extensions software. If the eV+ system is not configured to control a robot, the selected robot is always #1, and the total number of robots is zero. SELECT(ROBOT) returns the number of the currently selected robot. SELECT(ROBOT,-1) returns the maximum robot number in a eV+ system.
Examples Return the unit number of the robot selected for the current task: our.robot = SELECT(ROBOT) Return the total number of robots connected to the controller: num.robots = SELECT(ROBOT,-1) Related Keywords SELECT monitor command eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 459