How can I learn more about my instruments ASCII "data to write" compatible commands?

9 ビュー (過去 30 日間)
Kieran Fung
Kieran Fung 2022 年 8 月 9 日
回答済み: Abhinaya Kennedy 2024 年 1 月 25 日
For preference, I have been using the following MATLAB Video Resource to guide the process of connecting MATLAB to my KEYSIGHT 33600A Series Waveform Generator.
In the video, defining "data to write" commands in the Test and Measurement Tool seems to be like one of the simpler ways to define controller logic in my signal generator. The Session Log is great for determining other useful commands that are compatible for "visadev" commands.
However, when I try the command ":AMPLITUDE 100", my signal generator never actually changes inputs. I'm assuming it never changed the amplitude of my wave because I was potentially using the wrong ASCII command within the Test and Measurement Tool? My point being, how can I learn about my instruments commands such that it reads all of my inputs? I'd like to learn beyond the trivial ":AMPLITUDE 100" issue such that I can program more robust waveforms from this method.
%% KEYSIGHT 33600A Series - Waveform Generator
% Note: In order to use this script, one needs to first download and
% install:
% MATLAB Instrument Toolbox
% MATLAB Instrument Driver for Keysight VISA
close all
clear all
clc
%% Configuring PC with Function Generator Driver via USB
resourceList = visadevlist
visaUSB = visadev("USB0::0x0957::0x5707::MY53805141::0::INSTR"); % Creates connection to a device through VISA resource name
instrhwinfo('ivi')
%% Instrument Connection
% Find a VISA-USB object.
obj1 = instrfind('Type', 'visa-usb', 'RsrcName', 'USB0::0x0957::0x5707::MY53805141::0::INSTR', 'Tag', '');
% Create the VISA-USB object if it does not exist
% otherwise use the object that was found.
if isempty(obj1)
obj1 = visa('KEYSIGHT', 'USB0::0x0957::0x5707::MY53805141::0::INSTR');
else
fclose(obj1);
obj1 = obj1(1);
end
%% Instrument Connection
% Connect to instrument object, obj1.
fopen(obj1);
%% Instrument Configuration and Control
% Communicating with instrument object, obj1.
fprintf(obj1, ':FREQUENCY 4600'); % [hZ]
fprintf(obj1, ':AMPLITUDE 100'); % [mVpp]
%% Disconnect and Clean Up
% Disconnect from instrument object, obj1.
fclose(obj1);

回答 (1 件)

Abhinaya Kennedy
Abhinaya Kennedy 2024 年 1 月 25 日
Hi Kieran,
As you are looking for ways to deepen your knowledge of your instrument's command set for effective communication and to program more intricate waveforms, here are some suggestions that could assist you.
For your specific case with the KEYSIGHT 33600A, you should consult the user manual for the exact amplitude command syntax and for a comprehensive list of SCPI commands. It's likely that the command requires more information, such as the output channel or the units of measurement (e.g., Vpp for volts peak-to-peak, etc.).
To diagnose issues with commands, query the instrument for errors using “SYSTem:ERRor?”. Utilize the instrument's interactive mode or manufacturer software to see SCPI commands for actions taken. Lastly, employ MATLAB's high-level functions provided by the instrument driver for more straightforward control.
You can also browse through this link for more information on using the Test & Measurement App.
Hope this helps.

カテゴリ

Help Center および File ExchangeInstrument Connection and Communication についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by