LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

check if a row is empty in a table using shared variable

i'm checking rows of a table,but even if a row is empty the counter "NrOrdreSuivant" doesn't stop.normally if row number 1 is empty i have to get 1 in the counter,but the counter doesn't stop until 18.

the meaning of all that is :in the client VI the counter "NrOrdreSuivant" is always incrementing by 1 in order to get each data in a different row15.png

0 Kudos
Message 1 of 4
(2,725 Views)

Your array is not empty.  Your table has 21 rows and 5 columns, plus a header row and header column.

 

You have a race condition with misuse of local variables since you are reading the local variable of the ResultatPsycho array before anything is written to it in the top half of the VI.  Plus there is no reason to write to a local variable of that control when you are simultaneously writing to the terminal itself.

 

There are several other Rube Goldbergs in there such as the 4 iteration For Loop where you are constantly ANDing a True with whatever comes in.  And for the Feedback nodes, you can get rid of the enable terminal since you just have a True wired into that.

Message 2 of 4
(2,687 Views)

so i don't have to use "empty string/path" ,but how to check if a row doesn't contain any data.because i want to take just  the number "NrOrdreSuivant" that is shared variable of a row that doesn't contain any data then send it to clients

0 Kudos
Message 3 of 4
(2,668 Views)

I think what RavensFan was saying is that you don't need to have the for loop after the "Empty String/Path?" VI in your code. You can simply delete the For Loop and connect the output from the Empty String/Path VI into the case structure for your 'NrOrdreSuivant" indicator.

 

You could even replace that indicator with some sort of file logging if you want to keep track of all the occurances that returned an empty table. For example, you could use the case structure to say "If Empty, Log to File".

Applications Engineer
National Instruments
Message 4 of 4
(2,644 Views)