NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
blakney
Posts: 94
0 Kudos
Accepted Solution

Waveform streaming and waveform scripting - Mutually exclusive?

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.
 
Member
kalyanramuv
Posts: 117
0 Kudos

Re: Waveform streaming and waveform scripting - Mutually exclusive?

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
Member
Vimal_F
Posts: 75
0 Kudos

Re: Waveform streaming and waveform scripting - Mutually exclusive?

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
Member
Jason_L1
Posts: 109
0 Kudos

Re: Waveform streaming and waveform scripting - Mutually exclusive?

[ Edited ]

Hi Kalyanramu,

 

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

 

Regards,

 

Jason L.

Applications Engineer
National Instruments
Member
Jason_L1
Posts: 109
0 Kudos

Re: Waveform streaming and waveform scripting - Mutually exclusive?

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

Applications Engineer
National Instruments
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page