LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

contradiction between time delay and fetch bmp file

Solved!
Go to solution

PIC1.jpgPIC2-confirm.vi.jpg

Hi All,

I need to fetch BMP file by confirm.vi(pic2), but when I run the program, the BMP file won't come out correctly. the last picture always come out. (for example, the first time picture A come out, but when picture B should come out, it still show Picture A.)

the correct picture will come out correctly when i put time delay 100ms in the loop. but it will cost lost of time,two arraies have 300 elements and 20 elements separately. how can I make it faster to fetch the correct picture? thanks!

0 Kudos
Message 1 of 5
(2,864 Views)

So you are using a file in order to pass data between loops?  That a major race condition.  Try using a User Event, Queue, or Notifier to send the picture to your other loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(2,843 Views)

Hi  ,

I'm not using a file to pass data, we have two array A and B, i need to compare the elements in these two array. when the elements are the same,

the program will run the subvi(confirm.vi) this will show picture of the elements. when i click OK, it will go back to compare.

0 Kudos
Message 3 of 5
(2,812 Views)
Solution
Accepted by topic author yeah

hi yeah,

   It seems you have used too many loops to realize your comparison function. Try to use the Search 1D Array.vi  to eliminate the insider while loop.

 

 

Message 4 of 5
(2,784 Views)

Hi AmandaYi ,

Thanks for your advice, it works.

I put the array with less elements in the loop and use search 1D array for the one with more elements. the time is acceptable now.

 

Thank you for all your help!

0 Kudos
Message 5 of 5
(2,745 Views)