LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using "VISA Wait on Event" to Read data from serial port as it arrives via RS232.

Using VISA Wait on Event in while loop to read data if and when data arrives at the serial port via RS232. Once data arrives I currently fire a User Event (in different while loop),that handles the data and/or Acknowledges the data with the VISA Write. I also have other events in the same Event Structure for some buttons on the front panel and a menu. This currently works as I want it too, but not all functionality has been added. Would it be a better idea to make use of Notifiers in this case? I want my comms to be event driven (app is to be full duplex) and I'm too new to LabView to know if it would be better. Not sure if ,using this event structure, I will (while busy Acknowledging data
etc), delay the button presses (for example the stop) and seriously effect the overall responsiveness of the GUI.
0 Kudos
Message 1 of 3
(4,483 Views)
Hello,

Both methods sound good. The difference is that VISA wait has to do specifically with an event generated in VISA, while the second one doesn't. Other thing that you need to take in consideration is that the VISA wait suspends all action in the application thread. So if you have more things on that thread, they will be stopped. There are some ways to force LabVIEW to run in different threads so that will also have a fix.
Another thing you need to be aware is that you need to close the handle created by the VISA Wait.
Take a look at this document.
Timeout on VISA Wait On Event Even Though the Event Has Occurred?
If you will be doing event
driven with serial communication, I think the way you are doing it right now is good enough because it will do exactly what you want to do.
Here is a document for notifiers:
What Is a Notifier?

Hope this helps

Ricardo S.
National Instruments.
0 Kudos
Message 2 of 3
(4,483 Views)
Thank you for the reply. Still on the topic - in the event structure: if this structure becomes very large, handling the user events, buttons, menu etc - will it become sluggish? Not all my functionality has been addded - so far so good, but if I'm going to run into serious lag I should better hear it now and save myself trouble. I'm a student and this is for my final year project - so time to complete is not alot. Can't afford to take the wrong way for I won't be able to fix it in time. Please reply. Thanks, Madri
0 Kudos
Message 3 of 3
(4,483 Views)