05-10-2018 01:52 PM - edited 05-10-2018 02:06 PM
Hello everyone!
I had serious problems with speed of writing and reading in c#. Ive done tests (look at NI.jpg) and speed of writing is about 2 sec, and reading about 7-8 sec.
Its a disaster for my project. This is a peice of my code of reading:
double[] PV=firstchannelsInterpol[0].GetData<double>(); double[] SP = firstchannelsInterpol[1].GetData<double>(); double[] OP = firstchannelsInterpol[2].GetData<double>(); double[] OPmin = firstchannelsInterpol[3].GetData<double>(); double[] OPmax = firstchannelsInterpol[4].GetData<double>(); double[] PVmin = firstchannelsInterpol[5].GetData<double>(); double[] PVmax = firstchannelsInterpol[6].GetData<double>(); Int32[] Mode = firstchannelsInterpol[7].GetData<Int32>(); string[] Time = firstchannelsInterpol[8].GetData<string>();
Am I doing smth wrong?
Thanks
Solved! Go to Solution.
05-11-2018 01:06 AM
How did you configure your task and the sampleclock? I had a similar problem when i read at high frequencys. I could fix it for me with changing the setup of the sampleclock.
_mainTask.Timing.SampleTimingType = SampleTimingType.SampleClock; // To slow.
_mainTask.Timing.SampleTimingType = SampleTimingType.PipelinedSampleClock; // Fast, no problems.
Also, what device are you using?
05-11-2018
02:36 AM
- last edited on
11-20-2024
04:40 PM
by
Content Cleaner
In real project I receive data from OPC. But now generate it. Im using this article https://www.ni.com/en/support/documentation/supplemental/06/introduction-to-labview-tdm-streaming-vi... and there is nothing about sampleclock and task.
I will really appreciate if you give me some examples or well written articles
05-11-2018
02:49 AM
- last edited on
11-20-2024
04:40 PM
by
Content Cleaner
When you generating the data yourself then its strange that you get a timing issues. Maybe this can help you. It is also described in detail in the Measurement Studio help.
Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
05-11-2018 03:10 AM - edited 05-11-2018 03:14 AM
Thanks, I will read it. But what do you think about the article I gave. Is it not modern?
05-11-2018 04:01 AM - edited 05-11-2018 04:05 AM
I used the same for my TDMS Streaming helper class but its more about streaming data to a file and not reading from a device.
measuredData = channels[0].GetData<double>();
Is used to read data from an aleady opened TDMS file.
05-11-2018 04:14 AM
Im creating a database based on tdms. So I have to read from an opened tdms file.
05-11-2018 06:08 AM
In this case if you really want faster read times you can defragment your TDMS file before reading or consider using a faster harddrive like a Solid State Disk. The bottleneck is probably your Drive/IOPS. As far as i know there is not much that you can do software wise to speed up the read and write operations except defragmenting the TDMS files.
05-11-2018 11:09 AM
My academic supervisor made similar tasks by LabView and speed is very high about 200 ms. Maybe problem in measurement studio's functions, i dont know
05-11-2018 12:01 PM
Defragmentation really helped me. Thank you!