GPIB Control of frequency gen and spectrum analyzer. - Page 1
Forum section: electronics / testgear

author: FB72
author_rank: Contributor
timestamp: October 07, 2018, 08:09:22 pm
content: Hello All,Just wanted to get your thoughts before I decide to buy a GPIB to USB adapter.I have a Takeda Rikken TR4132 Spectrum Analyzer with the TR41901B memory unit and an Anritsu MG3601A RF frequency generator.I would someday like to build my own radio of some sort (I have LOTS to learn before that happens). But I was curious and experimenting with filters the other day and built a small band-pass 13.5MHz crystal filter with some crystals I had in a misc. box. I didn't spend any time to mix and match crystals as I just wanted to experiment and learn more about operating my test equipment.Anyway, the issues I am running in to is my spectrum analyzer is a rather basic model, the minimum frequency/ X division is can display is 0.1MHz, so 1MHz across the width of the display, which makes it pretty hard to look at a bandpass filter with less than 100Khz bandwidth or so.To make a Bode plot, I was setting my spectrum analyzer's memory unit to display MAX values at each X (frequency) location while I manually cranked the RF gen through a frequency range. Big problem is, when in MAX hold and sweeping across the passing frequencies, the displayed form is wider than the drop-offs of the pass band, so it overwrites the "edges" when swept through the pass band. (I may need to get a picture to explain better)But, Looking into the memory unit on my analyzer, it works by breaking down the X-axis (frequency) into 511 locations, the Y-axis, is broken down into 0 to 800. This brings me to my idea.I am wondering if I can use the GPIB ports (on both spectrum analyzer and RF gen) to control the frequency steps and then read out the values at each X location on the analyzer to make a better Bode plot on the computer? To get around the issue above, I'm thinking I would set the RF gen frequency, read the values from 0 to 511, then step the frequency, and do it again. I would somehow, in my output, need to keep the above issue from happening, so I think I would only record the max value from each sweep. One thing that would be troublesome, is if the SA drifts center frequency, it would throw it off. To overcome, the program to perform the control and data recording could be fun.The SA memory unit has all the functions I should need in the GPIB instructions, RF gen has so many GPIB controls, that it could be a fun one to figure out.I'm looking at a Prologix GPIB to USB, although more costly than others, seems to be the most supported by opensource GPIB PC software.Anyway, any thoughts?Thanks!(I attached the TR4132 specifications page)

author: bitseeker
author_rank: Super Contributor
timestamp: October 08, 2018, 04:17:54 am
content: So, the idea is to remotely step the RF generator and measure the signal as a kind of tracking generator? Sounds plausible, though I'm not sure how fast it'll be. An alternative to sweeping the RF generator is to use a noise generator that covers the desired spectrum.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: October 08, 2018, 05:40:33 pm
content: Completely plausible. If you think about it, what you are doing is using your spectrum analyzer as a crude tracking filter and ac voltmeter. Thinking about it that way will help you dodge a couple of speed bumps in implementation.

author: bitseeker
author_rank: Super Contributor
timestamp: October 08, 2018, 05:44:09 pm
content: Looking forward to seeing how it turns out, FB72.

author: FB72
author_rank: Contributor
timestamp: October 09, 2018, 06:48:54 pm
content: So I have ordered a GPIB daisy chain cable and a USB adapter. I went with the cheaper "UGPlus" adapter. We will see how well it works, it has the necessary files to use it with VB studio. It's been a long time since I've worked with VB, so this could be fun too.

author: bitseeker
author_rank: Super Contributor
timestamp: October 09, 2018, 09:15:46 pm
content: I don't recall if that version of their adapters has proper line drivers. If not, it should still be OK as long as the cable is short and the number of instruments in the chain is at most two or three. Check the specs to be sure.

