Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save data quickly at high sampling rate

Solved!
Go to solution

Hello,

I have a question regarding the USB-9213

 

http://sine.ni.com/nips/cds/view/p/lang/en/nid/207471 

 

I first tried using signal express to generate a labview code

then had help from a friend to fine tune it.

 

i dont understand why my code is repeating

 

11/19/2014 13:19.5 -55916.6 25.54 25.141 25.165 25.075 25.133 25.066 26.364 38.134 58.991
11/19/2014 13:19.6 -55916.6 25.54 25.141 25.165 25.075 25.133 25.066 26.364 38.134 58.991
11/19/2014 13:19.7 -55916.6 25.54 25.141 25.165 25.075 25.133 25.066 26.364 38.134 58.991
11/19/2014 13:19.8 -55916.6 25.54 25.141 25.165 25.075 25.133 25.066 26.364 38.134 58.991
11/19/2014 13:19.9 -55916.6 25.54 25.141 25.165 25.075 25.133 25.066 26.364 38.134 58.991
11/19/2014 13:20.0 -55916.6 25.54 25.141 25.165 25.075 25.133 25.066 26.364 38.134 58.991
11/19/2014 13:20.1 -55916.6 25.54 25.141 25.165 25.075 25.133 25.066 26.364 38.134 58.991
11/19/2014 13:20.2 -55916.6 25.54 25.141 25.165 25.075 25.133 25.066 26.364 38.134 58.991
11/19/2014 13:20.3 -55917.8 25.532 25.116 25.169 25.082 25.121 25.053 26.392 38.151 58.988
11/19/2014 13:20.4 -55917.8 25.532 25.116 25.169 25.082 25.121 25.053 26.392 38.151 58.988
11/19/2014 13:20.5 -55917.8 25.532 25.116 25.169 25.082 25.121 25.053 26.392 38.151 58.988
11/19/2014 13:20.6 -55917.8 25.532 25.116 25.169 25.082 25.121 25.053 26.392 38.151 58.988

 

is this a hardware issue or its something wrong with my code?

i was sampling at 10hz per/sec

 

 

 

 

 

0 Kudos
Message 1 of 4
(4,400 Views)
Solution
Accepted by topic author super_saiyans

I have not used the USB-9213 but notice from the manual that it has two modes: high-resolution and high-speed. The manual does not specifiy how to chnge modes - is says to read the help files.  I do not have DAQmx, so I do not have the help files.

 

From looking at the data my guess is that the device defaults to the high-resolution mode which has a maximum sample rate of 1 S/s when using all channels. I suspect that your loop reads the same sample multiple times before the device updates the measurement.

 

Other notes:

- You do not need the sequence structure. Dataflow will give the same performance without it.

- The style guides recommend keeping the size of the BD (and FP) windows to the size of one screen. Scrolling to see what is going on slows programmer productivity and increases the chances for errors.

- Local variables should only rarely be used, and your program is not one of the places where they are appropriate.

- Consider converting to a state machine architecture. It is a more robust architecture, is easier to modify, and makes it mcuh easier to keep the BD to reasonable size. There are examples and templates which come with LabVIEW.

- Although it can probably keep up at 10 Hz, consider moving the data formatting and file writes to a parallel loop to avoid timing problems which can occur when the OS delays a file write, fragments the file or needs to allocate new space for a growing file.  The Producer/Consumer examples/templates show how this can be done. Prodcuer/Consumer can be combined with the state machine I suggested above.

 

One other thing: Text files tend to be slow and large for the amount of data. Your data rates are not really very high and text files should be adequate. For faster performance look at TDMS files.

 

Lynn

Message 2 of 4
(4,386 Views)

Hey 

 

 

but its so fast that i can't really read the values in the front page.

 

 

 

"The style guides recommend keeping the size of the BD (and FP) windows to the size of one screen. Scrolling to see what is going on slows programmer productivity and increases the chances for errors."

 

what is the style guides???

what is BD?

oh..

my front panel is on 24" external screen so i have no problem scrolling ..would that matter or it still have chances of errors?

 

 

here is what i am currently seeing now

Untitled1.png

 

 

 

0 Kudos
Message 3 of 4
(4,310 Views)

There are several versions of the style guides around. Recent versions of LabVIEW include one in the LV Help. Search the Help for "LabVIEW Style Checklist".

 

BD is block diagram. FP refers to the front panel.  If you have a large screen, it is OK.  There have been reports of strange behaviors when block diagrams or front panels get above 10000 to 15000 pixels wide or somewhat less than that in height.  Your block diagram is about 2.5 screens wide on my 27" monitor.

 

I do not have any other ideas about the data. You may need someone who has similar hardware to help with that.

 

Lynn

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