From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SR810 lock in does not respond serial communication

Hi,

I am trying to read from SR810 lock in amplifier using RSR-232 serial port, but I have little success in comunicating with the instrument. At first, I tried to initialize the instrument but I always get timeout errors when a visa read command is given. (No error when use visa write command). Therefore, I tried the basic serial write and read.vi to communicate with the instrument but the instrument is not even responding to the ID query (*IDN?, listed on the instrument manual). The status indicators (active, error and remote) on the front panel of the machine were also not lighten up. 

 

I am using a 25 pin (instrument) to 9 pin (laptop) cable to connect the lock-in to the computer. I tested the cable by shortening pin 2 and pin 3 on the 25 end and I was able get my inputs back using the basic serial write and read. vi. (Therefore, I assume there is no problem with the cable.). I set the communication interface as RS232 on the front panel of the instrument (since the instrument is not responding to the OUTX command as well).

 

The instrument supports both GPIB and RS232 interface and the manual says that the active indicator flashes whenever a character is received or transmitted over either interface. Since the light didn't flash when I wrote, I assumed no communication was made. But I don't understand how could the cable be connected but can't talk to the instrument. (I have looked at the drivers provided by NI for both SR810 and SR830 but didn't not find many helps.)

 

Could someone help me with this? I saw some people here used the SR 8xx lock-in amplifier and also many people have greate experience on serial communication with instrument. I hope you can give me some suggestion. Thanks a lot for the help in advance. 

0 Kudos
Message 1 of 12
(5,240 Views)

When debugging RS232 communication, I always start with Hyperterminal or something like it.

And select a query which the instrument must respond to.

 

 

0 Kudos
Message 2 of 12
(5,237 Views)

I do not know that instrument, but I will offer some generic suggestions.

 

Your description sounds like you do not have something set up right in the communications.

1. Do you have the configuration right? Baud, start and stop bits, number of data bits, parity, handshaking, and termination character? If even one of these is wrong, the communications will probably fail.

2. Does the instrument require you to send an end of message character such as carriage return or linefeed?  If it does require this, are you actually sending it?  The Basic Serial Read and Write.vi does NOT send termination characters by default.

 

Lynn

0 Kudos
Message 3 of 12
(5,234 Views)
The loopback test is essentially meaningless. All that it tells you is the pc's com port is working. It does not tell you if you are wired to the correct pins on the instrument. It does not tell you if you have the correct com settings. Likewise, not getting an error on a write is also meaningless. You could disconnect the cable and do a write without an error. Double check the cable type and the com settings. Double check the expected termination character.
0 Kudos
Message 4 of 12
(5,233 Views)

Hi,

 

I also wanted to control a RS830 lock-in amplifier through RS232 connection, but found that the

Labview instrument driver works only with GPIB connection. So I modified the Initialize.vi for

RS232 connection. Please take a look at the vi attached to this post.

 

In order to use this vi,

1) install the NI instrument driver for RS830,

2) download "Initialize_Serial.vi" from this post, take a look at the block diagram and modify it to

match your communication protocol setup.

3)put it into the folder,

C:\Program Files (x86)\National Instruments\LabVIEW 20xx\instr.lib\Stanford Research 830\Public

(If you are using the 64-bit version, remove (x86). In the path shown above, 20xx should be changed corresponding to your Labview version.)

4) Open "Stanford Research 830.pvproj" and add "Intialize_Serial.vi" in the section "Standord Research 830.lvlib - Public".

5) Go to [Tools]>[Advanced]>[Edit palette Set] and add "Initialize_Serial" in the SR830 palette.

 

 

After the RS830 is initialized by this vi, all other vis in the "Stanford Research 830" palette should

work fine through RS232 connection (I have note tested all of them, though).

 

Please give it a try and let me know if it works OK or not in your environment.

Hope this is helpful for others.

 

Message 5 of 12
(5,127 Views)

Hi,

 

Thanks for posting the VI for accessing the lockin via RS232. I'm using a USB to Serial RS-232 Adapter, and I'm having some luck communicating. It's worth noting that "Fetch Buffer.vi" doesn't seem to work properly using the "TRCB?" command it's set to use by default. From the manual section regarding the TRCB? command:

 


When using the RS-232 interface, the word length must be 8 bits. The points must be read as binary bytes (no checking for linefeeds, carriage returns or other control characters). Most serial interface drivers are designed for ASCII text only and will not work here. In addition, the data  transfer does not pause between bytes. The receiving interface must always be ready to receive the next byte. In general, using binary transfers on the RS-232 interface is not recommended.



I switched it to use the TRCA? command instead, which outputs text in ASCII. Just a heads up for others out there.

0 Kudos
Message 6 of 12
(4,977 Views)

Thank you sooooo much for "Initialize_Serial.vi"! I have been fighting with my SR810 for hours until I saw your post. Now everything works fine.

0 Kudos
Message 7 of 12
(4,826 Views)

We used this for a while, but ended up moving back to GPIB because it would give us errors after too many repeated communications (usually ~400). I think the instrument was having trouble communicating too quickly over serial.

0 Kudos
Message 8 of 12
(4,777 Views)
There is the VISA initialize Serial Port on your palette. That is all that you needed.
0 Kudos
Message 9 of 12
(4,765 Views)

thanks . it is working

0 Kudos
Message 10 of 12
(4,298 Views)