Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

NI PXI 6562 Streaming ( Continuous generating and acquisition)

Hi,
    We would like to generate and acquire data using NI PXI 6562 for 2GB of data with 50MHz for generation and 25MHz for acquisition, we have 1042Q chassis, NI PXI 8196 embedded controller(2.0GHz  & 512MB RAM) & NI PXI 6562, so PCI bus is only used by 6562.
I am using examples "niHSDIO (U32) Stream from Disk Queues Win32 File IO".
I am now able to generate or acquire samples of 100MB , beyong that I got an error "data overwritten" for generation and "lower sample rate or write more data to streaming waveform" , how can i do to achieve 2GB of data generation and acquiring?
 
For PCI BW calculation,

for NI PXI 6562, for acquisition we can select data width of 1byte or 2 bytes for efficient onboard memory usage, so if we assign 1 byte, only 8 lines are for acquisition, therefore

Required Bandwidth = Acquisition Rate * Number of Channels * Memory per sample (Each line is 1 bit so 1/8 of a byte)

Using that formula, acquiring at 25 MHz we get 25MHz * 8 * 1/8 = 25 MB/s

So, there will be 25MB of samples will transfer through PCI Bus to controller memory and then write to HD, if my HD Write speed is 25MB/s average, streaming acquisition should work out smoothly, now the problem is that fetched data have been piling up in controller memory and subsequently it is full, unable to perform any more when it reach 100MSamples, How can I solve this problem?

 

for generation, data width is fixed at 2bytes for 16 channels so 1 bit for each channel,

Required Bandwidth = generation Rate * Number of Channels * Memory per sample (Each line is 1 bit so 1/16 of 2 bytes)

Using that formula, generating at 50 MHz we get 50MHz * 16 * 1/16 = 50 MB/s

Since 50MB/s is required, I tried to solve it by transferring most of my data to controller memory, I got an error message asking to reduce sample rate or write data to streaming waveform more frequently,

I would like to the bottleneck here, if I reduce the sample rate, data throughput is lower, I can do the streaming properly at 6MHz clk speed for 1GB of data, so is this the case of PCI Bus limitation for my 50MHz since it is required BW of 50MBps while 6MHz requires only 12.12MBps?

As you can see in picture attached, there is an increase in modular device on-board memory (space available in streaming waveform), as it increases, it will stop the application, we have 16MB of on-board memory, is on-board memory the bottleneck? How can I solve this?

One of my intention is to create some waveform in .hws format , write to onboard memory and repeat it, my only concern is that discontinuity between repition steps, can it happen ?

Thanks,

Download All
0 Kudos
Message 1 of 15
(5,353 Views)

Hi Thet Khaing,

 

You are correct that the acquisition data width can be set.  If you are acquiring data at 25MHz with a datawidth of 1 byte, the data will be acquired at 25 MB/s.  For generation, again you are correct that the data width is fixed.  However, there seems to be some confusion.  The datawidth determines the sample size.  It will not change based on the number of channels used.  Therefore, at 50 MHz and a datawidth of 2 bytes, you have 100 MB/s.

 

Keep in mind that PCI/PXI is a shared bus.  In order to sustain the generation and acquisition rates above, you will need to transfer data at 125 MB/s.  Although this is below the maximum theoretical transfer rate of PCI/PXI (132 MB/s), in reality you are doing very well to get 110-115 MB/s.  Furthermore, the PXI-8196 has a laptop hard drive.  Laptop hard drives typically transfer data at a maximum rate of 25-30 MB/s.  This makes the hard drive the bottle neck of the system.

 

From here there are several options:

1)  If the generation waveform repeats, you could use scripting to link and loop waveforms.  Unless you explicitly add a delay, there is no delay from on waveform to the next.  In the script below, the first sample of wfm2 will occur on the next active sample clock edge following the last sample of wfm1.

script myScript1
  Generate wfm1    
  Generate wfm2    
end script

By using scripting, all the waveforms are loaded before the board starts generating data.  This would reduce the needed streaming rate to 25 MB/s.

 

