LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"incorrect" file structure

Solved!
Go to solution

Hello all,

 

I am trying to add additional columns to my output data file, which originally captured data from 3-axial load cell. The data that I would like to add is local coordinates of the two stepper motors that carry load cell. The idea is to capture motion profile along with force acquisition.

 

There are two problems that I encountered, one is major and another is minor. I would really appreciate is somebody can give an insight how to approach them.

 

1) The output file has strange structure, data from loadcell is captured correctly, but coordinates from motors captured in a strange way, there are some gaps between recording. I am attaching *.txt file as an example what is happening. I have a feeling that it is something to do with acquisition rate vs loop timing, but I am not 100% sure.

 

2) This is rather cosmetic problem. Ideally I would like to have a control on when to start "damping" data into txt file. I thought if I put a case structure inside of the main loop, and attach a switch to it, i can accomplish my goal. Apparently it did not work the way I want it. When I start my program, it creates a .txt file, regardless if the switch is on or off, then when I turn switch on, it overwrites previous file and creates a backup of on old file. Is this actually possible to do in Labview? My officemate said that what I want "breaks continuous data flow concept in Labview" , so I am a bit puzzled.

 

Thanks in advance

Download All
0 Kudos
Message 1 of 4
(2,697 Views)
Solution
Accepted by topic author Oleks

I don't know what you mean by the phrase "damping data into a text file".  I will assume you mean logging the data to the text file.

 

The reason why the switch doesn't work for you is that you have a Write to Measurement File function in both the True and False cases that the switch is wired to.

 

The reason data gets overwritten and files renamed/backedup is because that is the way the settings are in the properties of the express VI's in both the True and False cases.

 

The reason you get a large group of load cell data with a single set of stepper motor coordinates is the amount of data you are collecting in each loop iteration.  In each loop, you collect a single piece of data from the serial port giving you a parameter for each motor.  But in your DAQmx functions, you collect N channels N samples where the N samples is all the data in the buffer.  So you wind up with N rows of data points for a single pair of data points from the serial port.  Try N channels 1 sample instead.

 

What you want are rather simple fixes, and I don't think your office mate has a clue as to what he is talking about with respect to dataflow.Smiley Wink  The dataflow seems to be just fine in your VI.

Message Edited by Ravens Fan on 01-19-2009 10:40 PM
Message 2 of 4
(2,687 Views)

Thanks a bunch Ravens 🙂

 

After your reply I checked data again, and it is indeed shows 40 samples per 1 loop cycle, with 400Hz sampling rate and 100ms loop iteration that is what it does, I guess I need more brain cells...

 

Yes, I mean logging the data to the text file. So I guess by setting case structure to "false", and adding boolean switch, I should be able to fix that issue, am I thinking correctly?

 

 

Thank you again Smiley Happy

0 Kudos
Message 3 of 4
(2,674 Views)
Just delete the express VI out of the false case and rerun the error wire through.  Go into the properties of the express VI and set them so they append to file instead of renaming old files.  Now, when the switch is true, data will log, when it is false, it won't.
0 Kudos
Message 4 of 4
(2,667 Views)