author: FB72
author_rank: Contributor
timestamp: October 10, 2018, 12:28:53 am
content: I dont think it does, they claim it can run up to 5 machines. I grabbed a 1 meter cable to keep the run short. They sit next to each other anyway. I worry about the spectrum analyzer, it doesn't say anywhere that its GPIB follows IEEE 488 (or any other standard), and it has direct support for an HP plotter or a TR plotter. There is a dip switch on the back to set the GPIB address and one of the switches selects either HP or TR plotter. But the analyzer memory unit is early to mid 80s so who knows.

author: bitseeker
author_rank: Super Contributor
timestamp: October 10, 2018, 07:10:51 am
content: That sounds about right for GPIB without line drivers. The maximum number of devices that will work also depends on how picky the devices themselves are.As for GPIB standards and IEEE 488, it's probably too old to have that particular standard labeled. Electrically, it'll probably be fine. The commands, though, are likely to be proprietary. So, you'll definitely need documentation on what to send to it to make it do things.

author: FB72
author_rank: Contributor
timestamp: October 10, 2018, 10:45:20 am
content: I do have the manuals for the analyzer, Advantest was nice enough to post all the manuals/documentation for their discontinued models.

author: bitseeker
author_rank: Super Contributor
timestamp: October 10, 2018, 05:59:32 pm
content: Great. Have fun and post an update with how it all turns out.

author: FB72
author_rank: Contributor
timestamp: October 17, 2018, 01:43:45 am
content: So far so good,The UGplus GPIB to USB cable and software showed up as well as the GPIB link cable.Once I loaded the test software, both the RF gen and Spectrum analyzer initialized successfully!I was able to use the basic test software to send commands to the spectrum analyzer and read data back from it as well.I was quite surprised that the software installed and operated within five minutes, doesn't get much better than that!Next is trying to get a VB program going that can send/receive through the GPIB adapter.

author: bitseeker
author_rank: Super Contributor
timestamp: October 17, 2018, 02:18:08 am
content: Very cool! It certainly is nice when things work straight away.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: October 17, 2018, 04:04:39 pm
content: Will be interested to hear how the VB interface goes. I have one of those adaptors, and got the test interface you show working easily. Had less luck interfacing with VB or other programs. Largely my fault and lack of programming skill so it would be good to see how someone else accomplished it.

author: bitseeker
author_rank: Super Contributor
timestamp: October 20, 2018, 04:58:13 am
content: A positive result sounds like a good GitHub project release.

author: FB72
author_rank: Contributor
timestamp: October 28, 2018, 06:54:51 pm
content: Quote from: CatalinaWOW on October 17, 2018, 04:04:39 pmI haven't used VB for about a decade, and that might have been in Visual Studio 2005. So this will be a journey to say the least....I have spent a few hours fiddling with Visual Studio 2017 and getting familiar with the layout and toolboxes. I started a VB program, but I'm having trouble calling the UGPlus .dll functions, I get an exception error. This will be fun,

author: FB72
author_rank: Contributor
timestamp: October 28, 2018, 07:54:48 pm
content: Here is the I clicked buttons for two hours until it worked update.I was able to get the VB app to control equipment!!It took me messing around with specific settings to get it to work.Basically I made a new VB Form application, added the UGPLUSVB64.vb module to the project to declare the functions and call the .dll file (provided with the USB adapter), and then had to make these settings:Platform: X86 (I had to change the target CPU from anyCPU to X86)Target Framework: .NET Framework 3.5Here is a snapshot, I read data from my signal generator. The generator has a beeper to tell you when it's processing, and it was beeping away as soon as I clicked read, it is definitely working.I hadn't told it to do anything so it just returned this:Now to begin an actual application for what I want to do, and re-learn VB language......

author: CatalinaWOW
author_rank: Super Contributor
timestamp: October 28, 2018, 10:32:19 pm
content: Thanks. With those clues I should be able to get it working. I solved my initial problem by getting a NI (probably clone) adapter and using EZGPIB. But still have the other adapter and might as well put it to work.By the way, I find VS 2017 incomprehensible. You can still download 2010 which is the last version I have been able to track. Don't know the drawbacks other than lack of support to using the older version.