LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Separar datos de una tabla.

Hola, tengo una tabla en mi base de datos con un numero y la cantidad (suma) de veces que se encendió un led. Al mismo tiempo, en otra tabla, se guardaron todas las variables cada vez que el led encendía, por lo tanto, tengo datos agrupados en una tabla. Quiero separarlos, de manera que, yo elija un número y me arroje en la tabla todas las variables que corresponden al número elegido:

Por ejemplo, elegir el número 5, y me aparezcan las filas que corresponden a ese número (en este caso 2 filas y 5 columnas), esto sin que aparezcan los demas datos relacionados a los distintos números. Y así, con cualquier número que elija.

danna23_0-1675263583448.png

 

Adjunto VI del código, espero sea comprensible, gracias.

0 Kudos
Message 1 of 7
(1,250 Views)

Hi danna,

 


@danna23 wrote:Hello, I have a table in my database with a number and the number (sum) of times a led was lit. At the same time, in another table, all the variables were saved every time the led turned on, therefore, I have data grouped in a table. I want to separate them, so that I choose a number and it throws me in the table all the variables that correspond to the chosen number:

For example, choosing the number 5, and the rows that correspond to that number appear (in this case 2 rows and 5 columns), this without the other data related to the different numbers appearing. And so with any number you choose.

It seems to me your question is rather database-related and not LabVIEW-related…

You need to apply the correct filter for your database request!

 

On your VI:

  • Why do you use ArrayToCluster+UnbundleByName to index an array element? Why not use IndexArray???
  • Why do you use a local "Spark" when the Spark terminal is unused? Heard of race conditions?
  • Why do you initialize an empty (!) array from your scalar "table[1]" string? Which item do you want to find in this empty array???

 

Best regards,
GerdW


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

Corrected.

What about the main question?

As you can see, I want to show data for each number (menu ring).

0 Kudos
Message 3 of 7
(1,223 Views)

Hi danna,

 

I don't have your database file, nor do I have any database software installed/in use on my private computer.

And this "Firebird/InterBase(r) driver" doesn't sound familiar to me…

 

Do the DB functions respond without errors? If yes then you need to refine your DB requests!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(1,218 Views)

Hi!

Yeah, it works!!

 

Do you know any form to separate data, even with a table on your VI (instead DB) and show it into another table?

0 Kudos
Message 5 of 7
(1,216 Views)

Hi danna,

 


@danna23 wrote:

Do you know any form to separate data, even with a table on your VI (instead DB) and show it into another table?


A table is just a 2D array, and you want to filter by values of the first column?

Like this:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(1,189 Views)

hi

thank you so much GerdW, your example helped a lot.

0 Kudos
Message 7 of 7
(1,151 Views)