ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/7
2,406件の閲覧回数

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 件の賞賛
メッセージ2/7
2,384件の閲覧回数

Corrected.

What about the main question?

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

0 件の賞賛
メッセージ3/7
2,379件の閲覧回数

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 件の賞賛
メッセージ4/7
2,374件の閲覧回数

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 件の賞賛
メッセージ5/7
2,372件の閲覧回数

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 件の賞賛
メッセージ6/7
2,345件の閲覧回数

hi

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

0 件の賞賛
メッセージ7/7
2,307件の閲覧回数