From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, 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: 

Read timeout with USB-serial adapter

Solved!
Go to solution

Hi everyone,

 

sorry to post this kind of question again, but I've spent 2 days browsing this forum, the Mathworks forum, and several web pages, I still can't find the trick that will solve my problem 😞

I am trying to control an Agilent 34970A (with the 34908A 40-channel module) to read temperature values from thermocouples. I am using a laptop (win7/64) and a USB-to-serial adapter (MCT U232-P9, which uses the Philips P87C52X2BA chipset, not the FTDI, in case it makes a difference) and I installed the driver for this adapter. The adapter is recognized by Windows and appears as COM4.

I set the COM port parameters in Windows as they are on the device (9600 Baud, Parity:none, 8 Data bits, Flow Control: Xon/Xoff; the stop bits are not specified on the device).

And... TADAAA... it doesn't work!

I tried using NI MAX (version 5.5), LabView (version 2013/32-bits), and MatLab (R2012b) to send the *IDN? command and read the answer. The "write" part goes ok (at least it doesn't generate an error, but I don't know if the command reaches the instrument), but there is no answer from the device. If I try reading from the COM port, I get the 1073807339 error (timeout before operation completed). I tried to look if there were any Bytes to be read at the port, but there are none...

In LabView, I set the Xon and Xoff characters to those specified in the Agilent manual (0x11 for Xon and 0x13 for Xoff), but there are a few other parameters I'm not so sure about: 'Enable Termination Char' (Should be On or Off? Tried both - no change) and the termination char itself (I left it to the default '\n').

 

I know this is not really an NI/Labview issue, but since so many people in this community seem to have experienced this problem, I would be very grateful if anyone can help me solve this!

Thanks in advance

 

Mathieu

0 Kudos
Message 1 of 7
(12,620 Views)
Make sure the instrument is configured for serial communication and not GPIB, USB, or Ethernet. Check the port settings while you are there. Then check the type of serial cable you are using. I believe it requires a null modem cable.
0 Kudos
Message 2 of 7
(12,611 Views)

Dear Dennis,

 

Thanks for your reply. My instrument is configured for RS-232 communication (but you are right, GPIB is the default setting), and I checked the settings once more: 9600 Baud, Parity: None,8 data bits, Xon/Xoff Flow Control, which are the same as those configured on my laptop. As for the null modem/straight through question, I actually don't know how it is wired (the adapter came with no manual, and I couldn't find anything on the web other than an installation guide, as this product is not supported by MCT anymore). Do you know any way to check this?

 

Could there be another reason why the reading/communication with my instrument doesn't work?

 

thanks again

 


mathieu

0 Kudos
Message 3 of 7
(12,585 Views)
You must be using some sort of cable/adapter between the converter and the instrument, aren't you? The converter is a DTE and you need to connect tx to rx.
0 Kudos
Message 4 of 7
(12,581 Views)

No I don't have anything else than the adapter. The MCT device (http://www.mct-us.com/index.php?_Page=product&mode=show&cid=29&pid=65&_lang=E) is an adapter that connects directly to the RS232 connector of my instrument + a USB cable that goes to the usb port on my laptop. Do you mean I should insert a null modem cable between the adapter and my instrument instead of connecting the adapter directly to my instrument?

0 Kudos
Message 5 of 7
(12,577 Views)
Solution
Accepted by topic author matchouze
Yes.
0 Kudos
Message 6 of 7
(12,575 Views)

Thanks so much!

It's such a relief to see it working 😄

0 Kudos
Message 7 of 7
(12,568 Views)