Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5661

Data remiain in read buffer with VISA event

$
0
0

Hi,

 

I'm trying to use the VISA event in order to read data from a serial port. I created a simple VI to test this (see attachment).

1. I initialize the port and event

2. in a while loop: every time I press a button the command "help" is sent to my board that answers with a few help instructions, which should be trigger a series of events and the lines be read.

 

The event is set on term characters. The weird thing is that every time I press help, I get "5 event", or 5 lines printed, not all the 8 lines that are actually sent from the board. If I then press "help" again, the remaining 3 lines (plus 2 new from the latest help request) are read on the VI. I don't understand what is going on??

 

I've tried changing the max queue length (which has no effect, whether it is set to 1 or 100).

I've tried changing the timeout from 50ms, but also this has no effect.

I'm sure the board is outputting the right commands I can read this in a terminal.

 

If I skip the event functionality (just read bytes at port) I can output all lines as expected, however I've had other issues with that approach and would really like to solve this with an event approach. Also, I would like to understand what's going on... I'd be grateful for any advise!

 

Best,

Maria


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>