From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform streaming and waveform scripting - Mutually exclusive?

Solved!
Go to solution
Hello All,
 
I was looking at doing some tricks with the streaming capabilities of the new PXIe-5442 plus NI RAID extension. Is there a way to script multiple waveforms together if the total sample size exceeds the hardware capacity of the AWG (in other words can one of the waveforms be stremed to the memory) ?
 
If not are there any scripting or sequence "type" abilities that allows multiple waveforms be stored off board and let each waveform be hardware triggered (load, wait for ext trig, run waveform1, loop through first/last eight samples, wait ext trig, run waveform2, etc..)?
 
The looping functionalities are less of an issue with what is essentially a 1TB AWG but the triggering still poses a problem.
 
CVI examples are preferred but any example that shows the hardware feasibility exist should point me in the right direction.
 
Note: In a perfect world, I would to see a scripting solution that would allow different our experiment types to be more easily executed within the same project.
 
Thanks in advance.
 
0 Kudos
Message 1 of 5
(8,724 Views)
Solution
Accepted by topic author blakney
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
0 Kudos
Message 2 of 5
(8,713 Views)

Hello,

 

I have a smiliar request. Can you please attach your LabVIEW code?

 

Thank you,

Vimal Fernandez || Applications Engineer  || National Instruments || (512)683-1781 || Vimal.Fernandez@ni.com 

Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(7,375 Views)

Hi Kalyanramu,

 

Can you post your code that shows how this can be accomplished in LabVIEW?

 

Regards,

 

Jason L.

Product Support Engineer
National Instruments
0 Kudos
Message 4 of 5
(6,977 Views)

If you are looking for this example, I have created and uploaded one here:

 

https://decibel.ni.com/content/docs/DOC-28275

 

Regards,

 

Jason L

Product Support Engineer
National Instruments
0 Kudos
Message 5 of 5
(6,921 Views)