02-02-2010 01:56 PM
My question is about doing a multi-record acquisition and fetching more than one record per fetch, but less than the total number of records.
Lets say I am acquiring N records and fetching j records at a time where 1<j<N. Then for each iteration(i) of my fetch loop do i set property node "fetch record number" to equal i*j ?
Solved! Go to Solution.
02-02-2010 02:45 PM
Hi ESD,
You are correct that the "Fetch Record Number" property can be set to i*j in that case. Since i is zero-indexed, it works out nicely. However, you will need to make sure to stop the loop after the correct amount of records have been fetched, which will require you to setup the correct logic. This could be kept simple if you are fetching an integer divisor of your total records each time, but if not, you will need to determine when you are on the last iteration and how many records you have left to fetch before reaching the end of your records.
For example, if you are acquiring N=100 total records and fetching j=10 at a time, you can simply fetch i*j each time, and to determine when to stop, just take (i*j)+j >= N. This will work fine when j is an integer divisor of N, but otherwise, more logic will need to be included to determine how many records may be left at the end and then to fetch that many. Hope this helps,
12-12-2017 01:36 AM - edited 12-12-2017 01:37 AM
@dansch wrote:
Hi ESD,
You are correct that the "Fetch Record Number" property can be set to i*j in that case. Since i is zero-indexed, it works out nicely. However, you will need to make sure to stop the loop after the correct amount of records have been fetched, which will require you to setup the correct logic.
If I fetching from say k different channels and j records for 'i'th iteration my fetch record number should be i*j*k or just i*j ??
12-12-2017 04:18 PM
Hi Rex_saint,
Since this discussion is seven years old, you might have a better response from the NI community if you made a new thread and posted your question on there. Feel free to link this forum since your question is related to this issue.
Regarding your question, this Help Doc talks about fetching multiple records from multiple channels of a digitizer.
Fetching Multiple-Record Acquisitions
http://zone.ni.com/reference/en-XX/help/370592E-01/digitizers/fetching_multiple-record_acquisitions/
Reagrds,
Jared T.