LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strain Gauge/Write to text file

Why is my text file not displaying my data that is being shown in my charts?

I'm only getting data from my "Strain" values every 10secs and not the others. It probably has to do with decimals shown.

 

Please help. Thanks. 

 

PS. if you have any suggestions on how to improve my strain gauge readings, it would be a big help. Not much experience using these.

mo00_0-1597349780448.png

 

0 Kudos
Message 1 of 3
(921 Views)

Hi,

 

Is the txt file being overwritten every loop cycle? You need to point to end of file before writing new data into it or the data will be over-written on every write.

 

Maybe measure the loop time to see the amount of time the loop need from data acquisition to writing data will help. Here is the link on how to measure loop rate.

loop time.png

0 Kudos
Message 2 of 3
(873 Views)

Hi mo,

 


@mo00 wrote:

Why is my text file not displaying my data that is being shown in my charts?

I'm only getting data from my "Strain" values every 10secs and not the others. It probably has to do with decimals shown.


Because you are using ExpressVIs and DDT wires…

(It has nothing to do with "decimals shown"!)

 

The DAQAssitent is set to read 200 samples at 250S/s.

You convert the DDT wire (containing a waveform of 200 samples) into a scalar DBL using FromDDT to calculate a mean value.

You convert the very same DDT wire into a scalar DBL value using ToDBL to calculate the strain (which btw expects a SGL value): why do you need two different methods to convert DDT to scalar DBL?

Then you use MergeSignals to create a new DDT wire from a waveform of 200 samples and 3 more scalar DBL values: what kind of mix do you expect here?

Then you convert this DDT into a 2D array: what kind of data do you expect here given the fact your calculations produced just scalar DBL values???

Then you create a scalar ElapsedTime value, build an array of just one element from it and insert it as first row into the 2D array: again which kind of mix do you expect here? And why don't you use BuildArray when you prepend the ElapsedTime value?

 

There is so much wrong here!

General rule: using DDT wires only hides the underlying datatype and mostly NEVER helps to understand a VI!

 

More problems:

You convert the 2D array to a spreadsheet string using %s as format code: %s is used to handle strings, but NOT to convert from numeric datatypes to string! Read the LabVIEW help on format codes…

Cleanup the block diagram! Use straight wires, from left to right to create a block diagram easily readable! (Read the StyleGuide in the LabVIEW help!)

Why are you using the last "ElapsedTime" value for "Time target" in the next iteration???

 

Other possible solution:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 3 of 3
(854 Views)