LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set SR830 Harmonic Number?

I am doing a lock-in detection using a 5 kHz reference signal; I am using the SR830 lock-in amplifier to do this. I want to do detection at both 5 kHz and 10 kHz. After looking at the list of “Remote Programming” commands in the SR830 manual I found that the command “HARM{i}” can be used to detect a signal at harmonic number “i” at the input. So for my purposes I only need values of “i” as 1 and 2. I wrote a simple VI file with the name “TDXN_set_harmonic1.vi” (attached below) to implement this. But it doesn’t work!

 

Alternatively, I opened the built-in file “SR830.vi” which is basically a virtual front panel of the entire SR830 itself. It tried to look at the block diagram of the numeric control called “osc.harm#” where I can set the harmonic number. But the recessed box in which that numeric control resides in this so-called “cluster” (sorry, I’m new to LabVIEW). So I copy-pasted all the controls in my own file and tried setting the harmonic number to the value I wanted. That worked. I have attached that file under the name “TDXN_set_harmonic2.vi” as well. Can someone tell me what’s wrong with my (first) simple file? I could just keep copy-pasting from the built-in file for future programs. But I don’t want the hassle of setting all these other controls every time.

 

Thanks.

Download All
0 Kudos
Message 1 of 4
(3,384 Views)

Hi tdeshp,

 

I tried to open those files but I guess they are missing some VIs that came with the SR830. I'm glad the copy paste thing worked. You could try to just paste that particular cluster and copy the code inside the corresponding sequence structure. The sequence structure (which is the box that looks like a film strip) is basically something that forces the code to run in a particular order from 0-10 in this case. If you right click and press flatten sequence structure you'll be able to see it a bit more clearly. We actually discourage the use of stacked sequence structures becuase they are difficult to understand conceptually and all the code visible. I would imagine that the reason your version isn't working is that some sort of setup or configuration is happening in one of the earlier slides on the sequence structure that is necessary before the harmonic number can be extracted. However, without seeing the subVIs I won't know for sure. I hope this helps.

 

Basil

Applications Engineering

National Instruments

0 Kudos
Message 2 of 4
(3,342 Views)

Thanks for the input Basil. Sorry about not including the SR830 libraries. I actually found what I was screwing up. It was a very silly syntax error. In my manual I have the command listed "HARM (?) {i}" verbatim where "i" is the same one from my previous post where I'm trying to use "HARM{i}." The "?" is missing because I am setting it instead of querying it. It turns out that I don't have to put the "{}" around the "i"! After I removed that it worked just fine.

 

Anyways, thanks for the useful tips. The reason I feel so comfortable with the sequence structure is that I am not used to graphical programming; i.e. when I formulate the algorithm in my mind I lay out the steps sequentially, and I don't want a later step executing before a step that I want to execute first. For a moment I also suspected that some earlier frame (before I try setting the harmonic) might be giving problems thus not letting the program to get to the frame I want. But I debugged those parts already.

 

Thanks again.

0 Kudos
Message 3 of 4
(3,335 Views)

You're very welcome! I'm glad you got it figured out and we really appreciate you posting that solution for others to refer to.

0 Kudos
Message 4 of 4
(3,321 Views)