LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving files from usb9162

Hi there, I am using a usb 9162 module with a teds load cell. I have the vi setup using the daq assistant to sample contiounsly at 10hz rate, at 10 sample read.

I am having trouble exporting the data out to a spreadsheet (excel) where the each x value corresponds to the time since acquisiton has started and the y values are the force.

example:
t(sec)   Force
1            10  
2            11.4
3            99

I did a search for programming it using http://forums.ni.com/ni/board/message?board.id=170&message.id=302270&query.id=150980#M302270 but it does not work properly. I don't know what I've done wrong!

Please see the attached vi.


Thank you!
~Anthony

0 Kudos
Message 1 of 10
(3,617 Views)
Hello hoju1301,

Thanks for your post!

I believe what you want to do can be done with the following attached picture. You mention that you want to take data at 10 Hz but in your list you show that you only have one sample corresponding to 1 second. So do you want to take data at 1Hz instead of 10? You will need to write the file every time the loop iterates and the great thing about the daq assistant is it already has a time stamp included in its waveform. The information that is written from the vi in the picture is the following:


0.000000    0.243525
1.000000    0.243525
2.000000    0.243847
3.000000    0.243525
4.000000    0.243525
5.000000    0.243847
6.000000    0.243525
7.000000    0.243525
8.000000    0.243847
9.000000    0.242559
10.000000    0.243847

I just used an arbitrary voltage saving at 1 Hz. If you do 10 Hz it will still have a time stamp for ever voltage.

Let me know if this is what you were looking for and please post back if you have any questions!

Cheers!

Corby_B
http://www.ni.com/support
0 Kudos
Message 2 of 10
(3,587 Views)
Thanks for the info Corby!

What do you have the DAQ assistant setup as? I'm not sure which one to chose (hw timed, continous, n samples?) I'd like to sample at a rate of 10 Hz for as long as acquisition is needed until stopped.

I could not duplicate what you got from the saved file.

This What I get:

LabVIEW Measurement
Writer_Version 0.92
Reader_Version 1
Separator Tab
Multi_Headings Yes
X_Columns One
Time_Pref Absolute
Operator Admin
Date ########
Time 54:24.1
***End_of_Header***



Channels 1
Samples 1
Date ########
Time 54:24.1
X_Dimension Time
X0 0.00E+00
Delta_X 1
***End_of_Header***
X_Value Untitled Comment
0 -1.98596



Channels 1
Samples 1
Date ########
Time 54:32.0
X_Dimension Time
X0 7.89E+00
Delta_X 1
***End_of_Header***
X_Value Untitled Comment
7.890625 -1.84019

Thanks again!


Message Edited by hoju1301 on 07-31-2008 12:04 AM
0 Kudos
Message 3 of 10
(3,575 Views)
Hello hoju1301,

Thanks for the post back!

In the DAQ assistant I am doing hardware timed so that way I know exactly when a point is being taken. So since you are sampling very low you can use a sample rate of 10 and then samples to read would also be 10. So this will happen each loop iteration.

In the write to measurement file.vi there is an option to turn off the headers. So under Segment Headers I selected No Headers.

This is how I set everything up but you might have to play with the settings to get things just right for your application!

Hope this helps and please post back if you have any other questions.

Cheers!

Corby_B
http://www.ni.com/support
Message 4 of 10
(3,562 Views)
Hi Corby,

So I got rid of the headers, and made changes the daq assistant, but now looks like the x column is erratic. Is this due to it being in relative time instead of absolute?
 This is what i get:
0
-2.57065
0.1
-2.57065
0.2
-2.57065
0.3
-2.57065
0.4
-2.5713
0.5
-2.57065
0.6
-2.57065
0.7
-2.57098
0.8
-2.5713
0.9
-2.5713
4.25
-2.57098
4.35
-2.5713
4.45
-2.57098
4.55




-2.57162
4.65




-2.57098
4.75




-2.5713
4.85




-2.5713
4.95




-2.5713
5.05




-2.5713
5.15




-2.5713
5.15625




-2.5713
5.25625




-2.57162
I'm also using the 6221 PCI card for the moment..

Attached is the VI i am using
0 Kudos
Message 5 of 10
(3,552 Views)
Hello hoju1301,

Thanks for your post back. The time on the right hand side should be the relative time to the test. So if you are sampling at 10 Hz then the first time would be 0.0 then 0.1, 0.2 etc. So if you need the actual time you can add that time as a comment in the string field. Take a look at this screen shot as this is how I have the write to file being performed. Also I am using my DAQ assistant to take 10 samples at 10 Hz continuously. Let me know if this helps you!

Cheers!

Corby_B
http://www.ni.com/support
0 Kudos
Message 6 of 10
(3,541 Views)
Thanks Corby!

I rewrote my entire VI and it works perfectly with the PCI 6221 M series card. However when I use the NI 9162 C carrier and strain/bridge module, the time spacings are not even (delta x =.00062) despite duplicating similar acqusition read and sample rates as the 6221 at 10 samples read and 10 samples write.

below is a quick copy/paste of whats going on. Any insites would be helpful, and I'm almost certain im programming it correctly!

with the c carrier/strain module:

X_Value CustVoltage
0 -0.22954
0.00062 -0.22609
0.00124 -0.23143
0.00186 -0.23244
0.00248 -0.22612
0.0031 -0.21479
0.00372 -0.21228

But with the 6221 it works perfectly:
0
-0.88049 11:03 PM
0.1
-0.88114
0.2
-0.88146
0.3
-0.88243
0.4
-0.88276
0.5
-0.8834
0.6
-0.88373
0.7
-0.8847
0.8
-0.88502



0 Kudos
Message 7 of 10
(3,509 Views)
Hello hoju1301,

Thanks for your reply back!

I am glad to hear that you were able to get the code working on the PCI 6221 working the way you want it to. As for the interesting behavior on your C series. I assume you are using the USB-9162 with the NI-9237 strain gauge module? If this is so what I would try to do is do a finite acquisition of 10 samples per second and then read those 10 samples you should get the same result as your 6221 board. However the task is very different because you have to set up excitation and other parameters. If you could post a screen shot of your code that would be great in helping you figure out why the values are .00062 seconds apart. The only thing that would indicate is if you were sampling at about 1500 samples per second. Let me know if any of this helps you and please post back with your findings!

Cheers!

Corby_B
http://www.ni.com/support
0 Kudos
Message 8 of 10
(3,491 Views)
Hi Corby,

Please see the attached screen cap.

I'm also using a TEDS load cell from transducer techniques.
0 Kudos
Message 9 of 10
(3,482 Views)
Hello hoju1301,

Unfortunately, the behavior you are seeing is correct. Looking at page 21 of the NI 9237 Operating Instructions (shown in screenshot below), the possible data rates for this device are 50/n kS/s, where n=1,2,...,31. Thus, the lowest sample rate you can achieve is 50000/31=1612.9 S/s. Taking the inverse of this value, you will see that the period is 0.62 ms, which is what you are seeing in your file. Any sample rate below 1612.9 Hz will be coerced to this value.



Best Regards,


Message Edited by dansch on 08-08-2008 04:00 PM
Daniel S.
National Instruments
0 Kudos
Message 10 of 10
(3,451 Views)