NI DIGITAL PATTERN DRIVER Source Memory Functions - ni/grpc-device GitHub Wiki

Source Memory Functions

niDigital_CreateSourceWaveformParallel

Sets the source waveform settings required for parallel sourcing. Settings apply across all sites if multiple sites are configured in the pin map. You cannot reconfigure settings after waveforms are created.

C Function Prototype: ViStatus niDigital_CreateSourceWaveformParallel (ViSession vi, ViConstString pinList, ViconstString waveformName, ViInt32 dataMapping)

Parameter Description
vi The specified instrument session the niDigital_init or niDigital_InitWithOptions function returns.
pinList Source pins for the waveform. The pinList must match the source pins in the pattern that references the waveform. The pin order in the pinList determines the bit positions of the data written by the niDigital_WriteSourceWaveform function.
waveformName The name to assign to the waveform. Use the waveformName with source_start opcode in your pattern.
dataMapping

Parameter that specifies how to map data on multiple sites.

- NIDIGITAL_VAL_BROADCAST (2600): Broadcasts the waveform you specify to all sites.

- NIDIGITAL_VAL_SITE_UNIQUE (2601): Sources unique waveform data to each site.

Return value: Reports the status of the operation.

niDigital_CreateSourceWaveformSerial

Sets the source waveform settings required for serial sourcing. Settings apply across all sites if multiple sites are configured in the pin map. You cannot reconfigure settings after waveforms are created.

C Function Prototype: ViStatus niDigital_CreateSourceWaveformSerial (ViSession vi, ViConstString pinList, ViConstString waveformName, ViInt32 dataMapping, ViUInt32 sampleWidth, ViInt32 bitOrder)

Parameter Description
vi The specified instrument session the niDigital_init or niDigital_InitWithOptions function returns.
pinList Source pins for the waveform. The pinList must match the source pins in the pattern that references the waveform. The pin order in the pinList determines the bit positions of the data written by the niDigital_WriteSourceWaveform function.
waveformName The name to assign to the waveform. Use the waveformName with source_start opcode in your pattern.
dataMapping

Parameter that specifies how to map data on multiple sites.

- NIDIGITAL_VAL_BROADCAST (2600): Broadcasts the waveform you specify to all sites.

- NIDIGITAL_VAL_SITE_UNIQUE (2601): Sources unique waveform data to each site.

sampleWidth Width in bits of each serial sample. Valid values are between 1 and 32.
bitOrder

Order in which to shift the bits.

- NIDIGITAL_VAL_MSB_FIRST (2500): Specifies the bit order by most significant bit first.

- NIDIGITAL_VAL_LSB_FIRST (2501): Specifies the bit order by least significant bit first.

Return value: Reports the status of the operation.

niDigital_CreateSourceWaveformFromFileTDMS

Creates a source waveform with configuration information from a TDMS file generated by the Digital Pattern Editor. It also optionally writes waveform data from the file.

C Function Prototype: ViStatus niDigital_CreateSourceWaveformFromFileTDMS (ViSession vi, ViConstString waveformName, ViConstString waveformFilePath, ViBoolean writeWaveformData)

Parameter Description
vi The specified instrument session the niDigital_init or niDigital_InitWithOptions function returns.
waveformName The waveform name you want to use from the file. You must specify waveformName if the file contains multiple waveforms. Use the waveformName with the source_start opcode in your pattern.
waveformFilePath Absolute file path to the load source waveform file (.tdms).
writeWaveformData A Boolean that writes waveform data to source memory if True and the waveform data is in the file.

Return value: Reports the status of the operation.

niDigital_WriteSourceWaveformBroadcastU32

Writes the same waveform data to all sites. Use this write function if you set the dataMapping parameter of the create source waveform function to Broadcast.

C Function Prototype: ViStatus niDigital_WriteSourceWaveformBroadcastU32 (ViSession vi, ViConstString waveformName, ViInt32 waveformSize, ViUInt32[] waveformData)

Parameter Description
vi The specified instrument session the niDigital_init or niDigital_InitWithOptions function returns.
waveformName The name to assign to the waveform. Use the waveformName with source_start opcode in your pattern.
waveformSize Size of the data array.
waveformData 1D array of samples to use as source data to apply to all sites.

Return value: Reports the status of the operation.

niDigital_WriteSourceWaveformSiteUniqueU32

Writes one waveform per site. Use this write function if you set the parameter of the create source waveform function to Site Unique.

C Function Prototype: ViStatus niDigital_WriteSourceWaveformSiteUniqueU32 (ViSession vi, ViConstString siteList, ViConstString waveformName, ViInt32 numWaveforms, ViInt32 samplesPerWaveform, ViUInt32[] waveformData)

Parameter Description
vi The specified instrument session the niDigital_init or niDigital_InitWithOptions function returns.
siteList Site numbers listed as a comma-delimited list of strings of form siteN, where N is the site number.
waveformName The name to assign to the waveform. Use the waveformName with source_start opcode in your pattern.
numWaveforms Number of waveforms.
samplesPerWaveform Number of samples per waveform.
waveformData An array of samples to use as source data. Data for each site must be appended sequentially in the array (non-interleaved).

Return value: Reports the status of the operation.

niDigital_WriteSourceWaveformDataFromFileTDMS

Writes a source waveform based on the waveform data and configuration information the file contains.

C Function Prototype: ViStatus niDigital_WriteSourceWaveformDataFromFileTDMS (ViSession vi, ViConstString waveformName, ViConstString waveformFilePath)

Parameter Description
vi The specified instrument session the niDigital_init or niDigital_InitWithOptions function returns.
waveformName The name to assign to the waveform. Use the waveformName with source_start opcode in your pattern.
waveformFilePath Absolute file path to the load source waveform file (.tdms).

Return value: Reports the status of the operation.

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