03-11-2014 12:51 PM
I'm very new to labview (like 2 days experience) but I am getting confused by serial timeout.
My device is a DigiX (digistump, some what like an Arduino) board.
At first I was getting a read timeout error as the default for the visa config seria vi is to use a termination character. The board I'm communicating with has no termination character. After searching the this forum and setting the Terminal Char Enable to false (Block Diagram) still getting a read timeout error (same error it seems most newbies get: Timeout expired before operation complete).
After looking at more posts on this forum I noticed some suggestions about putting timers between the serial write and read and some
suggestions to use Bytes at Port to input to the read. So I now have a write followed by a 50ms timer followed by a Bytes at Port and then
the read.
Here's the problem. I get a status code (1073676294, number of bytes transferred is equal to the input count) which is not an error but
when I run this it takes the full 10 seconds of the visa serial timer to complete. Can someone explain what is going on (in the visa config serial vi Front Panel the termination character seems to always return to LF even when I try setting to 0, is it possible putting the timer
and Byte at Port are masking an underlying problem)?
Thanks in advance for any help.
Dave
03-11-2014 02:59 PM
It would be helpful to see some code.
Once you disable the termination character, it doesn't matter what the termination is set to (since it is being ignored).
The warning is common just because you are grabbing all of the data that is in the port and your instrument isn't sending more data. It does bother me that you claim it is taking the full timeout to complete the read. Again, show us some code so that we can help debug.
03-11-2014 03:32 PM
Hello crossrulz,
I think I finally found a solution. After much googling I came across an NI article regarding the VISA configure serial port.
It talks about the End Mode For Reads (Serial Settings) and setting this to zero to stop using the termination character.
At this point the little test program runs as I think it should, speed wise. But it's curious why setting the Termination Char Enable
to false was not enough and I had to set the End Mode for Reads.
Thanks for the response.
Dave
03-11-2014 04:06 PM
You set the Enable Termination Character to False on the VISA Configure Serial Port.
Just like Crossrulz said. You didn't do anything special beyond that.