LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Data processing with Interrupts

Hello

I'm currently working on a VI to read data from a given VRU (vertical reference unit).

The data is sent over the COM-Port. I've managed to make it run in an untimed loop with events, such that the data is read whenever something is on the Serialport. However, the data from the VRU is sent with a fixed frequency and should also be stored that way. It is split up in several messages though.

 

What I have in mind from my C-programming are two separate applications. In first one the Serial-data is read and then whenever a full VRU measurement has arrived (consists of multiple serial-messages) an interrupt is triggered which signalizes to the 2nd loop that data must be processed and stored.

As I said the first part was done, but I'm not sure now, how to make an interrupt work like that and then store it such that it has a fixed dt.

Any help or examples are appreciated.

Thank you

0 Kudos
Message 1 of 3
(2,690 Views)

-Use the Value (signaling) property to fire the Value Changed event programmatically: http://www.ni.com/example/26471/en/

-You can also try using Producer-Consumer architecture to simply enqueu the interrupt/action : http://www.ni.com/white-paper/3023/en/

Thanks
uday
0 Kudos
Message 2 of 3
(2,671 Views)

Could you elaborate more on the exact protocol of the data coming into the serial port?  I think we can greatly simplify your setup here.

 

For instance, since the VRU is sending data at a fixed rate, there is really no need for the VISA Events.  You just need to know how many bytes to read for an entire measurement or use the termination character (which, from what I can tell, is the route you really want to take here).  If you do not get data in a designated amount of time (the VISA Timeout), then something is wrong anyways and you should throw the error and stop.


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
0 Kudos
Message 3 of 3
(2,653 Views)