LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving Multiple Waveforms to File, Timing

Hi everyone,

 

I am writing a program to log data from two sources, while I sweep from f=100 to f=1000.

First I'm sending a sine wave to an actuator, while I am reading data from an accelerometer on a device with the actuator attached.

I want to save the data as a text file with the following columns:

  • time
  • desired frequency
  • data of sine wave being sent to the actuator
  • data from accelerometer

I seem to be doing very close to that, but there are two issues I have noticed. First, I'm not sure if the timing of data from the sine wave matches data being read from the accelerometer. Does anyone have any advice on how to match the two, or to optimize my setup. I know its not good practice to use express vi's and timing structures but I couldn't figure out another way to get the desired effect.

 

The other issue occurs when I make the acquisition time for each frequency longer. Anything past 2 seconds gives me an error of data trying to be read that is no longer available or has been over written. Can anyone see why this is occurring?

 

I am using an NI Elvis II board and running LabVIEW 2010.

Any help would be appreciated.

 

Thanks,

Arthur J.

0 Kudos
Message 1 of 4
(2,325 Views)

I couldn't check your VI as LabVIEW isn't available. But regarding your second question, there are some very good KBs (knowledgebase) available. Check below links:

 

http://digital.ni.com/public.nsf/allkb/AB7D4CA85967804586257380006F0E62

http://digital.ni.com/public.nsf/allkb/E1E67695E76BA75B86256DB1004E9B07


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 2 of 4
(2,310 Views)

Also in case if its okay to lose the samples, that means if the application doesn't require to acquire all the samples after it starts running and just want the latest sample whenever DAQmx Read.VI is called, then probably you might want to add following property node in your code and youll experience no overflow error:

 

Read most recent sample (implemented).png

 

Read most recent sample.png

 

For your refernce check below link:

Understanding and Avoiding Overwrite and Overflow Errors with NI-DAQmx


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 3 of 4
(2,294 Views)

@BlissDismissed wrote:

 

file:///C:/Users/margarita/Downloads/Certified-LabVIEW-Associate-Dev_rgb.jpg


Hi BlissDismissed (or Arthur),

 

I also wanted to appreciate (I forgot to mention in my last reply), your code is really a neat and clean code. Not every people use to write such clean codes Smiley Happy.

 

And last thing would be, your signature image is still not visible, you may want to check this discussion and it will help.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 4 of 4
(2,272 Views)