LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

INSTALLCOMCALLBACK

Solved!
Go to solution

How to call 2 autocall function using same com port 

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

You can't. You can install only one callback at a time on the COM port and this is clearly explained in the function help. What you can do is create an event mask with more that one condition and discriminate on 'eventMask' variable inside the callback,



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(2,953 Views)

             I have used LWRS_RECEIVE for 1st callback.

         On 2nd callback, i need to open the same comport get data at the time of call of my comport(which is not possible). Shall i use  LWRS_DSR(data set ready) so that the data get automatically using the same port .

     After getting the data I need to hold the data i need to hold that data . how to hold that data

0 Kudos
Message 3 of 4
(2,833 Views)

Depending on how your data is sent to the com port, you could use LWRS_RECEIVE (if fixed amount of data is sent each time) or LWRS_RXFLAG (if a termination character is present, e.g. CR or LF) or LWRS_RXCHAR if none of the above is verified. The last condition is the most difficult to handle, since the event is not sent on every character received: you need to check if any additional character is present in the queue when the callback is fired; also, be aware of this note in the help:

The callback can get called when there are no bytes in the input queue, even though there were bytes at the time the message was posted. For example, calling ComRd multiple times in the callback can lead to this situation. For this reason, NI recommends that you always check the input queue size before performing any operation in the callback.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(2,760 Views)