LabWindows/CVI

取消
顯示結果 
搜尋替代 
您的意思是: 

INSTALLCOMCALLBACK

已解決!
前往解決方案

How to call 2 autocall function using same com port 

0 積分
1 條訊息(共 4 條)
3,070 檢視
解決方案
接受者 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?
2 條訊息(共 4 條)
3,015 檢視

             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 積分
3 條訊息(共 4 條)
2,895 檢視

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 積分
4 條訊息(共 4 條)
2,822 檢視