NI-HSDIO C Function Reference

niHSDIO_WriteScript

  • Updated2023-02-21
  • 1 minute(s) read

ViStatus = niHSDIO_WriteScript ( ViSession vi, ViConstString script);

Purpose

Writes a string to the onboard memory containing scripts that govern the waveform generation. If this function is called repeatedly, previously written scripts with unique names remain loaded. Previously written scripts with identical names to those being written are replaced.

If multiple scripts load when the niHSDIO_Initiate function is called, then one of the scripts must be designated as the script to generate by setting the NIHSDIO_ATTR_SCRIPT_TO_GENERATE attribute to the desired script name. If only one script exists in memory, then you do not need to designate the script to generate. All waveforms referenced in the scripts must be written before the script is written.

An error is returned if the script uses incorrect syntax. This function calls the niHSDIO_CommitDynamic function. All pending attributes are committed to hardware.

Related topics:

Parameters

Input
Name Type Description
vi ViSession Identifies your instrument session. vi was obtained from the niHSDIO_InitAcquisitionSession or niHSDIO_InitGenerationSession function.
Script ViConstString Specifies a string containing a syntactically correct script.

Return Value

Name Type Description
Status ViStatus

Reports the status of this operation. To obtain a text description of the status code, call the niHSDIO_error_message function. To obtain additional information concerning the error condition, use the niHSDIO_GetError and niHSDIO_ClearError functions.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors