Table Of Contents

Find Resource (G Dataflow)

Version:
    Last Modified: March 3, 2017

    A deprecated function that queries the system to locate the devices associated with a specified interface.

    This function corresponds to the Find Resource multimode function in LabVIEW NXG.

    connector_pane_image
    datatype_icon

    expression

    The search criteria that matches with the devices available for a particular interface.

    The description string specified sets the criteria to search an interface--GPIB, GPIB-VXI, VXI, All VXI, Serial, or All--for existing devices.

    Regular Expressions and Sample Matches

    The search criteria specified in expression has two parts: a regular expression over a resource string and an optional logical expression over attribute values.

    The regular expression is matched against the resource strings of resources known to the VISA Resource Manager. If the resource string matches the regular expression, the attribute values of the resource are matched against the expression over attribute values. If the match is successful, the resource has met the search criteria and is added to the list of resources found. The following table includes valid regular expressions.

    Regular Expression Sample Matches
    GPIB?*INSTR Matches GPIB0::2::INSTR, GPIB1::1::1::INSTR, and GPIB-VXI1::8::INSTR.
    GPIB[0-9]*::?*INSTR Matches GPIB0::2::INSTR and GPIB1::1::1::INSTR but not GPIB-VXI1::8::INSTR.
    GPIB[^0]::?*INSTR Matches GPIB1::1::1::INSTR but not GPIB0::2::INSTR or GPIB12::8::INSTR.
    VXI?*INSTR Matches VXI0::1::INSTR but not GPIB-VXI0::1::INSTR
    GPIB-VXI?*INSTR Matches GPIB-VXI0::1::INSTR but not VXI0::1::INSTR.
    ?*VXI[0-9]*::?*INSTR Matches VXI0::1::INSTR and GPIB-VXI0::1::INSTR.
    ASRL[0-9]*::?*INSTR Matches ASRL1::INSTR but not VXI0::5::INSTR.
    ASRL1+::INSTR Matches ASRL1::INSTR and ASRL11::INSTR but not ASRL2::INSTR.
    {GPIB|VXI)?*INSTR Matches GPIB1::5::INSTR and VXI0::3::INSTR but not ASRL2::INSTR.
    (GPIB0|VXI0)::1::INSTR Matches GPIB0::1::INSTR and VXI0::1:INSTR.
    ?*INSTR Matches all INSTR (device) resources.
    ?*VXI[0-9]*::?*MEMACC Matches VXI0::MEMACC and GPIB-VXI1::MEMACC.
    VXI0::?* Matches VXI0::1::INSTR, VXI0::2::INSTR, and VXI0::MEMACC.
    ?* Matches all resources.
    visa://hostname/?* Matches all resources on the specified remote system. You can set the hostname as either an IP address (dot-notation) or a network machine name. This remote system does not need to be a configured remote system.
    /?* Matches all the resources on the local machine. Does not query configured remote systems.
    visa:/ASRL?*INSTR Matches all ASRL resources on the local machine and returns them in URL format, such as visa:/ASRL1::INSTR.

    Special Characters and Operators

    The following table includes valid special characters and operators.

    Special Characters and Operations Meaning
    ? Matches any one character.
    \ Makes the character that follows it an ordinary character instead of a special character. For example, when a question mark follows a backslash (\?), it matches the ? character instead of any one character.
    [list] Matches any one character from the enclosed list. You can use a hyphen to match a range of characters.
    [^list] Matches any character not in the enclosed list. You can use a hyphen to match a range of characters.
    * Matches 0 or more occurrences of the preceding character or expression.
    + Matches 1 or more occurrences of the preceding character or expression.
    Exp | exp Matches either the preceding or the following expression. The OR operator | matches the entire expression that precedes or follows it and not just the character that precedes or follows it. For example, VXI|GPIB means (VXI)|(GPIB), not VX(I|G)PIB.
    (exp) Groups characters or expressions.

    Optional Attribute Expressions

    By using the optional attribute expression, you can construct expressions with the use of logical ANDs (&&), ORs (||), and NOTs (!). You can use equal (==) and unequal (!=) comparators to compare attributes of any data type, and other inequality comparators (>, <, >=, <=) to compare attributes of numeric data type. Use only global attributes in the attribute expression. Local attributes are not allowed in the logical expression part of the expression parameter. The following table includes valid expression parameters.

    Expression Parameter Meaning
    GPIB[0-9]*::?*::?*::INSTR[VI_ATTR_GPIB_SECONDARY_ADDR > 0 && VI_ATTR_GPIB_SECONDARY_ADDR <10} Find all GPIB devices that have secondary addresses from 1 to 9.
    ASRL?*INSTR{VI_ATTR_ASRL_BAUD == 9600} Find all serial ports configured at 9600 baud.
    ?*VXI?INSTR{VI_ATTR_MANF_ID == 0xFF6 && !(VI_ATTR_VXI_LA ==0 || VI_ATTR_SLOT <= 0)} Find all VXI instrument resources having manufacturer ID FF6 and which are not logical address 0, slot 0, or external controllers.

    Default: ?*

    datatype_icon

    error in

    Error conditions that occur before this node runs.

    The node responds to this input according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    Default: No error

    datatype_icon

    search mode

    How the function returns found interfaces.

    Found interfaces are returned in find list, either by canonical names or aliases.

    Name Value Description
    Canonical Names Only 0 Search all configured buses. Returns only the resources found that match the expression string. The format of each returned string is the VISA canonical spec-defined resource format.
    Aliases Only 2 Search all configured buses. Returns only the resources found that match the expression string. For each resource, if there is a user-defined alias for that resource, that alias is returned. For the other resources, the returned string is in the VISA canonical spec-defined resource format.
    Include Matching Aliases 3 Do not search any buses. Returns only resources with user-defined aliases. The only valid expression string is ?*. The format of each returned string is an alias.
    Include All Aliases 4 Search all configured buses. Returns all found resources that match the expression string and all user-defined aliases even if they do not match the expression string. For each resource, the function returns a user-defined alias if there is one for that resource. For the other resources, the returned string is in the VISA canonical spec-defined resource format.
    datatype_icon

    found resources

    An array of strings. Each string specifies one resource found by the function.

    datatype_icon

    error out

    Error information.

    The node produces this output according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.
    datatype_icon

    return count

    The number of matches found.

    The number of matches found is the number of strings in the find list array.

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: Not supported


    Recently Viewed Topics