|
Christope,
As you have figured out - the behavior is very specific to some older instruments.
When using VISA, there may be a way to send the instrument back to local mode using a SCPI command. You'd have to contact the manufacturer for the SCPI manual for that.
Another option is to write out the binary GPIB command to the VISA GPIB object.
This writes the LLO (Local LOckout), but there are similar GPIB commands you can find.
>> fwrite(device(1).obj, hex2dec('11')); % This writes LLO i.e., 0x11
Refer this for more info:http://www.hit.bme.hu/~papay/edu/GPIB/tutor.htm
or contact the instrument vendor for the specific commands.
-Vinod
"chris2k" wrote in message <jfu3ka$ifp$1@newscl01ah.mathworks.com>...
> Hello,
>
> at the moment I'm transferring some measurement functions from an old Pascal program to matlab, using an Agilent 82357B USB to GPIB adapter.
> To create a list of GPIB objects, I'm using the following code:
> address_dc = 5;
> device(1).obj = gpib('agilent',7,address_dc);
>
> If I open the connection to a device using "fopen(device(1).obj)", the device goes to "Remote" mode and back to "Local" when using "fclose(device(1).obj)", as desired.
> Unfortunately some devices will be reset when using "fopen(device(1).obj)", like the Anritsu 68187B RF generator or the HP438A power meter.
>
> If I use the "visa" function to create the GPIB objebt, the reset does not occur:
> address_dc = 5;
> device(1).obj = visa('agilent',['GPIB0::' int2str(address_dc) '::INSTR'])
>
> However now I have the problem, that the device stays ins "Remote" mode if I close the connection using "fclose".
>
> So I have the choice between using "gpib" and causing a reset or using "visa" and the device stays in "Remote"...
> Is there a special visa function to send the device back to "Local"? Or do you have a suggestion how to avoid the reset when using gpib?
>
> Thanks!
> Christoph
|