<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Streaming large data using PCI-5421 using MATLAB in Signal Generators</title>
    <link>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2565277#M2575</link>
    <description>&lt;P&gt;Yes, I am using the 8Mb version and I can increase the number of samples being sent to the card at once....&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2013 19:25:35 GMT</pubDate>
    <dc:creator>Shommo</dc:creator>
    <dc:date>2013-09-18T19:25:35Z</dc:date>
    <item>
      <title>Streaming large data using PCI-5421 using MATLAB</title>
      <link>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2564095#M2573</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am trying to stream a large array of data using the &lt;STRONG&gt;PCI-5421&lt;/STRONG&gt; function generator using &lt;STRONG&gt;MATLAB. &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I keep getting an error saying I am not writing fast enough to the streaming waveform...i should reduce sampling frequency or write more frequently.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;Here is how the flow of the code looks.&lt;/P&gt;
&lt;P&gt;*******************************************************************************&lt;/P&gt;
&lt;P&gt;% Assume 'signal_data' as a big array say of length 80000000 samples or more&lt;BR /&gt;%sampling frequency of this array is 10 MHz.&lt;BR /&gt;ChannelName='0';&lt;BR /&gt;&lt;BR /&gt;%configure the output mode to download waveforms in order user specify&lt;BR /&gt;invoke(ictObj.Configuration,'configureoutputmode', 2); &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;%to single trigger mode&lt;BR /&gt;invoke(ictObj.Configurationfunctionstriggeringandsynchronization,'configuretriggermode','0',1);&lt;BR /&gt;&lt;BR /&gt;%to clear arbitrary waveform memory&lt;BR /&gt;invoke(ictObj.Configurationfunctionsarbitrarysequenceoutput,'cleararbmemory');&lt;BR /&gt;&lt;BR /&gt;%to allocate onboard memory&lt;BR /&gt;stream_arb = invoke(ictObj.Configurationfunctionsincrementalwaveformwrite, 'allocatewaveform','0', 20000);&lt;BR /&gt;&lt;BR /&gt;attributeaccessors = get(ictObj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute');&lt;BR /&gt;RepCapIdentifier&amp;nbsp; = get(ictObj, 'RepCapIdentifier');&lt;BR /&gt;RepCapIdentifier = [double(RepCapIdentifier) 0];&lt;BR /&gt;&lt;BR /&gt;%setting streaming attribute handle&lt;BR /&gt;invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150324 ,stream_arb);&lt;BR /&gt;&lt;BR /&gt;%writing waveform data to onboard memory&lt;BR /&gt;invoke(ictObj.Configurationfunctionsincrementalwaveformwrite,'writewaveform','0',stream_arb,20000,signal_data);&lt;BR /&gt;&lt;BR /&gt;invoke(ictObj.Configurationfunctionsarbitrarysequenceoutput,'createarbsequence',1,stream_arb,1);&lt;BR /&gt;&lt;BR /&gt;invoke(ictObj.Waveformcontrol,'initiategeneration');&lt;BR /&gt;%enable output&lt;BR /&gt;Enabled=1;&lt;BR /&gt;invoke(ictObj.Configuration,'configureoutputenabled',ChannelName,Enabled);&lt;BR /&gt;&lt;BR /&gt;for i = 1: length(signal_data)/20000 %dividing into so many iterations&lt;BR /&gt;&amp;nbsp; invoke(ictObj.Configurationfunctionsincrementalwaveformwrite,'writewaveform','0',stream_arb,b,x);&lt;BR /&gt;&amp;nbsp; invoke(ictObj.Configurationfunctionsarbitrarysequenceoutput,'createarbsequence',1,stream_arb,1);&lt;BR /&gt;end&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;********************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;Any suggestion is welcome. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2013 00:40:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2564095#M2573</guid>
      <dc:creator>Shommo</dc:creator>
      <dc:date>2013-09-18T00:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Streaming large data using PCI-5421 using MATLAB</title>
      <link>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2564977#M2574</link>
      <description>&lt;P&gt;At minimum the 5421 has 8 mb of memory on the card. I'm not sure about your code but is there a way to change the number of samples you are sending to the card? Can you up the amount of samples you are sending at one time?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2013 15:53:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2564977#M2574</guid>
      <dc:creator>Carl_W</dc:creator>
      <dc:date>2013-09-18T15:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Streaming large data using PCI-5421 using MATLAB</title>
      <link>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2565277#M2575</link>
      <description>&lt;P&gt;Yes, I am using the 8Mb version and I can increase the number of samples being sent to the card at once....&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2013 19:25:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2565277#M2575</guid>
      <dc:creator>Shommo</dc:creator>
      <dc:date>2013-09-18T19:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Streaming large data using PCI-5421 using MATLAB</title>
      <link>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2565689#M2577</link>
      <description>&lt;P&gt;Hi Carl,&lt;/P&gt;
&lt;P&gt;So if I keep changing the sampling rate or size of data being written, i either get the error i mentioned before or i get 'memory not free trying to write too fast'.....Dont seem to find a balance between the two..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestion is welcome&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shommo&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 05:59:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2565689#M2577</guid>
      <dc:creator>Shommo</dc:creator>
      <dc:date>2013-09-19T05:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Streaming large data using PCI-5421 using MATLAB</title>
      <link>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2566131#M2578</link>
      <description>&lt;P&gt;Streaming data to the 5421 is a little tricky.&lt;/P&gt;
&lt;P&gt;On one hand, you need to keep up.&lt;/P&gt;
&lt;P&gt;On the other hand, you need to make sure you don't overflow (overwrite a piece of a waveform that has not been generated yet).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the examples (LabVIEW) we ship shows how to do that. It uses Script Mode and places Marker Events throughout the waveform being generate. You can read them back in software so you know roughly where the arb is in the waveform generation. Basically, before writing new data, you wait for the next marker event to be generated. Once you detect it, you know the Arb generated some portion of the waveform and that you can overwrite that part of the waveform.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have niFgen installed. If you have LabVIEW in your system, you can check it out. If not, perhaps someone can paste a screenshot of the block diagram for this example showing how to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2013 15:02:38 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2566131#M2578</guid>
      <dc:creator>kirsch</dc:creator>
      <dc:date>2013-09-19T15:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Streaming large data using PCI-5421 using MATLAB</title>
      <link>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2566869#M2580</link>
      <description>&lt;P&gt;Hi Marcos,&lt;/P&gt;
&lt;P&gt;Thanks for the suggestion...Ended up finding the right balance to stream by checking available memory over few iterations...use of Marker events sounds the better and more accurate way to go though.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2013 02:41:24 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2566869#M2580</guid>
      <dc:creator>Shommo</dc:creator>
      <dc:date>2013-09-20T02:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Streaming large data using PCI-5421 using MATLAB</title>
      <link>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2567447#M2581</link>
      <description>&lt;P&gt;Hi Shommo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In NI-FGEN 2.9, we added a new attribute &lt;SPAN class="monospace"&gt;NIFGEN_ATTR_STREAMING_WRITE_TIMEOUT&lt;/SPAN&gt; to facilicate streaming write process.This attribute&amp;nbsp;by default is not used, i.e. the write failed immediately if the space is not available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use that attribute, you can push more data into the driver without having to explicitly checking for available memory. The driver will handle that for you internally, and reduce the overhead of making multiple calls into the driver. Just make sure that you pick a reasonable timeout value so that you don't get an early timeout.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2013 14:38:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Signal-Generators/Streaming-large-data-using-PCI-5421-using-MATLAB/m-p/2567447#M2581</guid>
      <dc:creator>Liusdi</dc:creator>
      <dc:date>2013-09-20T14:38:37Z</dc:date>
    </item>
  </channel>
</rss>

