08-24-2006 12:40 PM
08-24-2006 01:48 PM
08-24-2006 03:37 PM
08-24-2006 04:05 PM
08-28-2006 07:22 AM
08-28-2006 08:20 AM - edited 08-28-2006 08:20 AM
Message Edited by shoneill on 08-28-2006 03:23 PM
08-29-2006
12:12 PM
- last edited on
05-11-2026
05:49 PM
by
Content Cleaner
Hi Shane,
I found it by just typing in "serial" and "event" in the developer zone search box. The way it works is that you have to enable events first for a given VISA session. When you enable the event, you tell it what events you'd like it to respond to. One of the event choices for a serial interface is a "receive character" event.
Here's the help page:https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/visa-enable-event.html
That being said, you might be SOL on the older version of Labview.
It clearly is an elegant way to go. I was doing an endless loop of polling the bytes at serial port until it was greater than 0. The problem with that was that it railed the CPU, and therefore, Labview couldnt do the very task that would send the serial character that I was waiting for! (before a timeout). So, if you do the polling mechanism, I would at least put in some wait statements between iterations.
Hope that helped
-Ted
09-13-2006
03:04 PM
- last edited on
05-11-2026
05:49 PM
by
Content Cleaner
shoneill wrote:... I don't see the option of "charcter" listed when I drop an "Enable events" VI on the block diagram. Only GPIB and VXI stuff.... I'm using LV 6.1 by the way with VISA 2.6.0. ....
Shane,
With LV6.1 and VISA 2.6, you do have access to serial VISA events which are not listed in the "Select Event Type" ring (which ='s the list in the LV6.1 help). Instead of the ring, use a U32 constant with an appropriate value as shown in this old example [link removed; example no longer available].
09-16-2006 11:10 PM
@tpascaru wrote:
Hi,
You can do an infinite loop to wait for bytes at serial port, but that will rail your CPU if you're trying to do anything else while waiting. There are some event functions you can use. First, enable VISA events with "VISA enable event". The arguement should be 0x3fff2035 (event type = character). Now an event will be generated wheneve a character arrives. You can use "VISA wait on event" in your loop. I use a timeout of 500ms in case something goes wrong and no event is generated.
Good Luck,
-Ted