Need clarity on using C# Sample code in block mode

Post your .Net discussions here
Post Reply
Pradeep
Newbie
Posts: 1
Joined: Mon Apr 04, 2016 10:21 am

Need clarity on using C# Sample code in block mode

Post by Pradeep » Tue Apr 19, 2016 10:28 am

Hi,

When executing the C# sample code of SDK, on retrieving measurement data in block mode using GetValues() method, we are able to get only 512 number of records written to block.txt file. But we have enabled only one channel and have Set BUFFER size to 1024. The timebase index we selected is 1252 and we get maxSamples = 536870656 from GetTimebase() method.

Please let us know how to get the maximum number of sampled data (at least 10,000 samples) written to block.txt file.

Bilal
Active User
Active User
Posts: 27
Joined: Mon Oct 05, 2015 12:19 pm

Re: Need clarity on using C# Sample code in block mode

Post by Bilal » Wed Apr 20, 2016 10:51 am

Hello Pradeep,

The reason you are getting 512 samples is because you need to change the downSampleRatio=1 and the downSampleRatioMode=none, it is currently set to "2" and "average" which means it will take an average of every 2 samples and present you that data.

The downSampleRatioMode parameter needs to be changed in the BlockDataHandler section in the line:

status = Imports.SetDataBuffers(_handle, (Imports.Channel)i, maxBuffers, minBuffers, (int)sampleCount, segmentIndex, Imports.RatioMode.Average);

More information on these parameters and functions can be found in the programmers guide for your device.

Hope this solves the problem. If you require any further assistance, please feel free to let me know.
Bilal Patel
Technical Support Engineer
Pico Technology

Post Reply