Author Topic: Rohde & Schwarz CRTU/CMU200 GPIB control  (Read 15826 times)

0 Members and 1 Guest are viewing this topic.

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Rohde & Schwarz CRTU/CMU200 GPIB control
« on: June 01, 2015, 09:37:48 am »
Thought I start a new thread here as it won't fit anymore in the old one with the USB SAs (o;

Trying to communicate with my CRTU through GPIB, but so far no luck...no response even with *IDN? query...

Setup:

- Intel NUC running Ubuntu 14.04 and linux-gpib-3.21
- Beiming GPIB USB adapter F82357/S82357
- ibterm test program
- CRTU default set to address 20
- CRTU running in DOS mode

No response either directly hooked up or now in a daisy chain, devices before and after respond normally.

Any ideas where I can dig into next?

« Last Edit: June 01, 2015, 01:48:24 pm by davorin »
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU GPIB control
« Reply #1 on: June 01, 2015, 10:12:31 am »
I replies at least at COM1 port:

 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #2 on: June 01, 2015, 01:50:53 pm »
Nobody using GPIB/SCPI with the CRTU or CMU200?

Fiddling around now with RS232 as GPIB just won't work....but so far to no joy....can't seem to find out how to trigger a simple spectrum scan...
and just a grey screen with "Remote" on top isn't helpful either what it actually does (o;

 

Offline jadew

  • Frequent Contributor
  • **
  • Posts: 472
  • Country: ro
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #3 on: June 01, 2015, 01:54:38 pm »
If you get a "Remote" indication it means the REN line is asserted. This suggests that it should be possible to control it over GPIB.
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #4 on: June 01, 2015, 02:00:53 pm »
Well...this only happens with the COM1 interface...not the GPIB port...

But even with COM1 port, when I send something from the programming example like:

Code: [Select]
SENS:SPEC:FREQ:CENT 900 MHZ
I get: "-113, Undefined header" error message...

 

Offline Wuerstchenhund

  • Super Contributor
  • ***
  • Posts: 3088
  • Country: gb
  • Able to drop by occasionally only
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #5 on: June 01, 2015, 04:17:47 pm »
I had some time this afternoon so I gave it a quick try on my CRTU, and what should I say, controlling via GPIB works fine as expected  ;)

All I did was connecting my Beiming 82357B clone to my Windows 8.1 laptop, going into the Agilent Connection Expert, start a rescan of the GPIB bus and voila, the CRTU shows up. Even issuing manual commands works fine (see screenshots, the black blob is the serial number blocked out).

But then I'm using Windows, so it should work out of the box   >:D (sorry, couldn't resist)

A nice feature is that the CRTU (and the CMU200) can be configured to list remote control commands on the device's screen, either all or filtered for specific parts only. It also shows the device's response.

There's also a function to record the communication into a file.

« Last Edit: June 01, 2015, 04:22:42 pm by Wuerstchenhund »
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #6 on: June 01, 2015, 04:33:31 pm »
Hello

