Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Release Queue

Hello!

Make a program that acquires temperature data from an interface BLACK STACK FLUKE via RS-232 connection.
The program basically seeks temperature stability and then if you meet certain conditions applicable to the acquisition of data that will be processed mathematically and the saved result in a specific location excel. Finalizing this, the program results in a pop-up message requesting a user action that causes the entire program pause, to run the above process numevamente for another temperature range, the problem is that while the program is on hold, with the pop-up message waiting to be activated OK, the data from the interface remain in the buffer, to accumulate, and when after a time is given OK to pop to continue running the program all these data are read by the program and fail in the stability calculations for the first part. If someone could help me with this or any idea how to prevent data buffer is read, Thank You
regards

0 Kudos
Message 1 of 3
(3,412 Views)

It is difficult to tell from a written description of your program, but my guess is that you are using the standard pop-up dilaogs for the message to the user. Those are set to block the User Interface thread until one of the buttons is pressed.

 

To get around this you should consider an alternative method of notifying the user. Depending on the urgency and what else is going on in the program, you may have several options. One of the easiest is to simply have a string Status indicator on the front panel. You can use a property node to set it to Blinking or change the background color when a high priority message occurs. Another is to create your own pop-up VI for the message. You can set it (VI Properties) to Open Front Panel When Called and also set it to Close the panel when it completes. Do not make it Modal, which is the setting which will block the User Interface thread. This has the disadvantage that the dialog can get hidden behind another window and never get clicked by the user. When the main program tries to end, it cannot because the dialog VI is still running.

 

Also consider the Producer/Consumer architecture for the overall program. The two loops run  independently.  Even if the Consumer is blocked by a dialog, the Producer continues to acquire the data and stuff it into a queue or other buffer.

 

Lynn

Message 2 of 3
(3,401 Views)

Dear Lynn

I solved, using VISA SERIAL -> Set buffer size and Flush buffer, before Visa READ and using a condition for your ejecution keeping dependece whit pop-up. 

THANK YOU for your answer Smiley Happy

Spoiler
Spoiler
 

 

0 Kudos
Message 3 of 3
(3,398 Views)