Hi,
You can do Waveform Streaming and Scripting in the same session.
To Stream to a waveform in script, you would need the streaming waveform name.
An example scenario is where you want to configure your board for 3 different waveforms (WfmA, WfmB and Streaming Waveform).
You can download WfmA and WfmB using "niFGEN Write Named Waveforms" and name the waveforms accordingly.
e.g., niFgen_WriteNamedWaveformI16 (vi, "0", wfmA, numPoints, wfmData)); /**Notice that these names will be used in script******/
We cannot assign name directly to a streaming waveform, however we can get information from the driver about the name it set to the streaming waveform.
Streaming Waveform:
1) Allocate Streaming Memory using niFgen_AllocateWaveform function
2) Pass the "Waveform Handle" output of niFgen_AllocateWaveform function to "niFGEN Streaming Handle" attribute
e.g.,
checkErr(niFgen_AllocateWaveform(vi, VI_NULL, streamingWaveformSize, &wfmHandle));
checkErr(niFgen_SetAttributeViInt32(vi, VI_NULL, NIFGEN_ATTR_STREAMING_WAVEFORM_HANDLE,
streamingwfmHandle));
3) Fill the Streaming Memory Buffer with data using niFgen_WriteBinary16Waveform and Streaming Waveform Handle
4) Then read the attribute "Streaming Waveform Name". You can use this name now in script.
niFgen_GetAttributeViString (vi, "0", NIFGEN_ATTR_STREAMING_WAVEFORM_NAME, 512, streamingwfmname);
To generate these sequence of waveforms, a sample script would be:
script myscript
generate wfmA
generate wfmB
repeat <repeat count>
generate <streamingwfmname>
end repeat
5) Download the script using niFgen_WriteScript function
6) After you start the generation, inside a while loop continuously monitor the "Space Available in Streaming Wfm" and transfer the data using "niFgen_WriteBinary16Waveform and Streaming Waveform Handle.
I have a sample application in LabVIEW, I can post it if it would help. Let me know if I am not clear on anything....
Thanks,
Kalyan
Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments