LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read serial data and detect serial break at the same time

Solved!
Go to solution

I need to communicate with a device via serial that sends messages back and forth but also sends a serial break/pause/break/pause combo that I need to listen for. I have never worked with serial breaks before but the only VI I found that appears to detect them is the VISA Wait on Event VI with the Serial Break parameter. I'm not sure I understand how I could detect a serial break but also be reading and writing messages at the same time while waiting. Is this not possible?

0 Kudos
Message 1 of 4
(3,098 Views)
Solution
Accepted by topic author britehappy

If you use multiple loops, I think you can do this.  You use 1 loop for checking to see if there is data and 1 loop for looking for the serial breaks.  You then use a queues, notifiers, or events to let whoever needs to know what you encountered.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(3,071 Views)

I've not tried this, but the VISA Palette has Events, one of which is Serial Break, so you could "trap" these in an Event loop ...

 

Bob Scor

Message 3 of 4
(3,042 Views)

Ok. I will try using multiple loops. I did not think I would be able to read from and wait on the same serial resource in separate loops, but I'll give it a shot!

0 Kudos
Message 4 of 4
(3,030 Views)