From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 returning odd results

Solved!
Go to solution

Using MAX to write and read serial port. This piece of hardware and cable works fine on two other machines (running Win2K); returns the correct values in ASCII. On another machine (running XP) the reply is something else; instead of ASCII, it is "\x**" repeated several times, where each group of four characters starts with \x and the other vary. MAX version is 2.2 on all machines.

The behavior is much the same using a vi in LabVIEW 6.1 (on all machines); correct ASCII on two machines, garbage (different garbage) on the third machine.

Is this a format problem? I don't see any way to configure the serial ports for different formats.

0 Kudos
Message 1 of 9
(4,088 Views)
Solution
Accepted by topic author cpaine

cpaine,

 

Can you please more information about the differences between the two computer systems. Specifically what driver versions are on the working machine and the garbage machine? It sounds like it could potentially be a problem with the one specific machine, but I would like to investigate into it further.

 

Thanks

Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 9
(4,060 Views)

First, not sure why this page now says "solved"; I may have hit the wrong button. It isn't solved yet.

 

OK, to your question;

There are two "good" machines (I spoke of only one, for clarity): both desktops, both running Win2K, LabVIEW 6.1, MAX 2.2

The one  "bad" machine is a laptop running XP, LV 6.1, MAX 2.2

 

I've since tried it on an XP laptop with MAX 3.1: same bad behavior.

Also tried on an XP desktop with MAX 2.2: same bad behavior.

 

So the only common element I've found is XP vs 2K. But with the "bad" laptop sitting next to a "good" desktop, I cannot find any difference in the COM port configs, neither with MAX nor using the Windows System/Hardware utility. 

 

Also tried with another unit of the same type, on an XP machine; same bad result. 

0 Kudos
Message 3 of 9
(4,042 Views)

Hey cpaine,

 

So my suggestion would be since there is a distinct difference between Windows XP and Windows 2000, if you look at the options in MAX for the Windows XP please make sure you are aware of the how it is supposed to be viewed. I have attached a picture that shows exactly what I am referencing. 

 

Also, if that is unable to give some incite I would like to check the commands that you are actually sending. Can you please send me an NI Spy capture of the Windows 2000 machine and then another NI Spy capture from the Windows XP where you perform the exact same operation. That would really help with troubleshooting. If you have questions on how to perform a NI Spy capture, please reference  KnowledgeBase 4P3FR2LQ: Performing a Good NI Spy Capture for Debugging/Troubleshooting.

 

Thanks

Message Edited by Sarah_S on 12-10-2008 10:37 AM
Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 9
(4,015 Views)

Sarah; Thanks for the response.

MAX 2.2 doesn't have the ASCII/hex/both option. MAX 3.1 does;  "both" shows the "\x**\" format I described, "hex" shows just the ** characters, ASCII-only shows nothing.

I'll get some NISpy captures. I'd started fiddling with that.

 

A couple of other things I've found may be relevant.

First, it seems that commands are not getting to, or getting recognized by, the instrument. There is a "blink the light" command that works immediately on the "good" machines, but not on the others.

Second, I'm using VISA-serial vi's for the work I've described so far. I have another instrument with which I use only serial vi's, not the VISA-serial; the "works on this machine, not on that machine" behavior is the same.

These two things together suggest to me that it may be a termination problem; a LF or CR incorrect, or some such. Does this suggest anything to you?

Many thanks for the help.

 

cpaine

0 Kudos
Message 5 of 9
(4,003 Views)

Sarah;

 

Attached are two NISpy captures.  The options were not exactly as per the Knowledge Base page; I probably have an earlier version.

 

Both machines are running LV 6.1, MAX 2.2. Both captures were done by running MAX COM port VISA session.

 

The command is "@254TST!OFF;FF" as specified by the manufacturer. The response should be "@253ACKOFF;FF"; in the good case, it is. 

 

 

0 Kudos
Message 6 of 9
(3,987 Views)

This time with the attachments...

 

Sarah;

Attached are two NISpy captures.  The options were not exactly as per the Knowledge Base page; I probably have an earlier version. 

Both machines are running LV 6.1, MAX 2.2. Both captures were done by running MAX COM port VISA session.


The command is "@254TST!OFF;FF" as specified by the manufacturer. The response should be "@253ACKOFF;FF"; in the good case, it is. 

Download All
0 Kudos
Message 7 of 9
(3,983 Views)

Hey cpaine,

 

It doesn't seem that the attachments went through. Can you check that? 

 

Thanks!

Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 8 of 9
(3,982 Views)

Hey cpaine,

 

Looking through the NI Spy captures, it appears that you are running into a VI_ERROR_ASRL_FRAMING error. The following KnowledgeBase 3JFBMM6K: What Does Framing Error in Serial Communication Mean? references reasons why this error would be occuring.

 

Please let me know if this is able to resolve the issues you are seeing.

 

Thanks

Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 9 of 9
(3,953 Views)