是德科技
直播中

张雯雯

8年用户 243经验值
私信 关注
[问答]

如何在C中将E4402B频谱分析仪的屏幕截图发送到PC

使用visual basic 6中的示例文档,这是我到目前为止所做的:我将以下命令提供给频谱分析仪:1):MMEM:STOR:SCR'C:PICTURE.GIF'; * OPC?
2):MMEM:数据?
'C:PICTURE.GIF'然后你如何进行下一步,将其转换为二进制块并将其保存为计算机中的picture.gif。
谢谢您的帮助。

以上来自于谷歌翻译


     以下为原文

  Using the example document from visual basic 6 this is what I have so far:
I am giving the following commands to the spectrum analyzer:
1) :MMEM:STOR:SCR 'C:PICTURE.GIF';*OPC?  
2) :MMEM:DATA? 'C:PICTURE.GIF'

then how do you do the next step which is converting this into binary block and saving it as picture.gif in your computer.

Thanks for the help.  

回帖(2)

何洁萍

2018-10-19 11:43:06
Hi GaoGaiGar,即使在在线编程手册中,实际可用代码的示例也有点薄弱。
有一些在这里,你会觉得非常有用:[http://www.keysight.com/main/editorial.jspx?cc=GB&lc=eng&ckey=407788&nid=-33932.710346.02&id=407788&cmpid
= 94444]。
附件是VEE的解决方案,你也可能觉得有用。
如前所述,这使用Direct IO对象,并以二进制块格式请求屏幕图像数据。
当我键入SCPI命令时,使用VISA助手(在IO事务窗口上有一个方便的“显示C代码”选项):*:MMEM:DATA?
'C: TEST.GIF'*我可以看到它生成了等效的C代码:char buf  [32768 ];
int bufLength = sizeof(buf);
viQueryf(vi,“mmem:data?'C: TEST.GIF' n”,“%#t”,& bufLength,buf);
buf [] = {“#520638GIF87a€à÷”};
bufLength = 20646;
我想这在C#中会是类似的。
注意:注意区分大小写的文件名(分析器可能会将小写文件名转换为大写)。
我希望这有帮助。
此致Simon Coleby.Edited:simon_coleby于2015年10月21日上午10:38

以上来自于谷歌翻译


     以下为原文

  Hi GaoGaiGar,

Examples of actual useable code are a bit thin on the ground, even in the online programming manuals.
There are some here you might find useful: [http://www.keysight.com/main/editorial.jspx?cc=GB&lc=eng&ckey=407788&nid=-33932.710346.02&id=407788&cmpid=94444].

Attached is a solution in VEE you may also find useful. This uses a Direct IO object, and requests screen image data in the Binary Block format, as you mentioned.
Using VISA assistant (which has a handy 'Show C code' option on IO transaction window), when I type the SCPI command:

    *:MMEM:DATA? 'C:TEST.GIF'*

I can see it generate the equivalent C code:

   char buf[32768];
   int bufLength = sizeof(buf);
   viQueryf(vi,"mmem:data? 'C:TEST.GIF'n","%#t", &bufLength, buf);
     buf[] = {"#520638GIF87a€ à ÷"};
     bufLength = 20646;

I imagine this would be similar in C#.
Note: Watch out for case sensitive filenames (analyser may convert lower case file names to upper case).

I hope this helps.
Regards, Simon Coleby.

Edited by: simon_coleby on Oct 21, 2015 10:38 AM

附件

举报

张雯雯

2018-10-19 12:02:40
引用: yhxc 发表于 2018-10-19 15:19
Hi GaoGaiGar,即使在在线编程手册中,实际可用代码的示例也有点薄弱。
有一些在这里,你会觉得非常有用:[http://www.keysight.com/main/editorial.jspx?cc=GB&lc=eng&ckey=407788&nid=-33932.710346.02&id=407788&cmpid
= 94444]。

感谢您的帮助simon_coleby。
我刚刚决定调用使用C#截取屏幕截图的exe文件,但会尝试你的建议。
谢谢。编辑:GaoGaiGar于2015年10月21日下午2:42

以上来自于谷歌翻译


     以下为原文

  Thank you for the help simon_coleby.
I just decided to call the exe file that takes a screenshot using C# for now but will try your suggestions.
Thanks.

Edited by: GaoGaiGar on Oct 21, 2015 2:42 PM
举报

更多回帖

发帖
×
20
完善资料,
赚取积分