Creating Instrument Object Array for GPIB communication
4 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I'm trying to communicate with some lab equipment via GPIB. I kind of made it work but I'm still having some problems.
The basic code is very simple:
g=gpib('ni',0,1) %create GPIB object
out=instrfind('Type','gpib')
fopen(out)
fprintf(out,['*IDN?'])
fscanf(out)
fclose(out)
The first time I run this programm works fine. But when running it again the instrument array increases by 1 and it looks like this:
*Index: Type: Status: Name:
1 gpib closed GPIB0-1
2 gpib closed GPIB0-1*
and it gives the error:
??? Error using ==> icinterface.fprintf at 77 OBJ must be a 1-by-1 interface object.
And then I have to restart Matlab since I have no idea how to clear this interface object. Nothing I tried worked so far. So you can imagine it's pretty annoying.
Does anybody of you have some experience with communication via GPIB?
Thanks a lot.
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Instrument Control Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!