03-20-2009 11:57 AM
HI all ,
I have some trouble ,
i need to receive the data from database , how can i use labview to check that the table is add a new row ?
i want to check number of the row in the table so that i can see wether the number of row in the table have changed.
i have tried to use shift register and event structure , but i fail .
is there any other method ? or example to do this ?
Thank you !!
03-20-2009 12:02 PM - edited 03-20-2009 12:02 PM
Why does a shift register and event structure not work?
Here's how I would do it:
- Create a while loop, and add a shift register.
- Have an event structure, triggered by a value change in the table.
- Put your data in an 'array'.
- Initialize the shift register with the original array.
- Inside the event structure, use the 'array size' function the new array and the old array
- compare the values of the number of rows.
- if they are different, a row was added/deleted
03-20-2009 12:17 PM
Dear Cory K ,
Thank for your help !
now , i can use SQL to know the size of my table
oh..sorry , i still can;t understand , do u have some example ?
03-20-2009 11:06 PM
I made a simple example to show you how to implement this logic.
See if you can follow the attached VI.
Let me know if you have any more questions.
03-21-2009 12:20 AM
Thank you
But i can't open it , as i don't have VI 8.5
do u have 8.2 or just pastle the image to me ?
03-21-2009 08:07 AM - edited 03-21-2009 08:08 AM
03-21-2009 11:02 AM
Hehe ssingh1, he said he cant open 8.5 because he has 8.2, so you modified my code and attached it in 8.6![]()
Thanks though.
Anyway, I reattached the code in 8.2
03-21-2009 11:32 AM - edited 03-21-2009 11:33 AM
Cory K wrote:Anyway, I reattached the code in 8.2
It's still in 8.5 😮
Your example is quite flawed (why local variables, why slice out colums to get the number of rows? Why no stop event? Why is there a timeout event? Why do we need a shift register?)
Here's a quick alternative.
03-21-2009 11:12 PM
I'm still in the phase of figuring out how to make a VI function properly.
Coding correctly and efficiently is an entirely different ballgame ![]()