Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 communication problem

using ComCallBack with CVI 6: I activated the callback routing on every incomming character. working good. However, the last character in the incomming string duplicates itself several times. It looks as if the callback routine is running several times after the string transmission finished. Any idea what could cause it?
0 Kudos
Message 1 of 5
(3,774 Views)
Hello

Have you been able to verify this by doing a loopback test and verify the size of the data written and the data returned?

This also sounds like something the help for InstallComCallback mentions
"Since the callback is internally called via a window message, the callback can get called even when there are no bytes in the input queue, even though there were some at the time the message was posted. Calling ComRd multiple times in the callback can lead to this kind of issues. For this reason, It is recommended to always check the input queue size before doing anything in the callback."

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
Message 2 of 5
(3,774 Views)
Thanks Bilal,
I ignored the callback routine while QLen=0 and that solved the problem.
0 Kudos
Message 3 of 5
(3,774 Views)

can function InstallComCallback be used for checking number of bytes in output queue ?

 

br

milan.

0 Kudos
Message 4 of 5
(3,436 Views)
STOP!!!!!
0 Kudos
Message 5 of 5
(3,433 Views)