Discussion:
saving files from usb9162
(too old to reply)
hoju1301
2008-07-29 21:10:05 UTC
Permalink
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)   Force1            10   2            11.43            99I 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


asc vi.vi:
http://forums.ni.com/attachments/ni/170/344930/1/asc vi.vi
Corby_B
2008-07-30 16:40:07 UTC
Permalink
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.2435251.000000    0.2435252.000000    0.2438473.000000    0.2435254.000000    0.2435255.000000    0.2438476.000000    0.2435257.000000    0.2435258.000000    0.2438479.000000    0.24255910.000000    0.243847I 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_Bhttp://www.ni.com/support


save to file.JPG:
http://forums.ni.com/attachments/ni/170/345196/1/save to file.JPG
hoju1301
2008-07-31 05:10:06 UTC
Permalink
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
Corby_B
2008-07-31 19:40:11 UTC
Permalink
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_Bhttp://www.ni.com/support
hoju1301
2008-08-01 00:10:05 UTC
Permalink
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


6221.vi:
http://forums.ni.com/attachments/ni/170/345735/1/6221.vi
Corby_B
2008-08-01 15:40:20 UTC
Permalink
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_Bhttp://www.ni.com/support


relative and current time.JPG:
http://forums.ni.com/attachments/ni/170/345935/1/relative and current time.JPG
hoju1301
2008-08-06 06:40:04 UTC
Permalink
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
Corby_B
2008-08-06 22:40:04 UTC
Permalink
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_Bhttp://www.ni.com/support
hoju1301
2008-08-07 05:40:07 UTC
Permalink
Hi Corby, Please see the attached screen cap.I'm also using a TEDS load cell from transducer techniques.


asccap.jpg:
Loading Image...
dansch
2008-08-08 21:10:07 UTC
Permalink
Hello hoju1301,Unfortunately, the behavior you are seeing is correct. Looking at page 21 of the <a target="_blank" href="http://www.ni.com/pdf/manuals/374186b.pdf">NI 9237 Operating Instructions</a> (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. <img src="Loading Image..."> Best Regards,Message Edited by dansch on 08-08-2008 04:00 PM


9237_data_rates.gif:
http://forums.ni.com/attachments/ni/170/347991/1/9237_data_rates.gif
Continue reading on narkive:
Loading...