Control Function Generator with :APPL:SIN 200000

Hello, I´m currently working on a project to control an Rigol DG1022Z function generator. The following code works:
fprintf(Function_Generator, ':APPL:SIN 200000 ,%f ,0,0',V_start)
But I need to make the frequency varible like this:
f=200000;
fprintf(Function_Generator, ':APPL:SIN %f ,%f ,0,0',f,V_start)
to edit the frequency over a GUI. The code above sadly doesn´t work. Thanks for any help.

댓글 수: 1

A friend helped me out. The answer is to seperate the string in different parts.
f=200000;
fprintf(Function_Generator, [':APPL:SIN ' num2str(f) ',%f ,0,0'],V_start);

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Desktop에 대해 자세히 알아보기

질문:

2017년 6월 16일

댓글:

2017년 6월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by