05-12-2011 04:38 PM - edited 05-12-2011 04:39 PM
Hi,
I am new to labview and I am trying to get the return message from an instrument which is three lines long, but only one line gets displayed. How can I read past the carriage return?
Thanks.
Angelia
05-12-2011 04:53 PM
Try this
When you use VISA WRITE to send command, give bit delay & use BYTES AT PORT FUNCTION and wire the output to VISA READ. You must read all the information which the device sends.
Kudos Appreciated :manvery-happy:
05-12-2011 05:02 PM
Check the Termination char setting for comport
http://zone.ni.com/reference/en-XX/help/371361G-01/lvinstio/visa_configure_serial_port/
![]() |
termination char calls for termination of the read operation. The read operation terminates when the termination char is read from the serial device. 0xA is the hex equivalent of a linefeed character (\n). Change the termination char to 0xD for message strings that terminate with a carriage return (\r). |
Or just read it 3 time one line at a time to get all the data. Set the number of bytes to read to something larger than you will ever get back on each line.
05-12-2011 05:04 PM
Your main problem is that you need to set the Enable Termination Character input of the VISA Configiure Serial Port function to false.With it enabled, a read will terminate as soon as the termination character is detected.
05-13-2011 10:44 AM
I tried to set Enable Termination Char to OFF, but the same problem still exists.
05-13-2011 10:46 AM
How should I read one line three times? For loop apparently doesn't work.
05-13-2011 10:58 AM
WHich instrument are you interfacing, try searching the labview drivers in here might help you.
05-13-2011 11:10 AM
Disabling the termination character or a for loop should work. Attach your code so someone can see exactly what you have done.