LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Avoid while loop

Hi,

 

My objective is doing this:

 

while(TRUE)

{

         nbytes = readfile( 48 bytes);

        if(nbytes == 0) break;  // no more data

 

           while( nbytes )

         {

              sendByteToPort();

              nbytes--:

         }

 

          Status=ReadPort();

 

       if(Status != OK)    break;

}

 

 

I don't want to use while loop for locking the system. I want to allow the user to interact with the program such as stop or terminate the program.

What kind of functions CVI gives to  avoid locking the system with while loop.

 

Best regards

 

0 Kudos
Message 1 of 2
(2,787 Views)

Call ProcessSystemEvents() somewhere inside the loop.

 

Luis

Message 2 of 2
(2,786 Views)