Yes, you are right. When I close the loopback.vi and run the serial communication.vi, I got response "hello\r\n". Now, I guess the problem is that when I use text file as input commands, each time we hit "enter", it was read as "\r\n". In the instrument manual, at end of each command, a "\r" is needed, but no "\n". How to edit Commands in a binary mode in order that there is no "\r\n" added.
Another case I tried is that I delete "enter" after "hello" in "test.txt", then I got error-1073807339 occurred at VISA Read in Serial Read with Timeout.vi-. Serial Communication.vi, Possible reasons: VISA: (Hex 0xBFFF0015) Timeout expired before operation completed. Does that mean that the command doesn't finish, the vi always wait.
Hopfully, we can solve the problem this time. Please help.