이 내용은 고객님의 설정 언어로 확인할 수 없습니다

이 내용은 다른 사용 가능한 언어로 표시됩니다. 고객님께서 사용하시는 브라우저에 텍스트 번역에 도움이되는 기능이 포함되어 있을 수 있습니다.

Serial VISA Read Terminates Before Specified Number of Bytes Has Been Read

Updated Apr 1, 2026

Reported In

Software

  • LabVIEW

Driver

  • NI-VISA

Issue Details

  • VISA Read will return from reading after it receives a termination character, even if it has not yet received the number of bytes specified. Is there a way to circumvent this and read the full message, including any termination characters?
  • I need to configure serial communication using NI-VISA that is capable of reading 256 ASCII characters, where any termination characters are read as literals instead of terminating the read operation. How can I do this?

Solution

To continue reading a string even after a termination character is received, it is necessary to set the Termination Character Enable and Serial End Mode properties using a Property Node. Follow the steps below to implement this:

 

  1. Place a Property Node on the Block Diagram of your VI.
  2. Connect your VISA resource name to the Reference input of the Property Node.
  3. Right-click the Property element of the Property Node and click Change All To Write from the shortcut menu.
  4. Drag the bottom edge of the Property Node to reveal two property elements instead of one.
  5. Click the first Property element and select Messager Based Settings >> Termination Character Enable.
  6. Right-click this property and select Create >> Constant. Ensure this value is set to False (which it is by default).
  7. Click the second Property element and select Serial Settings >> End Mode for Reads.
  8. Right-click on this property and select Create >> Constant. Ensure this value is set to None.
    • By default, VISA sessions will use a termination character of line feed, 0x0A or \n.

The code snippet below is an example of a simple serial read and write using NI-VISA, where the properties described above have been configured to ensure that the full message (including termination characters is read):

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.