11-18-2022 11:47 AM
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.
Solved! Go to Solution.
11-18-2022 12:46 PM - edited 11-19-2022 10:34 AM
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.
(note that a table just displays the data It does not "store" it. The shift register holds the data.)
11-18-2022 05:27 PM
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
11-18-2022 06:23 PM
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?
11-18-2022 08:47 PM
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
11-19-2022 10:33 AM - edited 11-19-2022 10:37 AM
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.
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.
11-22-2022 12:55 PM
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
11-23-2022 09:53 AM - edited 11-23-2022 09:56 AM
@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
You really (really!!!!) need to do some basic LabVIEW training first. This code makes absolutely no sense!
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.