Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA serial port problems

Pardon my stupidity, but I'm new to all this and trying to use basic VISA functionality (from NI-MAX) to verify serial port functionality.  I connect through COM1 to UUT.  When I boot UUT, and check receive buffer with VISA GUI tool, it looks fine.  I see proper data that is streaming from UUT.  The receive data ends at a boot prompt sent by UUT. 
 
At this point, I transmit data, and follow that by looking at receive buffer, all that shows in receive buffer is exactly what I transmitted (minus line-feed character).  I know that the UUT is actually sending repeated login prompts since I'm not send the proper login ID, but I NEVER see these once I've transmitted for the first time.  Only if I jump to hyperterminal to verify I'm not going crazy.  What am I missing? 
 
Thanks for any info....
0 Kudos
Message 1 of 3
(3,337 Views)

No pardons needed, we all started at the same place.  I do have a few questions for you, though.

1)  I am assuming by "VISA GUI tool" you mean "VISA Test Panel", is that correct? 

2)  By "check receive buffer" do you mean you are reading the "Bytes at Serial Port" property? 

3)  Are you then doing a "Read" on the "Basic I/O" tab to see the data? 

4)  By "boot prompt sent by UUT" do you mean a termination character?  There is an excellent tutorial entitled Termination Characters in NI-VISA if you'd like to read up on them.

5)  If I understand you correctly, you then do a "Write" followed by a "Read" and all you get back from the "Read" is what you sent in the "Write"? 

6)  I would be interested in seeing a .spy capture of this behavior.  Are you familiar with NI-Spy?  Can you post a .spy capture?  

 
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,301 Views)
Robert,
 
I made some headway, by playing around with termination characters in send string.  I was wrong in assuming that line-feed char ("\n") was correct way to terminate transmit string.  Once I began terminating with CR ("\r") instead, I am able to talk back and forth.   I'm curious why line feed termination causes data to seemingly loopback from transmit to receive buffer, but my problem seems to be resolved now.  I'll continue to take baby steps for awhile, but I really appreciate your help.
 
But just FYI....In response to your questions....your assumptions were correct.....
 
1) Yes, Visa Test Panel.
2) Not sure
3) Yes.  From "Basic I/O" tab I'm entering data string into buffer window (within "write" sub-tab), then reading back from receive buffer using "read" sub-tab.  I am reducing read length to ensure I don't get a timeout condition, waiting for more data that was transmitted. 
4) by "boot prompt.." I meant custom transmit string sent by UUT (in this case, literally a prompt for user to "Login:")
5) Yes, you're correct.
6) If I get hung up again I will likely follow this path....
 
The link you sent to termination characters will be very helpful, as will NI-spy I'm sure.
 
Thanks very much!
0 Kudos
Message 3 of 3
(3,296 Views)