Scoping Rules for NI-USRP

Attributes, which are typically called properties in LabVIEW, serve as a base for parameters. NI-USRP contains high-level VIs that set most of the instrument properties. Some properties are not accessible through the high-level VIs. The values for these properties must be set using the niUSRP Property Node.

Accessing Properties

In LabVIEW, you can find properties in the niUSRP Property Node. To access them, complete the following steps:

  1. Open a block diagram.
  2. Navigate to the NI-USRP palette at Instrument I/O » Instrument Drivers » NI-USRP, and then drag the niUSRP Property Node icon to the block diagram.
  3. Left-click the niUSRP Property Node, and select the property you want to use.
  4. To add properties, resize the niUSRP Property Node.

Properties Apply to a Session, Device, or Channel

NI-USRP properties can be applied to the session, device, or channel. When a property is applied to the session, you can set only a single value for this property, and that value applies to all devices in the session. When a property is applied to the channel or device, there may be multiple values for the property (one for each separate channel or device).

When you set a property, use the Active Channel property in the niUSRP Property Node to specify the device or channel to which the value applies. When you pass NULL or the empty string ("") for this parameter, and the property applies to multiple channels or devices, NI-USRP attempts to set the value on all valid channels or devices.

Session

Session properties contain a single value that pertains to the entire driver session.

Valid Device Specifiers: ""

Example Properties: Current Driver Version, Triggering attributes, Host Data Type, Sample Width, Warning Policy

Channel

A channel represents a single Rx or Tx channel.

Valid Channel Specifiers: "0", "1"

Example Properties: IQ Rate, Carrier Frequency, Gain, Active Antenna

Device

Device properties can contain different values, each of which applies to a specific device in the session.

Valid Port Specifiers: "dev0", "dev1"

Example Properties: Reference Frequency Source, Timebase Clock Source, Model

Setting Properties and Attributes Before Reading Them

You modify properties and attributes when you set them or when you call a configuration VI or function that sets them. Set the properties or attributes or call any configuration VIs or functions before reading back any property or attribute values for the following reasons:

  • The driver coerces the read values depending on the current session configuration. If you read a property or attribute value and then set other properties or attributes, the value read may no longer be valid.
  • The driver verifies that the device configuration is valid when the property or attribute is read. You may receive an error when reading a property or attribute if the configuration is not valid at that point, even when a setting later could make it valid.
  • The driver verifies the current configuration when it reads a property or attribute. If you change any of the settings later, those driver must revalidate those settings.