LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Almacenamiento de datos en tabla

Solved!
Go to solution

Buen día a todos

 

Tengo un problema con la adquisición de datos de un equipo de prueba, el cual quiero recopilar cierta información en diferentes pruebas, tengo el vi necesario para la adquisición de datos pero la cuestión es como almacenar la información para cada una de las pruebas en una tabla y que en cada prueba los datos obtenidos se vayan aumentando sin perder los obtenidos anteriormente.. ya que el vi que tengo almacena solo una prueba y cuando vuelvo a realizar la prueba se sustituyen los datos obtenidos.

 

Gracias espero alguien pueda ayudarme con este problema.

0 Kudos
Message 1 of 8
(1,670 Views)

Sorry, Don't have LabVIEW on my current computer, but typically you would keep the table data (2D array of strings) in a shift register and append new rows.

 

Here is a simplifed example 

 

(note that a table just displays the data It does not "store" it. The shift register holds the data.)

0 Kudos
Message 2 of 8
(1,644 Views)
Solution
Accepted by topic author altenbach

Yes i can keep the data with a shift register in a while loop, the data go to the table in 1 array while i dont stop the loop, but i need the way to stop the loop, register the data in a 1 row and initialize again the whileloop and the data getted, insert again in the same table but in a diferent row..

 

I attached some photos of the Vi and the table mencionated 

 

0 Kudos
Message 3 of 8
(1,615 Views)

That code makes absolutely no sense and violates all data flow rules, for example the stop condition cannot be changed while the loop is spinning, so you get either one or an infinite number of iterations of a loop that spins as fast as the computer allows, probably reading the same values most of the time, and quickly running out of memory. Why are there so many local variables? Where are the terminals?

 

Not sure why you are using "insert into array" instead of "build array". Not sure why you attaching a word document instead of just embedding the pictures into the post.

 

Can you save your vi for previous (e.g. 2020) and attach it?

0 Kudos
Message 4 of 8
(1,595 Views)

Hello thanks for your support.

 

That code is a part of a source code what i making for some company for automatize the process of a test fixture, that part i am using to get diferent information about the test like voltage, current, status etc as showed in the table imagen.

 

I have local variables because the terminals are used in other part of the code, so i taked the information of local variable and will worked.

 

The whileloop is controladed through a variable of flowbar of a test, and this loop is in a flat sequence, when the test finalized i get the information on this part of the program and take to a table, but when i start again the test, i get different information of the test but in the same row and i need to get +1 row but to keep the past information, so the information of the test didn't acumulate. that is my problem.

 

 

what i have done:
Using a control on the whileloop but didn't work, i get a infinite number of data in the table like you mencionate,

so i use a flowbar of a test to finalize the whileloop so this is why i only have 1 row in the table but i need someway to start again my test and start again the program and get the information through local variables but i need the information in the same table but in a diferent row to acumulate like 10, 15 test for later this information send to a basedate on Excel.

 

Thank you 

0 Kudos
Message 5 of 8
(1,580 Views)

You simply need to start with some of the tutorials. It seems that you are a text programmer with absolutely no LabVIEW experience and you are trying to do a literal translation of text based code in your mind. LabVIEW does not have variables. The wire is the variable! (local variables just point to values of front panel objects)

 

The use of the word "sequence" is also an indication that things are probably not optimal. You need to append to the table whenever new data has arrived, and not millions of times per second.

 

All you probably need is a single loop and a simple state machine architecture where you take the new data (wire, no local variable!) after it is read and append it to the shift register right there. No local variables needed at all!

 

If the acquisition need to be in a separate loop, you could just write the new data to a queue and dequeue & append to the table in a separate loop.

 

As I mentioned about the termination conditions, the following will NOT work as you think it should.

 

altenbach_0-1668875199607.png

Since the stop boolean comes from outside the loop, it will only be read once before the loop starts. The value inside the loop can never change after that! These are all very basic principles of dataflow!

 

I think the company is making a huge mistake if they don't use somebody that has at least CLD certification.

0 Kudos
Message 6 of 8
(1,539 Views)

can you tell me only how can i add one value to the table when i run the loop? i want the firts array in the row 1 but when i run again the loop save that array and add 1 row in the table with the other information.. 

 

This part of the Vi get 1 array of informatio so i want to save that array and when run again get another information.

 

what i need to modify or add?

 

thanks

 

Ignacio564_0-1669143273049.png

 

0 Kudos
Message 7 of 8
(1,447 Views)

@Ignacio564 wrote:

can you tell me only how can i add one value to the table when i run the loop? i want the firts array in the row 1 but when i run again the loop save that array and add 1 row in the table with the other information.. 

 

This part of the Vi get 1 array of informatio so i want to save that array and when run again get another information.

 

what i need to modify or add?

 

thanks

 

Ignacio564_0-1669143273049.png

 


You really (really!!!!) need to do some basic LabVIEW training first. This code makes absolutely no sense!

 

  • A one iteration FOR loop is the same as no FOR loop at all, especially since you initialize the shift register.
  • Do you understand the purpose of the shift register?
  • You still have glaring race conditions such that e.g. the two "decimal integer string" locals will get read way before the terminal gets updated, so you will append stale information.
  • If you want the headers to be written only once, this needs to be a toplevel loop that e.g. reads from a queue whenever the data is update elsewhere.
  • Why do you update the table via local variables? Why isn't its indicator terminal right there?
  • Why do you even need to write the first row of labels. You can use the row header strings for that!.

Attach a simplified version of your code that includes all terminals and also includes a simplified version of the produce code that updates the terminals of these locals. Make sure to use "save for previous". I currently don't have LabVIEW 2021 here.

 

 

0 Kudos
Message 8 of 8
(1,424 Views)