2) Adding hard disks in a raid 0 configuration would greatly increase the maximum transfer rate of the hard drives.  It is important to note that hard drives perform best when read or writing from one file.  If you are reading and writing to one disk at the same time you will see poor performance.  In your case you may be able to use a raid disk for generation and the PXI-8196 hard disk for acquisition.  Keep in mind you will not be able to transfer the full 125 MB/s, so you will slowly fall behind.  Since you only need 2 GB of data the onboard memory should not overflow in the short amount of time you are streaming data.

 

3)  There are other options if you need to indefinitely stream data at 125 MB/s, but they will be significantly more expensive.  I will be happy to address them if needed.

 

Please let me know if you have any questions.

 

Ryan

Message 2 of 15
(5,316 Views)
Hi,
    Thanks a lot for the reply, I had managed to run with the script and it is running fine.in this case I am making use of .hws digital waveform file to generate data,but I am thinking of creating a binary file so as to be able to use with the examples that I found in NI website, but I have no idea how to create a binary file for digital waveforms, anyone can help me ? If possible, can point me out or guide me how to create a binary file to generate and how to analyze the data acquired ??Attached are examples
I am needed to generate 4 digital lines with maximum clk of 50MHz,
Thanks ,
Phone Thet Khaing
0 Kudos
Message 3 of 15
(5,282 Views)

Hi Thet Khaing,

I think you are referring to the Win32 File I/O examples.  In these examples, the binary file is an array of U32, U16, or U8 data.  It is important to note that there is no header information in the file, it is simply data. To create this binary file, you can use the LabVIEW or Win32 VIs (the hws VIs will not create this type of file).

Ryan

0 Kudos
Message 4 of 15
(5,255 Views)

Hi,

   Can u pls show me a few steps to create a binary file in either using U8 array or U16array of data, as attached provided files do not have such examples for win32VIOs and using labview

Thanks,

Phone TK,

0 Kudos
Message 5 of 15
(5,247 Views)
As stated in the last post, you could use either the LabVIEW or Win32 File I/O VIs.  I have attached a simple example showing how to use the LabVIEW File I/O VIs to create a binary file.
 
Ryan
0 Kudos
Message 6 of 15
(5,236 Views)
Hi Thet Khaing,

You have a few other options as well. The Digital Waveform Editor can export waveforms directly to U32 binary files. Use the File » Export... dialog.

If you want to compact your binary file (since you need only 4 lines, a U8 datatype would suit you), save your waveform from the Digital Waveform Editor as a U8 file and then use the LabVIEW binary file I/O VIs to save just the data and strip the header information. See my attached screenshot.

Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 7 of 15
(5,214 Views)

Hi,

   thanks a lot for the help, now i managed to create an binary file for 4 channels for generation,

however i got problem in acquisition, at the starting of my acquisition , a few data are lost but the rest is ok, for acquisition I used strobe for my trigger, can you pls help me how to prevent from losing data for acquisition?

 i do not have any problem with acquisition storing the data as .hws file but we do not use it as it is device-memory dependent, I just used it to test of my lost data, very small file i send out , first i stored as .hws file and nothing is lost , same I did for my win32io VIs(e.g you can see in previous attachment), & still lost a few data at the beginning , so can you pls help me ?

Thanks,

Phone TK

0 Kudos
Message 8 of 15
(5,200 Views)

Hi,

 we calculated the lost data size , and it happened to be 1Mbytes of data at the beginning and in addition we lostt 1Mbytes of data at the end of our data send(generated),

so now we are sure that we lost 1Mbytes of our data( it is consistent of losing 1Mbytes of data at front part of data and 1 Mbytes of data at the last part of data, in between data is correct,) happening  for both generation and acquisition,

may I know how to solve this ?

attached is the screen-shot of generation session,it could be seen that Coerced # of Samples to Generate is smaller than Total Samples in File, could it be the reason that we lost our last part of data ? and pls help me advise on the data-lost at the begginning of my data .

thanks

Phone TK

0 Kudos
Message 9 of 15
(5,193 Views)

Hi,

  Another scrreen-shot, as you can see attached picture, "Space Available in Streaming Waveform (Samples)" indicator is in negative value(-1153434), before i run the test, it is zero, may I know what does it refers to ? it too happens the same for sample written as showing -1 sometimes ,

Thanks & Best Regards,

Phone TK

0 Kudos
Message 10 of 15
(5,156 Views)