是德科技
直播中

卢灏

7年用户 149经验值
私信 关注
[问答]

Command Expert怎么用于仪器模拟

嗨,1。我使用命令专家模拟仪器:使用Agilent.CommandExpert.ScpiNet.AgN6700_C_02_18的代码(C#);
AgN6700 N67002 =新AgN6700(“”);
2.需要模拟来检查我发送给这个模拟仪器的命令:N67002.Transport.Query.Invoke(“* myQuery?”,out ReturnValue);
N67002.Transport.Command.Invoke( “CommandString中”);
当我将NOT CORRECT命令传递给这个模拟仪器时,如果它是查询或命令无关紧要,我应该得到错误,但如果我通过命令或任何STRING它没有显示任何错误...问题:1。模拟仪器没有
行为就像一个真正的工具,例如
返回一些默认值?
2.为什么模拟仪器接受错误的命令而不抛出异常或警告?
谢谢,尤里

以上来自于谷歌翻译


     以下为原文

  Hi,

1. I simulated instrument with help of Command Expert:  
code(C#)
using Agilent.CommandExpert.ScpiNet.AgN6700_C_02_18;
AgN6700 N67002 = new AgN6700("");

2. Simulation is needed for checking commands that I send to this simulated instrument:
    N67002.Transport.Query.Invoke("*myQuery?", out ReturnValue);
    N67002.Transport.Command.Invoke("commandString");

I supposed to get error when I pass NOT CORRECT command to this simulated instrument does not matter if it is  
query or command, but it does not show any ERROR if I pass command or any STRING ...

Questions:
1. Simulated instrument does not behavior like a real instrument, e.g. returns some default value?
2. Why simulated instrument accepts wrong commands and not throws exception or warning?

Thank you, Yuri  

回帖(1)

杜文渊

2018-9-12 16:00:03
嗨Yuri,问题:1。模拟仪器的行为不像真正的仪器,例如
返回一些默认值?
- >模拟不像真正的仪器,并且对所有仪器都是通用的。
您可以期望结果为0,空白字符串“”或空数组。
2.为什么模拟仪器接受错误的命令而不抛出异常或警告?
- > Command Expert只知道应该处理的数据类型,而不知道哪些值是有效的。
需要真正的仪器连接来提供值/限制检查并提供适当的错误消息。
如果你想要更好的模拟,可能会有一个选项。
在Command Expert中,您可以设置连接并将其指向IO监视器文件,该文件将提供一些实际数据值。
要创建用于模拟的IO Monitor文件,您可以使用如下工作流程:1。在Command Expert中创建序列2.打开IO Monitor并启用日志记录3.在Command Expert中运行序列4.停止IO Monitor
并保存.xml跟踪文件5.返回Command Expert并将连接字符串更改为.xml文件的路径6.再次运行Command Expert序列,它将使用IO Monitor文件中的数据作为模拟值
有关更详细的说明,请在Command Expert帮助文件中搜索“使用IO监视器日志文件进行仿真”一词Alan Copeland Lead Connectivity Support Engineer @ Keysight

以上来自于谷歌翻译


     以下为原文

  Hi Yuri,

Questions:
1. Simulated instrument does not behavior like a real instrument, e.g. returns some default value?
--> Simulation does not behave like a real instrument, and is generic for all instruments. You can expect the result to be 0, a blank string "", or an empty array.

2. Why simulated instrument accepts wrong commands and not throws exception or warning?
--> Command Expert only knows about the datatypes that should be handled, not what values are valid. A real instrument connection is required to provide the value/limit checking and give appropriate error messages.

If you want better simulation, there may be an option though. In Command Expert you can setup a connection and point it to an IO Monitor file, which will provide some realistic data values.

To create the IO Monitor file for simulation, you would use a workflow like the following:

1. Create your sequence in Command Expert
2. Turn on IO Monitor and enable logging
3. Run through the sequence in Command Expert
4. Stop the IO Monitor and save the .xml trace file
5. Go back into Command Expert and change the connection string to be the path to the .xml file
6. Run the Command Expert sequence again and it will use the data in the IO Monitor file for simulation values

For more thorough instructions, search the Command Expert help file for the phrase "Using an IO Monitor Log File for Simulation"

Alan Copeland
Lead Connectivity Support Engineer @ Keysight
举报

更多回帖

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