Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5663

usb rs232 problem

$
0
0

Hi everyone,

 

I have been fruitlessly searching for some solution to an issue I seem to be having with communication to a serial device using a USB to rs232 converter.

I am using Labview 2013 on a windows 7 computer and using a converter using the FTDI chip.  My computer recognizese the converter, and NI-MAX recognizes it as ASRL7::INSTR which I have named "pc830."  I have attached a screenshot of my VI.

 

I am attempting to write a command to a pc830 (p 169,170 for relevant ASCII write/read commands) requesting position data from a piston. The issue I am encountering is that, while I can send a command, I am not receiving any data back during the read portion of my program and timing out my connection (Error -1073807339 occurred at VISA Read in PC830PosVelExtractor.vi, VISA:  (Hex 0xBFFF0015) Timeout expired before operation completed.).

 

The first and obvious questions are whether the serial port settings I am using are correct.  I am essentially rewriting a previous Labview program that use to control this same piston.  I have taken (and verified) that these are the correct values (baud rate, stop bit, etc).  Additionally, this older program sending the message \02255\sR\s10034:96\r gets back a reply from the serial device with position data (eg \02V26057:148\r).  I have checked that the hex version of the message sent by my new program is the same as the old one.

 

Now, to check that the USB cable is actually working, I performed a loopback test by opening a VISA test window.  In this, by shorting the cable in an rs232 configuration, I was able to successfully send and receive that same \02255\sR\s10034:96\r command.  I had a timeout issue before, however, I enabled the terminal character, and this went away.  The message is sent and received without issue.

 

Going back to my program, I similarly enabled the terminal character (\r) at the serial port hoping to get rid of the issue.  When connected to my serial device, I still get the timeout issue at the reading.  However, if I once again short the cable in an rs232 loopback configuration, I can send and receive my message \02255\sR\s10034:96\r without issue.

 

I actually connected the old and new program together by the cable just to see that I could talk with other devices.  This works fine, and I can both read and write back and forth from each of the programs.

 

My most recent attempt to diagnose/fix the issue was to add a "flush read buffer" just before performing the read/write operation.  This has not changed anything as far as I can tell.

 

I would love to hear back from anyone with suggestions as I'm just about out of ideas at this point.  We don't have space to add a serial port to the computer, and reviews of converters with FTDI chips seem to be good.  How can I get this thing to talk!?


Viewing all articles
Browse latest Browse all 5663

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>