06-22-2017 09:54 AM
I'm going to again echo the thoughts above and say if you're measuring 50 separate inputs, you should move away from the Dynamic Data Type and the Express VIs.
Using DAQmx with N Channels N Samples and combining arrays from different devices will provide you with an easier time, and further will make it easier for others to read and comment on your code.
You shouldn't get them all with the same time-stamp - are you sure it wasn't just that they all occured within the same time relative to your display format? For example, if you display the time as 12.5s, and you receive samples at 1kHz and read 50 samples, it would take only 0.05s and that probably wouldn't display on your indicator.
By taking a little more control over your output, you can make sure you're getting the formats you want. With 50 channels, I would think it was worth checking out the more advanced TDMS functions, or Write to Binary File perhaps. This link (Writing TDM and TDMS Files in LabVIEW) gives some examples in part 3 that discuss the non-express VIs that can write the data to a TDMS file.
06-23-2017 04:23 AM
Ok, thanks for your answer, I will think about your solution, but I still don´t understand why this behavior. I mean, the first second works quite good, and after one second starts writing every second. I also tried with one device, only 8 inputs, and makes the same... I mean, I see that could be able to do the task, but after one second "collapses" and I don´t know why after one second...
Thanks in advance
07-06-2017 10:08 AM
Hello all,
Finally I found the error, I tried all your solutions, but it wasn´t a problem of coding, it was a problem of one of the VIs. I was generating a 1Hz PWM, and it was inside the loop, so after all, until the signal is generated... If I put to 2Hz, I will write every 0.5s... I didn´t realize about this block was inside the loop
I can not write as fast as I want, there is a limit, approximately, 150ms because of other devices.
Finally, the way I did it, also taking out this PWM signal, was creating a big array and writing once in the file, as one user wrote here.
At the end, I have the 52 signals every 150ms, so even better than requested.
Thanks a lot to all