Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when I use 1MHz sample rate ...

Nathan,
I am sorry to bother you again. I just wanted to confirm if I got your point right.  When you say that I set the offset to -1000, then that means that I will get the 1000 samples that are already in the buffer. But if I set this value to 0 , then I should be getting the 1000 points that will be acquired from now on? ... Am I right?
 
 
Thank you in anticipation.
Vijay
0 Kudos
Message 11 of 14
(1,515 Views)
Hey Vijay,

This is not how is works exactly. The offset value is an offset from a reference point set by the "Relative To" property. Since we have set "Relative To" to reference the most recent sample the offset value must be less than or equal to zero. With offset equal to zero you are pointed at the latest sample in the buffer. With it set to -1000 you are pointed at the value put into the buffer 1000 samples ago. You cannot set the offset positive in this instance because you would be trying to point to a value that will be taken in the future.

I think it may be best for you to do 1000 sample finite acquisitions, and just start the task every time you want to collect 1000 samples. Please let me know if you have any questions and take care.

Thanks,
Nathan
NI Chief Hardware Engineer
0 Kudos
Message 12 of 14
(1,499 Views)
Hi Nathan,
I think I confused you. When I said that "I set offset to 0 ... 1000 points acquired from now on" .. I meant to say that I have set offset to 0 and SamplesPerChan to 1000 and the very first point that will be read now will be the next point that is being acquired by the Buffer. Is that right now?

As you suggested, I can use finite acquisition. But is not there some delay when I CallBack the function to start reading data and when my card will actually start to read data? Actually I have a Microscopic Camera and we are working at scales of nanometer. I want to acquire data at the very moment when I have my experimental samples at right position (which is never stable).

Thank you once again.

Vijay.
0 Kudos
Message 13 of 14
(1,497 Views)

Hey Vijay,

If you set the offset to 0 and relative to is set to “most recent sample” then you will always read the most recent sample.  In this case the offset specifies where in relation to the most recent sample you read from the buffer. If offset is ) then you will only be able to read one sample, the most recent one. This is why to read the most recent 1000 sample offset must be set to -1000.

If timing is critical in your application you may want to use start of reference triggering with a finite acquisition to ensure you get the samples you are looking for. More information on triggering can be found in the Developer Zone article, Tips and Techniques in Data Acquisition Triggering - NI-DAQmx.

To enable Warp Mode on your 6120 you must change the values in a couple of the cards registers. The Warp Mode VI does this using NI-VISA calls. The VI is password protected but you can find the password in the context help of the VI. Make sure to not change the values in the VI because you are writing directly to hardware registers. By looking at how the VI enables and disables Warp Mode you could use NI-VISA in .net to perform the same actions. If you attempt this be very careful and make sure you write the correct values to the registers. The Warp Mode VI can be found here.

Please let me know if you have any questions and take care.

Thanks,

Nathan
NI Chief Hardware Engineer
0 Kudos
Message 14 of 14
(1,483 Views)