ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication

Hi,
I have a custom built board that connects to the PC serial port and talk to it thru hyper terminal OK. But when I used the "Basic serial write and read.vi" from LabVIEW examples to communicate with my board then I can't read back the data consistently where as the hyper terminal reads back data perfectly every time. I have made sure serial configuration is the same for both cases.
What else do I miss ? Please give me some ideas. Thanks
Dan 
0 Kudos
Message 1 of 7
(6,757 Views)
A common mistake is to not send a termination character. Are you sending a \r\n (Carriage Retrun\Line Feed) at the end of your commands?
0 Kudos
Message 2 of 7
(6,742 Views)
Hi,
I do have \n\r at the end of my command. Does the oder of them matter ? \r\n or \n\r .
Thanks
Dan
0 Kudos
Message 3 of 7
(6,699 Views)
It matters if the instrument is expecting them in a certain order.Smiley Wink It's easy to check to see if it matters with your board by simply swapping the characters.
0 Kudos
Message 4 of 7
(6,692 Views)

Hi Dennis,
I did try with the \r\n order after reading your first response. And surely enough, it WORKED most of the time. Smiley Very Happy Thanks a lot. You saved me a lot of troubleshooting hours.

Also thank you NI for having this discussion forum. You have saved people like me from a lot of headache!

Dan 

0 Kudos
Message 5 of 7
(6,682 Views)
could you send me the vi file
i am also trying to do the same thing
to imitate the hyper terminal
 
thanks.
-Just a student-
0 Kudos
Message 6 of 7
(6,460 Views)


@Nandha wrote:
could you send me the vi file
i am also trying to do the same thing
to imitate the hyper terminal
 
thanks.



Hi - try this. I found it on this site a while back. I think I may have modified it slightly for my particular application but it's still pretty generic.

Jon.
0 Kudos
Message 7 of 7
(6,441 Views)