Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I manipulate a serial interrupt?

I am sending a serial message from my microcontroller to labview and I would like Labview to "interrupt" it's current service routine (which also includes serial communication) to process the incoming serial message.  Any suggestions as to which functions to use?  This message from the microcontroller should always start with a "C" and therefore should be somewhat easy to distinguish.
0 Kudos
Message 1 of 2
(3,420 Views)
Scandalous  (nice nickname!),

there is no direct way in standard G that I am aware off. Direct interrupt service is out of the scope of standard applications. Writing ISR system drivers is really a different and complicated thing compared with 'normal' programs.

There is, however, a way to accomlish a kind of quick service, as long as you can live with the OS's 'real time' behaviour (e.g. some single ms typical reaction time, but up to some 100 ms worst case in Windows).

The way to go is to have a small and quick serial comm handler that receives all incoming data. It must identify the different messages and their target. It sends the different messages via named queues to the different processing VIs. If this one is highly prioritized it reacts very quickly.
The processing VIs can generate an event when their named queue contains new data. Another possibility is to dequeue new elements with a timeout of 0 ms. In case new data had been dequeued, process it. Else wait a few ms.
Now put the VI that shall be your ISR processor on 'above normal' priority and the standard processor to normal and everything should work as desired.

Greetings from Germany!<br>-- <br>Uwe
0 Kudos
Message 2 of 2
(3,407 Views)