V+ Language Reference Guide, v17.x


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. Valid device types are ROBOT, VISION, and FORCE (which must be specified without quotation marks). 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 V+ Extensions software.

If the V+ 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 V+ system. SELECT(VISION) returns the number of the currently selected vision system. SELECT(FORCE) returns the number of the currently selected force sensor.

A particular FORCE sensor is associated with one VFI (VME Force Interface), which in turn has a number associated with it through the system configuration. With the default configuration, FORCE sensor number 1 corresponds to the VFI configured as servo board number 8.

SELECT VISION

In a system with multiple vision systems, this instruction selects the vision system with which the current task is to communicate. (The SELECT monitor command specifies which vision system the V+ monitor is to access.) This program instruction specifies which vision system receives vision instructions (for example, ENABLE VISION) and also which system returns vision-related information (for example, from the VSTATUS function).

Vision system #1 is automatically selected each time a program begins execution.

You can use the following modes for a SELECT(VISION,mode) function.

Mode Description
-1 Returns the maximum possible vision system number.
0 Returns the number of the currently selected vision system or zero.
n > 0 Returns TRUE if vision system n is present. Otherwise, the value FALSE is returned.

Examples

Return the unit number of the robot selected for the current task:

our.robot = SELECT(ROBOT) 	

Return the unit number of the force sensor selected for the current task:

our.force = SELECT(FORCE)	

Return the total number of robots connected to the controller:

num.robots = SELECT(ROBOT,-1)	

Return the total number of vision systems installed in the controller:

num.vision = SELECT(VISION,-1)	

Related Keywords

SELECT monitor command

SELECT program instruction


Submit comments to: techpubs@adept.com
Last modified on: 3/27/2012
Copyright © 1994 - 2012. Adept Technology, Inc.