NI DIGITAL PATTERN DRIVER Pin Control Functions - ni/grpc-device GitHub Wiki

Pin Control Functions

niDigital_SelectFunction

Specifies whether digital pattern instrument channels are controlled by the PPMU, Digital, disconnected, or off. Changes take effect immediately.

Channels disconnect when a new instrument session is created if the reset input parameter is VI_TRUE. The niDigital_BurstPattern function automatically changes the function to Digital for the pins in the pattern if the selectDigitalFunction parameter is set to VI_TRUE. The niDigital_PPMU_Source function always changes the function to PPMU for the pins in the channelList automatically.

C Function Prototype: ViStatus niDigital_SelectFunction (ViSession vi, ViConstString channelList, ViInt32 function)

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.

function

Parameter that specifies whether to disconnect the pins, or use the PPMU or pin driver to control the pins.

- NIDIGITAL_VAL_DIGITAL (1100): The pin is connected to the driver, comparator, and active load functions. The PPMU is not sourcing, but can make voltage measurements. The state of the digital pin driver when you change the selected function to Digital is determined by the most recent call to the niDigital_WriteStatic function or the last vector of the most recently executed pattern burst, whichever happened last.

Use the niDigital_WriteStatic function to control the state of the digital pin driver through software. Use the niDigital_BurstPattern function to control the state of the digital pin driver through a pattern. Set the selectDigitalFunction parameter of the niDigital_BurstPattern function to VI_TRUE to automatically switch the selected function of the pins in the pattern burst to NIDIGITAL_VAL_DIGITAL.

- NIDIGITAL_VAL_PPMU (1101): The pin is connected to the PPMU. The driver, comparator, and active load are off while this function is selected.

Call the niDigital_PPMU_Source function to source a voltage or current. The niDigital_PPMU_Source function automatically switches the selected function to the PPMU state and starts sourcing from the PPMU. Changing the selected function to NIDIGITAL_VAL_DISCONNECT, NIDIGITAL_VAL_OFF, or NIDIGITAL_VAL_DIGITAL causes the PPMU to stop sourcing.

If you change the selected function to PPMU using the niDigital_SelectFunction function, the PPMU is initially not sourcing.

- NIDIGITAL_VAL_OFF (1102): The pin is electrically connected, and the PPMU and digital pin driver are off while this function is selected.

- NIDIGITAL_VAL_DISCONNECT (1103): The pin is electrically disconnected from instrument functions. Selecting this function causes the PPMU to stop sourcing prior to disconnecting the pin.

Note   You can make PPMU voltage measurements using the niDigital_PPMU_Measure function from within any selected function.

Caution   In the Disconnect state, some I/O protection and sensing circuitry remains exposed. Do not subject the instrument to voltage beyond its operating range.

Return value: Reports the status of the operation.

⚠️ **GitHub.com Fallback** ⚠️