07-16-2012 08:52 AM
Hi
I am using a multi-record example for .net class library to acquire multiple data from single channel. I thought that when we assign a number of record and a minimum record length, it has to acquire the minimum record length of data at a time i.e. if i assign 500 as minimum record length and number of record to be 5, it has to acquire 500 samples at a time for 5 times, but when i used the multirecord, it is fetching only one sample at a time. What might be the reason behind it. I am getting a data at 1 KHz, how can i get 500 samples of data(i.e one record) at every milisecond? Please help me.
07-16-2012 09:07 AM
Here's a video link of the multirecord gui that i am using...plz help...
07-17-2012 04:01 PM
Hi Paritosh,
You are correct in that the multi-record acquisition will acquire the appropriate number of samples according to the minimum record length and number of records that are specified. It performs this acquisition at the specified sample rate. You mentioned you were sampling at 1 kHz with a record length of 500 samples. This implies that one record will represent 0.5 seconds in time --> 500 samples / 1000 Samples/sec. Doing this 4 more times will increase that time to 2.5 seconds roughly (without including the negligible trigger re-arm time).
The hardware cannot retrieve 500 samples all in one instance of time. The sampling rate specifies how fast you will acquire data. If you would like to acquire 500 samples in 1 ms then your sampling rate will need to be 500 kHz.
Also, keep in mind this is all refers to hardware timing specifications. Your GUI will not be able to display data as fast as the hardware is retrieving it. The advantage of the multi-record acquisition is to be able to acquire multiple finite records of a signal with very little time in between them as there is no software intervention; the hardware rearms itself inbetween acquisitions. For more information on this topic please refer to the NI High-Speed Digitizers Help file.
With that said, your video seems to indicate that the program is working fine. The sampling rate seems to be set to 10 MHz in the video and in the code you posted. The graph seems to be showing a reasonable plot and, as I mentioned above, the list that is populating on the right is likely doing so at its fastest possible rate. The GUI will not be able to display all the data as fast as it is being acquired by the hardware.
Regards,
07-18-2012 12:08 AM
I removed the part of arranging the data in datatable and now the data acquisition is faster. So, now its basically just acquiring the data and display in waveform. Then the processing part will start from there. I also want to ask, what is the difference in speed between the multi-record and configured acquisition case of the .net examples if we give same sampling rate for both case.
07-19-2012 12:44 PM
Hi Paritosh,
There is no difference in speed between those two examples. The sampling rate specifies how fast the hardware acquires data; therefore, if you set the sampling rates to be equal for both of these programs, the hardware will acquire data at the same rate. As far as how quickly you will be able to view this data in software, the two examples should use the exact same types of graph, so there will be no difference in speed there either.
Regards,
07-19-2012 08:02 PM
Thanks for the reply. I have some more query..In multi-record example, i fixed the minimum record length to 500 and then when i tried to set the value of number of record to be 40,000 it could not acquire data and the time out occurs. But if i acquire less number of records that is around 2000 or 3000, it acquires the data. What is the reason behind it not acquiring 40,000 records. How can i fix it?
Also, in multi-record, it used ScopeMultipleRecordReader but in configured acquisition, it uses ScopeSingleRecordReader, doesn't it have any effect on the data acquisition speed?
07-23-2012 10:45 AM
Hi Paritosh,
If you are getting an error that indicates that a timeout occurred then you need to increase the timeout length in the code. If you are attempting to acquire 40,000 records of 500 points each, then that will be 20,000,000 data points. If you sample at 10MHz, this operation will take at least 2 seconds. You should make sure that your timeout is set to higher than 2 seconds. Even if you do set your timeout higher, however, I imagine you will get a memory error indicating that there is insufficient on-board memory to acquire that many data points. This may be an operation that the hardware simply cannot perform.
There is no difference in data acquisition speed between the ScopeMultipleRecordReader and the ScopeSingleRecordReader functions. They both acquire data based on the specified sampling rate. One is meant for acquiring mutliple records and the other is if you want to just acquire a single record.
Regards,