Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data in milliseconds

I save analog signals in real time but I only manage to save them every second, but I need to save the data in milliseconds. How can I save them in

0 Kudos
Message 1 of 4
(1,673 Views)

What are you using to measure the signals?  What format are you saving he data in?  Could you share some of your code?

 

Based on your very generic problem statement, I would be using an NI DAQ and logging the data to a TDMS file using DAQmx's ability to stream to a TDMS file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(1,627 Views)

To measure the signals I use Arduino, and I save the data in an excel file

0 Kudos
Message 3 of 4
(1,611 Views)

First of all, you are going to need a better setup than what Linx will do, based on my limited knowledge of it.  Make a sketch to read your 3 channels, package the values in a comma delimited string, send the string using the Serial.PrintLn command.  On the LabVIEW side, you use VISA to read from the serial port.  Make sure the termination character is on and you just read more byte than you ever expect in a message.  With a baud rate of 115200, you should be able to send 11 bytes in your 1ms limit.  That is not enough to get your data throughput.  I do not know if your Arduino can handle a faster baud rate.

 

So that is your serial port limit.  Now for your file IO...Saving to an Excel file is SLOW.  Instead, open a simple text file before your loop as a csv, write the received string as I previously mentioned, and close the file after your loop.  Excel will recognize a csv file and open it just fine.  But this might still be too slow, so you may need to go with a Producer/Consumer setup.

 

But if it were me, I would just get a USB-6001 (~$220) and use DAQmx as I mentioned in my previous post.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(1,607 Views)