I m now using PXI-6552 (8Mb/Channel) and I need to estimate the memory size which will be consumed to determine wheather the onboard memory is adequate.
Here let me share with you all what NI article has tell me so I could point you to my real question.
As I know,
For 6552, memory perchannel = 8Mb (Total available channel = 20)
Data Width determine the memory size applicable to each channel.
If Data Width = 1 byte, memory perchannel for 6552 is 32Mb/ch.
And Data Width is determine by the channel used and each card.
use 1-8 Channels = 1 byte Data Width (32Mb/ch)
use 9-16 Channels = 2 byte Data Width (16Mb/ch)
>16 - 20 Channels = 4 byte Data Width (8Mb/ch)
Channel Used => Data Width => Waveform Size allow
But, waveform and hardware script is stored together. Number of waveform repetition and number of sequence will determine total memory size consumed.
I just wanted to mention that in the KB here, it does mention that for Generation sessions the data width for the 6552 is always 4 bytes. The amount of onboard memory used by the 6552 is a combination of both the waveform and the script file. An estimate of the waveform size can be calculated using the formula provided in the article here. There is a small amount of memory used for buffering, but this value should be very small in comparison. It also mentions that "most scripts use very little memory (on the order of 1000 samples)." Typically the script sizes are much smaller than the waveform size and are considered negligible. The driver takes the script and converts it so it can be sent to the onboard memory. Currently, there is no official way of calculating the exact size of the script. Is there a specific reason you are worried about the script size. If you post your application information, there might be another option or workaround. If you are getting closed to filling up the onboard memory, you might want to consider methods of reducing the waveform size mentioned in the article here. More options would be to consider purchasing device with more onboard memory or streaming the data from file rather than from onboard memory.
I hope this helps,
Hi Paul C. ,
Thanks for your time. To conclude my understanding,
generation data width is fix at 4 bytes, hence 8Mb/Channel is fixed.
and from http://zone.ni.com/devzone/cda/tut/p/id/7283
"A single instruction compiled for the National Instruments High Speed Digital I/O boards is 16 bytes. "
So, Total onboard generation memory for 6552 is 8Mb*20channels = 160Mb = 20MB.
For hardware script is
repeat 10 (2*16 bytes)
generate wfm0 (1*16 bytes)
if wfm0 is waveform with 800k samples (800k line of samples(rows) and 20 Channels(column))
size of wfm0 = 800k*20=16000kb = 16Mb = 2MB
from script, memory consumed = 3*16bytes = 48bytes = 48B
So, I can say that the total memory used in generation session = 2,000,048B.
Am I correct ? Please comment. Thanks a lot.
You're very close to the correct aproximation. There is some additional memory used for buffering / padding etc, but again this is extremely small in comparison to the waveform (just like the script size). In addition, I do want to reinforce the fact that the 16 bytes is an aproximation and 100% exact.
I hope this helps,
But my question is :
If you have 800k samples and 20 channels, you can say you will have 800k*20 samples, not 800k*20 bits. Because NI card can support 0,1,Z,H,L,X, 3bits are needed for 1 sample. Thus, the memory will be 800k*20*3 = 48Mb = 6MB.
Is this correct? And I wonder what is maximum memory for script?
Keep in mind that the memory is specified in Mb per channel. If you have a 6552 with 1Mb per channel memory, and you store 800K samples, you've only used 800K/1M samples. You'd still have approximately 200K samples available in your memory.
Do you need to know exactly how many bytes are being stored in the onboard memories, or are you just wanting to estimate how many data points you can store at any given time?
National Instruments R&D
You do not actually lose any pattern depth by using the other logic states. The 8Mb per channel memory option, for example, will have 8Msample of memory behind each channel, regardless of encoding (1,0,H,L, etc). Paul's point is that you lose some of the sample depth since we share memory between data and instructions. You're total script size PLUS waveform depth must fit within the 8Msample deep memory. So for your example below if your waveform is 800k deep then you are using 800k + (scrippting overhead documented at http://zone.ni.com/devzone/cda/tut/p/id/7283) samples of memory where you have 8Msamples available.