LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read new line of returned message

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

0 Kudos
Message 1 of 8
(3,127 Views)

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:

0 Kudos
Message 2 of 8
(3,123 Views)

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.

Omar
0 Kudos
Message 3 of 8
(3,119 Views)

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.

0 Kudos
Message 4 of 8
(3,118 Views)

I tried to set Enable Termination Char to OFF, but the same problem still exists.

0 Kudos
Message 5 of 8
(3,101 Views)

How should I read one line three times? For loop apparently doesn't work.

0 Kudos
Message 6 of 8
(3,099 Views)

WHich instrument are you interfacing, try searching the labview drivers in here might help you.

0 Kudos
Message 7 of 8
(3,097 Views)

Disabling the termination character or a for loop should work. Attach your code so someone can see exactly what you have done.

0 Kudos
Message 8 of 8
(3,094 Views)