05-22-2017 01:07 PM
Hi All,
I have USB DAQ device which I am using to acquire analog voltage from 4 channels (though different sampling rate). I am having trouble in saving the data to spreadsheet/csv file. I need to add timestamp as first column and have 4 other columns of data with different headings and also need to make a new file for every day.
Please see my attached try, I tried to use build array but all I get is a single string from get time and date function inside loop. how can I add time stamp to the file.
Thank you.
Solved! Go to Solution.
05-24-2017 06:21 AM - edited 05-24-2017 06:50 AM
Hello AnkitG,
if you are using one device, then only one sample rate can be used for all channels normally set the fastest rate.
Do you want the timestamp for each sample?
If you are using waveform instead of double, you get the start timestamp and the delta t.
Attached an example not tested. I also recommend to split the acquisition from write to spreadsheet with a queue.
05-24-2017 10:29 AM
@Duffy2007 wrote:
Hello @AnkitG
if you are using one device, then only one sample rate can be used for all channels normally set the fastest rate.
Do you want the timestamp for each sample?If you are using waveform instead of double, you get the start timestamp and the delta t.
Attached an example not tested. I also recommend to split the acquisition from write to spreadsheet with a queue.
Hi Alexander,
Thank you very much for the help but xls file generated by the program now have all the data in one column and time stamp in one. how can I have separate column for each channel data and timestamp ( I only need one timestamp column)
you mentioned to split the acquisition with queue how can I do that.
Thanks for the help,
05-26-2017 01:38 AM - edited 05-26-2017 01:41 AM
Hello AnkitG,
attached a modified example not fully tested.
Please also save the file as .csv instead of .xls and separate the values with ; instead of ,
05-26-2017 12:08 PM
thank you very much alexander, though " ," worked rather then " ; " for csv file
04-02-2018 01:53 PM
Hi there,
Can you guys please upload your vi again for labview 2015 or earlier.
04-02-2018 02:38 PM
Saved the last posted VI in 2015.
04-03-2018 02:01 PM
@crossrulz wrote:
Saved the last posted VI in 2015.
Thanks a lot for the upload.
However, I have another question I am building a VI which generates step signals and sine wave signals using USB - 6001's both output channels. I am acquiring the generated command signals whether it is a step signal or sine wave by looping back the generated command to AI0 and the feedback from other 4 motors as well to AI1 ~ AI3.
I am using build table express VI to log data and then to write it in file. I want to switch between manual command (Step signal) and sine wave command whenever I want during a session and at the end of session I wish to plot all the command signals and feedback signals in a single plot in the order and magnitude as they were given. That is why i am appending the data in a single file. However, when I use manual command for the first time to give let's say three command signals the data is logged properly after pressing 'save data' I also press 'clear data' after saving the data. Then I switch to sine wave it also logs the data properly. At this point if i press plot results the are plotted as I wish. After that I switch to manual command and when I press the 'send command' signal i see that table is not cleared and it remembers the old data as well so I see four data entries in the table while I was expecting to see only one.
I have used the "Reinitialize to default value" option already that is of no use because the data temporarily goes but when I write new data the previous data also comes back. I tried to use the reset option of the table as well but since the tables are built in the case structure elsewhere so the clear data button does not serve the pupose even if it is attached to the reset input of table vi. So i tried to use local variables and "Value" property node of tables but that is of no use too.
Please help I am attaching the VI and screen shots as well. Please forgive me for any stupid mistakes and the messy code because I know I am still learning.
04-04-2018 03:09 PM - last edited on 11-26-2024 05:48 PM by Content Cleaner
Hello shami81,
all things are running in parallel acquisition and writing the values to the table. Try to use a state machine so all steps are defined when something should happen.