LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to Measurement File Problem with table Format

Solved!
Go to solution

German (English below):


Moin,
ich habe ein kleines Problem mit der Write to Measurement File Vi.
Über meine DAQ Karte USB 6000 nehme ich Daten von 3 Sensoren auf. 2x ai input (voltage) und einmal den Counter input. Die Messwerte sollen (nach Bearbeitung, also simples skalieren der Spannungen) zusammen in eine Tabelle geschrieben werden. Die erste Spalte soll für die Zeit sein (relative Zeit reicht hier, und da meine DAQ Karte kein Hardware-Timing hat reicht auch hier das Software Timing). In die drei Spalten daneben sollen dann jeweils die Messwerte der drei Sensoren jeweils zum gleichen Zeitpunkt. Ich hätte dann gerne für jede Sekunde Beispielsweise 10 Messwerte.
Mein Problem ist jetzt


1. ,dass für die Messwerte für verschiedene Sensoren unterschiedlich oft in in die Tabelle geschrieben werden.
zum Beispiel wird ai0 mit 100 Messwerten pro Sekunde in die Tabelle geschrieben, der Counter Input allerdings nur einmal Pro Sekunde, die restlichen Zeilen sind hier dann leer. Wie kann ich meine Datenaufnahme Synchron halten?


2.,dass Messwerte für Beispielsweise eine Sekunde in die Tabelle geschrieben werden, und dann für die nächste Sekunde ein neuer Abschnitt in der gleichen Tabelle kommt, wieder mit neuem Header und allem drum und dran, statt eine Fortlaufende Tabelle zu haben. Wie kann ich einstellen, dass ich so eine fortlaufende Tabelle bekomme? 

 


Ich habe schon Probiert die Write to Measurement File VI innerhalb und außerhalb der Schleife zu positionieren, und ich habe schon mit Timing und den Sample Rates herumprobiert aber konnte keine Zufriedenstellende Lösung finden. Die Write to Measurement File VI ist nur Beispielhaft in ihrer eigenen Schleife außerhalb, ich hatte Sie dort auch schon ohne Schleife und auch in der Hauptschleife. 
Im Anhang habe ich einmal einen Screenshot meiner VI und einmal einen Screenshot einer erzeugten Tabelle.

 

Vielen Dank schon mal!

 

English:

 

Hi,
I have a small problem with the Write to Measurement File Vi.
Via my DAQ card USB 6000 I record data from 3 sensors. 2x ai input (voltage) and one counter input. The measured values are to be written (after processing, thus simple scaling of the voltages) together into a table. The first column should be for the time (relative time is enough here, and since my DAQ card has no hardware timing, the software timing is enough). In the three columns next to it the measured values of the three sensors should be entered at the same time. I would then like to have 10 measured values for each second, for example.
My problem now is, 


1. that the measured values for different sensors are written differently often into the table.
for example ai0 is written into the table with 100 measured values per second, the counter input however only once per second, the remaining lines are empty. How can I keep my data recording synchronous?


2.that,for example, you can write  measurement values for one second into the table, and then for the next second a new section comes in the same table, again with a new header and all the trimmings, instead of having a continuous table. How can I set up to get a continuous table like this?


I've already tried positioning the Write to Measurement File VI inside and outside the loop, and I've tried timing and sample rates but couldn't find a satisfactory solution. The Write to Measurement File VI is just an example in its own loop outside, I had it there without a loop and also in the main loop.
In the appendix I have a screenshot of my VI and a screenshot of a created table.

 

Thank you very much!

 

Download All
0 Kudos
Message 1 of 8
(2,766 Views)

Hi Cergtan,

 

1. Your data are synchronouos: you get one value for your CTR and 100 samples from ai channels per second…

 

2. Don't use ExpressVIs to save your data! This way you can easily program the way you format your file…

 

General hint:

We cannot debug images using LabVIEW. When you have problems with your VI(s) then you should attach your VI(s)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(2,735 Views)

It really depends on how you want to handle your data. You have a few options here. The easy thing to do would be to fill in the same count on every entry until you get the next count. This way you have 1,000 1's and then you get 1,000 2's. This would match up to your data with a 1000S/sec sample rate.

 

The next option would be to set your precision to three decimals. For each sample add .001. You would have 1.000, 1.001, 1.002 etc... 2.000.

 

I am sure there are many other ways to handle this. What ever you do you will have to add it at some point during the process using code.

 

Tim
GHSP
Message 3 of 8
(2,729 Views)

Hi Gerd, 

 

actually I am counting Edges of an Encoderwheel with the counter input, so I get 36 Signals per Round, with about 300 rpm there should be more signals then one every second. 

Tomorrow I will try to save my Data without an ExpressVI. 

 

I attached the VI to the appendix. I also saved it for previous versions, but i am not sure if that worked correctly. 

 

Thank you so far!

 

 

Download All
0 Kudos
Message 4 of 8
(2,701 Views)
Solution
Accepted by topic author Cergtan123

Hi Cergtan,

 

try this to get the same amount of samples for all 3 signals:

check.png

Your "Kalibration"-factor looks suspicious: to get a scaling of 185mV/A you need to multiply by -5?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 8
(2,691 Views)

Thank you Gerd, I will try that later!

 

The "Calibrate" comment is no longer current.

 

 

Kind regards 🙂

0 Kudos
Message 6 of 8
(2,673 Views)

The VI is working and I get the same amount of samples for all Sensors now. Thank you!

I still have to do some work to get everything working how i want it, but the rough work is done.

 

 

Kind regards 🙂

0 Kudos
Message 7 of 8
(2,638 Views)

Unfortunately i have to come back to this topic:

 

The VI is running quite good and does what i want it to do. More or less. 😄

The point is, i don't understand why it is not possible for me to get continious data written to my Spreadsheet from my counter. 

The first version I tried ended up with lots of empty rows and the second, proposed by GerdW, fills the empty rows with the same number for 100 milliseconds. 

 

My counter gets a new Value approximately every 5 to 6 milliseconds. Why do i still end up with the same value for 100 milliseconds? Where in the VI above is the timing to write this value into my spreadsheet set to 100 milliseconds?

 

 

Kind regards

 

Cergtan

0 Kudos
Message 8 of 8
(2,559 Views)