01-27-2012 03:26 AM - edited 01-27-2012 03:31 AM
Hello,
I have 2 questions about the VISA Read VI;
First of all, is it possible to configure this VI not to stop reading after he finds a carriage return in the string? For example, when you want to read 30 bytes and after 10 bytes he finds a carriage return the VI ends, returning only the first 10 bytes.
And second, how can you use the VISA Read VI if you want to monitor a COM port, without knowing when to read and how much bytes to read? I want to use the VI for continuously polling the COM port.
Thanks in advance,
Dries
01-27-2012 04:28 AM
dries22,
1) I don't think that you will be able to split the string and read it but after reading the string you can split it and use it.
2) You can use the Byte at the Port Property to check number of bytes of data available for reading.
01-27-2012 05:11 AM
Hi
If you disable 'End reading at termination character', you will get all 30 bytes including carriage return.
The Visa read function will wait until it has the bytecount requested. If it has not got it when the timeout limit expires it produces an error.
But this error you could choose to ignore. It will return the contents of the buffer anyway.
Best Regards.
01-27-2012 07:08 AM
Both solutions work. Thank you for the help!