LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SERIAL PORT INTERRUPT

I want to transfer data from controller to pc through serial port.For this Is it possible to write a function such that when data is sent from the controller the function is called (like an interrupt service routine).As soon as the data is placed in the  output buffer the function will detect it and display it.I have used a timer of 100ms and after each 100ms I have checked the output buffer for new data.But I don't want to use the polling technique
0 Kudos
Message 1 of 2
(3,678 Views)

Hello Tupai,

you should use the InstallComCallback function for this.Using this function, you can define a callback function, that will be launched under the conditions that you specify, using the InstallComCallback parameters eventMask, notifyCount and eventCharacter. If you want the callback function to be launched as soon as there is a byte in the input buffer, you should use the LWRS_RXCHAR as eventMask parameter:

InstallComCallback (comport, LWRS_RXCHAR, 1, 0, ReadComPortCallback, NULL);

0 Kudos
Message 2 of 2
(3,675 Views)