03-27-2019 07:58 AM
Hi all,
i need litle help regarding saving signal from graph to file.
I manage to do something, but i get several columns in my txt file.
I would like to have one with time, and one with values, but i can't do it.
Please check att.
Thank you for your help
03-27-2019 08:29 AM - edited 03-27-2019 08:32 AM
Hi milan,
but i get several columns in my txt file.
Because you have it programmed this way!
In the inner FOR loop you create two rows: one for time information, one for Y values. Those two rows are then appended to the data in the shift register. In the end you will have a 2D array with lots of rows in the shift register…
Suggestion1:
Use 2 shift registers, each keeping a 1D array. Use one array to hold time data, the other to hold Y data.
With each iteration of the while loop you concatenate new data to each of those arrays.
After the while loop you build a 2D array from both 1D arrays…
Suggestion2:
Use AppendWaveforms to build a large waveform from your DAQ data. Convert that waveform after the while loop…
There are other options as well…
On your VI:
Why don't you (auto)cleanup?
Why do you use FromDDT instead of IndexArray?
Why do you use DAQmxRead in "n chan" mode when you only include one channel in the DAQmx task?
Why don't you use the DAQmx feature of saving DAQ data directly to a TDMS file?
03-27-2019 08:53 AM
I think that GerdW is awake before I am -- I seem to "add more information" to his posts. So I'll just make a few comments.
Bob Schor
03-28-2019 07:39 AM
Hello,
thank you a lot for your reply and explanation.
Producer/consumer architecture looks as very good, but this is totaly new for me (and generaly labview), so i am stuck now with adjusting X, Y scale.
I implemented one graph in first while loop to see ho sampling is working.
Problem is in second loop, because i get nothing on graph.
Also in att.
Thanks.
03-28-2019 02:20 PM
Hi milan,
Problem is in second loop, because i get nothing on graph.
Wrong: you get something in this graph!
(Change the plot style to show points for each sample to see a point in your graph!)
Why do you use a graph instead of the chart? And why did you hide/delete the label of that graph?