LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why is rs232 visa write timing out

Hi,
I am new to using RS232 to communicate with instruments, and I am having some problems with talking to the instrument.  I am using Labview 2009, Win7x64, NIVISA 4.6 to try to talk to an old Oxford Instruments PS120-10 superconducting magnet power supply.  The problem I am having is that the VISA write command times out when I try to talk to the instrument.  I don't really understand what is causing the timeout because a timeout error would imply that the computer is expecting an answer from the instrument, and as far as I can tell a write command doesn't need a response; I am under the impression that there is no handshaking required with RS232 - in other words I am just sending the instrument a start bit, 8 data bits, and 2 stop bits.  Can someone enlighten me on what I should expect from RS232 communications?  I've tried using a simple VI as well as MAX with the same result.  I have verified the communication protocol in MAX and the Visa Configure Serial Port VI match what the instrument manual specifies (9600 baud, 1 start bit, 2 stop bits, no parity, commands end with carriage return).  The instrument never goes into its remote mode (the command I am trying to send it tells it to go into remote mode).  If I send the same command over GPIB to a newer version of this same power supply the instrument goes into remote mode.  The instrument manual says the instrument is configured as a DCE, the computer should be configured as a DTE.  The pin-outs should be 2: TxD, 3: RxD, 4: RTS, 5: CTS, 6: DSR, 7: GND, 8: DCD.  The cable I am using has a DB9 connector for the computer end and a DB25 for the instrument with the folloiwng DB9-DB25 mapping: 1-8, 2-3, 3-2, 4-20, 5-7, 6-6, 7-4, 8-5, 9-22. 

 

Does anyone have any ideas for what I may be doing wrong?  I'm running out of ideas...

0 Kudos
Message 1 of 5
(2,441 Views)

I have used RS232 for communication for a long time. However, never had a chance (or rather need) to connect any other pin than the RxD/TxD/Gnd pins between the PC and the device / instrument.

I think the problem is likely due to the extra control lines in use (like RTS or CTS).

0 Kudos
Message 2 of 5
(2,411 Views)

I think Deepu is right.

 

According to the manual "...the power supply only requires pins 2,3 and 7..."  Try a simple cable with only RxD, TxD, and Ground.

 

Lynn

0 Kudos
Message 3 of 5
(2,408 Views)

So I was able to hook the power supply up to a different computer, and this computer is able to communicate with the power supply without any problems.  So the original computer appears to have issues with Labview/MAX communicating with the PCIe-RS232 card.  The Windows device manager says the RS232 card is working, and MAX says it is able to open a VISA session to the COM port when I click "Validate".  Does anyone have any advice for how to troubleshoot the communication between the RS232 card and Labview?

0 Kudos
Message 4 of 5
(2,374 Views)

I agree with suggestions above.  I can only think of bad flow control to justify this. 

 

Few other ideas:

  - Make yourself a DB9 loopback cable and see if it works on the LabVIEW PC (they always come in handy for troubleshooting, it's worth having one)

  - Make sure that you configure your COM port in LabVIEW to use no handshaking (or the proper one). 

  - Try bypassing LabVIEW: Open a serial connection over the same COM port using Putty or another basic program to talk to your instrument (or with a loopback plug and see if it works.)

 

0 Kudos
Message 5 of 5
(2,363 Views)