Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up serial connection to 7225 Lock-in amplifier

Solved!
Go to solution

Hey everybody,

I am aware this topic was discussed to some extent in other threads, but after reading them I was still not able to find a solution to my issue.
I am trying to connect to a Signal Recovery 7225 Lock-in amplifier through RS232 serial communication. In NI MAX, I set all parameters according to the manual, 9600 bauds, 7 (or 8, neither works) data bits, 1 stop bit, even parity, DTR/DSR Echo, terminator for both read and write on 'termchar', which is set to 'carriage return' (\r).

According to the manual, the command 'ID' (or also 'ID\r') should have the amplifier respond with its ID '7225'. However, when I hit the 'query' button, I seem to be able to send the command as I get echo-ed back 2(or 3 if I used 'ID\r') bytes, however, the read fails after timeout expired (0xBFFF0015) as the instrument does not respond, so I assume the command settings are still not quite right? In the NI I/O trace also codes 0x08361E38 and 0x038793C0 show up, which I was unable to find anywhere on databases. I did install all NI-VISA USB/RS232 drivers, according to the instrument documentation it does not require one of its own.
Perhaps someone who made a similar instrument work knows what settings I am missing, or perhaps a different mistake.
I am attaching you all material that could be helpful.
Really really really would appreciate a tip or two.

Best regards,

Hannes

P.S.: In the attached instrument documentation, serial communication is referred to in 6.3.02 and following, and the appendix lists all commands alphabetically.

0 Kudos
Message 1 of 5
(1,326 Views)
Solution
Accepted by topic author hannesmichaels

Are you sure your cable is correct. It fact two main versions are available. The norml one and a version in which the wires for send receive and handshake are swapped to make it possible to connect two computers to each other or a computer and a device that finds itself a computer alike. That kind of cable is sometimes called a null modem cable. Because it allows computers to be connected without a modem.

 

So make sure you have a correct cable.

greetings from the Netherlands
Message 2 of 5
(1,324 Views)

I usually first try without NI-Visa, just sending commands via a terminal emulator like TeraTerm or similar. Visa just adds another layer and can make debugging more difficult. 

0 Kudos
Message 3 of 5
(1,233 Views)

Teraterm is another layer too

greetings from the Netherlands
0 Kudos
Message 4 of 5
(1,225 Views)

Hey,

took me some days to get the correct components but made it work. Thank you Albert for the hint. It turned out that the RS232 serial vs modem cross wired cable made the difference, and, stupid me, as a matter of fact it is actually stated in appendix D in the manual that the instrument requires a cross-wired connection.
I can add for someone else running into this issue that after sending the 'ID' query through NI MAX, the instrument reads back '\n*ID\r' directly, and upon a second read command, the 7225 is shown. Running the 'getting_started.vi' from the instrument driver package also works as described.
Thank you everybody for giving this thought!

Best,

Hannes

0 Kudos
Message 5 of 5
(1,218 Views)