Yes..in Windows everything works as expected (o;
No...I also do development in Win 8.1....but mainly touchscreen apps with json web services (o;

Do you know the command which shows all supported commands?
Mostly I will use the SA settings and if there is such, a screen dump...

The Windows approach would have been my next test.....but in the end I like to have a small debian box where the F82357 is connected to control my devices through JSON as well...

I'm right now doing a print screen through COM1....and as it turns out, it always defaults back to 9600/Xon/Xoff (o;
Had also no luck printing to CF/PCMCIA card....(yes..tried the right hand slot ;o)

 

Offline Wuerstchenhund

  • Super Contributor
  • ***
  • Posts: 3088
  • Country: gb
  • Able to drop by occasionally only
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #7 on: June 01, 2015, 04:48:18 pm »
Yes..in Windows everything works as expected (o;

Not always of course. But unfortunately GPIB is still much better supported under Windows than under Linux.

Quote
Do you know the command which shows all supported commands?
Mostly I will use the SA settings and if there is such, a screen dump...

Sorry, I don't know. I guess it will be documented somewhere in the CMU200 documentation, or in one of the many documents that come with the Windows partition on the CRTU.

Quote
The Windows approach would have been my next test.....but in the end I like to have a small debian box where the F82357 is connected to control my devices through JSON as well...

I guess you could try Windows to make sure that it's not a hardware problem. If it works under Windows then at least you know where the problem is.
« Last Edit: June 01, 2015, 04:50:30 pm by Wuerstchenhund »
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #8 on: June 01, 2015, 05:06:34 pm »
Strange...it really worked out of the box under Win8.1 pro with latest I/O Suite....

At least have now something to start digging into the commands (o;

 

Offline tmbinc

  • Frequent Contributor
  • **
  • Posts: 250
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #9 on: June 01, 2015, 05:21:28 pm »
Take a look at the "REMOTE.TXT" files (on the harddrive; access them either from windows, or press alt-f4 and then use the DOS shell). I haven't tried them, but there's stuff like "1;READ:ARRay:SPECtrum?" as well as a bunch of "0;HCOPy" that should allow you to get a screenshot to internal memory (=HDD), and then copy that with "0;MMEMory:TRANsf" or something.

Again, I haven't tried any. I was just looking at the commands.
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #10 on: June 01, 2015, 05:27:13 pm »
Hmm...okay....something to try....

Seems I have to send at the end a *GTL then to have the grey "Remote" screen vanished and have it displayed the nice RF spectrum again ;-)

Have you tried the PCMCIA slot at all?

At least I know now that GPIB works...seems to be something fishy with linux-gpib.3.21 then...haven't tried the 4.x beta yet...

 

Offline tmbinc

  • Frequent Contributor
  • **
  • Posts: 250
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #11 on: June 01, 2015, 06:27:36 pm »
Hm, no issues here (using COM1).

1;INITiate:SPECtrum
1;SENSe:SPECtrum:FREQuency:STARt?
4.800000E+008
1;SENSe:SPECtrum:FREQuency:STOP?
5.000000E+008
1;READ:ARRay:SPECtrum?
-7.450781E+001,-7.307031E+001,-7.244531E+001,-7.428125E+001,-7.307812E+001,-7.549219E+001,-7.500781E+001,-7.756250E+001,-7.492188E+001,-7.514844E+001,[...]


Cut&pasting the result into a CSV, and plotting it with - yeah, Excel - appears to work well.

 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1070
  • Country: gb
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #12 on: June 01, 2015, 06:36:03 pm »
I always get messed up by the EOS and EOI conventions. Some good guidance here under the 'error on a read' section.

http://digital.ni.com/public.nsf/allkb/A80DBFCCAC36EBDE862562C80058856E

 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #13 on: June 01, 2015, 06:38:31 pm »
Hmm...odd....well...will try on Thursday again as I am away tomorrow and Wednesday....

But that's true...that as soon a remote command is issued, the spectrum display is always gone until a *GTL or pressing "Local"....
Not like with a LeCroy 9354AL (o;

Gonna pickup my Signalhound SA44B tomorrow for comparing ;-)

Well for the EOS/EOI...I would not expect such a problem with a newer device....I'm used to GPIB problems on older HP equipment like 5335A...
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #14 on: June 05, 2015, 12:54:14 pm »
One nice guy from NASA over at yahoo groups mentioned that it might have to with the CRTU requires asserted remote enable line...

The Python bindings have "remote_enable" defined....but throws an error with:
Code: [Select]
libgpib: ibsre error
Traceback (most recent call last):
  File "crtu.py", line 6, in <module>
    v.remote_enable(0)
  File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 80, in remote_enable
    gpib.remote_enable(self.id,val)
gpib.GpibError: remote_enable() failed: One or more arguments to the function call were invalid.

with this simple code:

Code: [Select]
from Gpib import *

v = Gpib('crtu')

v.remote_enable(1)

v.write("*IDN?")

print v.read(200)

« Last Edit: June 05, 2015, 01:08:16 pm by davorin »
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #15 on: June 19, 2015, 05:23:34 pm »
Guess here it is better than the RPi thread (o;

Just tried through RS232 with above example....but even the first command gives in the report display log an error:

Code: [Select]
INIT:SPEC
INIT:SPEC -113, "Undefined header"

So the "SPEC" command is unknown...

 

Offline tmbinc

  • Frequent Contributor
  • **
  • Posts: 250
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #16 on: June 19, 2015, 11:22:54 pm »
Don't forget the "1;" prefix.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #17 on: June 20, 2015, 08:22:44 am »
In https://www.valuetronics.com/Manuals/R&S%20CMU%20200%20300%20OPS.pdf

Pg. 260

Quote
Structure of a Command Line
A command line may consist of one or several commands. It is terminated by a <New Line>, a <New
Line> with EOI or an EOI together with the last data byte. Visual BASIC automatically produces an EOI
together with the last data byte.
Several commands in a command line must be separated by a semicolon ";". If the next command be-
longs to a different command system, the semicolon is followed by a colon.
Example:
CALL IBWRT(device%, "TRIGger:SOURce EXTern;:FETch:WPOWer:STATus?")
This command line contains two commands. The first command belongs to the TRIGger
system and defines the trigger source (external trigger). The second command belongs to
the FETCh system and returns the status of the power measurement.
If the successive commands belong to the same system, having one or several levels in common, the
command line can be abbreviated. To this end, the second command after the semicolon starts with the
level that lies below the common levels (see also Fig. 5.1). The colon following the semicolon must be
omitted in this case.

It seems like EOI or <NL/0x0a> would terminate a line (but remember to set 8-bit/binary compare in gpib.conf)


/Bingo
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #18 on: June 20, 2015, 10:53:15 am »
Hmm...EOI is not asserted at all.....when I replace the GPIB address in gpib.conf with the one from my LeCroy 9354AL, then it is asserted and it responds:

 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #19 on: June 20, 2015, 11:17:34 am »
This screen shows same EOI line when addressing the CRTU....the EOI goes a little higher than normal...same screen is also seen talking to a powered off device:

 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #20 on: June 20, 2015, 04:03:59 pm »
First trace is talking to a HP 6632B,
second trace same *IDN? sending to the CRTU:

Not sure which signal to trigger on exactly...
« Last Edit: June 20, 2015, 04:09:09 pm by davorin »
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #21 on: June 20, 2015, 04:20:27 pm »
Now the traces from within Keysight tool on Windows 8.1 Pro:

The second trace shows more detail on the end when EOI is asserted.
« Last Edit: June 20, 2015, 04:22:06 pm by davorin »
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #22 on: June 20, 2015, 05:16:36 pm »
Hmm...I suspect something is going wrong before the command is sent..meaning addressing the device...

Has anyone one seen a timing diagram how the GPIB primary/slave addressing is done on the bus?

 

Offline dcarr

  • Regular Contributor
  • *
  • Posts: 117
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #23 on: June 21, 2015, 04:20:45 am »
If it helps, here's a simple python script that works with my CMU200:

David

Code: [Select]
#!/usr/bin/python

import serial
import time

real = True
echo = True

if real:
s = serial.Serial('/dev/ttyUSB0', 115200, timeout=3, xonxoff=False) #might need to add enable control settings

def cmd(cmd_string):
if echo:
print cmd_string

if real:
s.write(cmd_string + '\n')
#s.readline() #unclear if this is needed

def query(query_string):
if echo:
print query_string

if real:
s.write(query_string + '\n')
result = s.readline()
if echo:
print "-> " + result
return result

#MAIN
#sweep settings (MHz)
freq_start = 900
freq_end = 999

query("*IDN?")
query("*RST;*OPC?")

cmd("*SEC 0")
cmd("SYST:NONV:DIS") #disable NVRAM, manual says this is important for performance

cmd("*SEC 1")
#set input and output connectors
cmd("INP RF4")
cmd("OUTP RF2")

#setup generator
#cmd("SOURce:RFGenerator:TX:FREQuency 1MHZ")
cmd("SOUR:RFG:TX:FREQ %dE6" % freq_start) #default level is -27dBm
query("INIT:RFG;*OPC?")

#exit()

#setup analyzer either NPOW or POW, TBD
#TODO Set BW, delay, measurement time, etc. here
#cmd("LEV:MAX 0")
#cmd("CONF:POW:CONT SCAL,NONE") #might not want this
#cmd("CONF:SUB:POW IVAL,0,1")
cmd("RFAN:BAND 1000e3")
cmd("INIT:RFAN") #unclear if I need this, it's in the example
#cmd("INIT:WPOW")

t1 = time.time()

for f in range(freq_start,freq_end):
#cmd("POW:FREQ:CENT %dE6" % f)
cmd("RFAN:FREQ %dE6" % f)
cmd("SOUR:RFG:FREQ %dE6;*WAI" % f)
#query("SOUR:RFG:FREQ %dE6;*OPC?" % f)
#query("READ:SUB:POW?") #may not work with SCAL
query("READ:RFAN:POW?")
#query("READ:WPOW?")

t2 = time.time()
print "%0.3fs for %d points, %f points/s" % (t2-t1, freq_end-freq_start, (freq_end-freq_start)/(t2-t1))
 

Offline davorinTopic starter

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Re: Rohde & Schwarz CRTU/CMU200 GPIB control
« Reply #24 on: November 14, 2015, 06:29:31 pm »
Okay...since now GPIB works with the CRTU-RU....I browsed a little through the CMU200 operation manual and the examples here....

I mostly get either "invalid header" or "query unterminated" errors on the screen.

So far as I understood you always need to prefix a "1;" if you want to talk to the RF section of the instruments and assign it in the "remote setup"...

Normal to see those errors? At least it seems to accept for example setting RF gen frequency...though reading back omits the first character:

Code: [Select]
ibterm>1;SOUR:RFG:FREQ 868 MHZ
ibterm>1;SOUR:RFG:FREQ?
.680000E+008
ibterm>1;SOUR:RFG:FREQ?
8.680000E+008
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf