Skip to content

NI DIGITAL PATTERN DRIVER Static IO Functions

ShantanuShinde edited this page May 24, 2021 · 2 revisions

Static IO Functions

niDigital_ReadStatic

Reads the current state of comparators for pins you specify in the channelList parameter. If there are uncommitted changes to levels or the termination mode, this function commits the changes to the pins.

C Function Prototype: ViStatus niDigital_ReadStatic (ViSession vi, ViConstString channelList, ViInt32 bufferSize, ViUInt8[] data, viInt32* actualNumRead)

Parameter Description
vi The specified instrument session the niDigital_init or niDigital_InitWithOptions function returns.
channelList

List of channel names or list of pins. Do not pass a mix of channel names and pin names. An empty string denotes all digital pattern instrument channels.

Pin names and pin groups apply to all enabled sites, unless the pin name explicitly specifies the site. You can specify a pin in a specific site using the form siteN/pinName, where N is the site number. This function ignores pins that are not mapped to the digital pattern instrument.

Specify channel names using the form PXI1Slot3/0,2-3 or PXI1Slot3/0,PXI1Slot3/2-3, where PXI1Slot3 is the instrument resource name and 0, 2, 3 are channel names. To specify channels from multiple instruments, use the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3. The instruments must be in the same chassis.

bufferSize The number of elements in the ViUInt8 array you specify for data. To determine the size of the buffer to allocate for the data array, pass a value of 0 to the bufferSize parameter and a value of VI_NULL to the data parameter. In this case, the value returned by the actualNumRead parameter is the size of the array necessary to hold the data.
Output
data

The returned array of pin states read from the channels in the channelList. Data is returned in the order you specify in the channelList. If a site is disabled, the function does not return data for that site. If you are using a list of pin names to read data from multiple instruments, use the niDigital_SortPinResultsBySiteViUInt8 function to order and combine the data to match the channelList. You can also use the niDigital_GetResultsPinMapInformation function to obtain a sorted list of returned sites and channels.

- NIDIGITAL_VAL_L (3): The comparators read a logic low pin state.

- NIDIGITAL_VAL_H (4): The comparators read a logic high pin state.

- NIDIGITAL_VAL_M (6): The comparators read a midband pin state.

- NIDIGITAL_VAL_V (7): The comparators read a value that is above VOH and below VOL, which can occur when you set VOL higher than VOH.

actualNumRead The number of values written to the data array.

Return value: Reports the status of the operation.

niDigital_WriteStatic

Writes a static state to the specified pins. The selected pins remain in the specified state until the next pattern burst or call to this function. If there are uncommitted changes to levels or the termination mode, this function commits the changes to the pins.

This function does not change the selected pin function. If you write a static state to a pin that does not have the Digital function selected, the new static state is stored by the instrument, and affects the state of the pin the next time you change the selected function to Digital.

C Function Prototype: ViStatus niDigital_WriteStatic (ViSession vi, ViConstString channelList, ViUInt8 state)

Parameter Description
vi The specified instrument session the niDigital_init or niDigital_InitWithOptions function returns.
channelList

List of channel names or list of pins. Do not pass a mix of channel names and pin names. An empty string denotes all digital pattern instrument channels.

Pin names and pin groups apply to all enabled sites, unless the pin name explicitly specifies the site. You can specify a pin in a specific site using the form siteN/pinName, where N is the site number. This function ignores pins that are not mapped to the digital pattern instrument.

Specify channel names using the form PXI1Slot3/0,2-3 or PXI1Slot3/0,PXI1Slot3/2-3, where PXI1Slot3 is the instrument resource name and 0, 2, 3 are channel names. To specify channels from multiple instruments, use the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3. The instruments must be in the same chassis.

state

Parameter that specifies one of the following digital states to assign to the pin.

- NIDIGITAL_VAL_0 (0): Specifies to drive low.

- NIDIGITAL_VAL_1 (1): Specifies to drive high.

- NIDIGITAL_VAL_X (5): Specifies to not drive.

Return value: Reports the status of the operation.

Table of Contents

Internal Development

Creating and Setting Up a gRPC Server

Server Security Support

Creating a gRPC Client

gRPC Client Examples

Session Utilities API Reference

Driver Documentation

gRPC API Differences From C API

Sharing Driver Sessions Between Clients

C API Docs
NI-DAQmx
NI-DCPOWER
NI-DIGITAL PATTERN DRIVER
NI-DMM
NI-FGEN
NI-FPGA
NI-RFmx Bluetooth
NI-RFmx NR
NI-RFmx WCDMA
NI-RFmx GSM
NI-RFmx CDMA2k
NI-RFmx Instr
NI-RFmx LTE
NI-RFmx SpecAn
NI-RFmx TD-SCDMA
NI-RFmx WLAN
NI-RFSA
NI-RFSG
NI-SCOPE
NI-SWITCH
NI-TCLK
NI-XNET
Clone this wiki locally