完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我通过RS232与E3631A电源进行通信,每当我发送任何查询时,电源都会给出错误-410。
我尝试在查询之前发送重置命令(* RST)(每个用户手册第121页),但它仍然不接受。 电源响应所有命令都很好,但没有任何疑问。 此外,串行端口上没有可用的数据。 SerialPort.BytesToRead始终为“0”。 仅供参考,我正在使用Visual C#2010。编辑:mossman于2014年1月17日上午10:46编辑:mossman于2014年1月17日下午12:12 以上来自于谷歌翻译 以下为原文 I am communicating with an E3631A power supply over RS232 and the power supply gives me error -410 whenever I send ANY query to it. I tried sending a reset command (*RST) prior to the query (per user manual page 121), but it still will not accept. The power supply responds just fine to all commands, but no queries whatsoever. In addition, there is no data available on the serial port, ever. SerialPort.BytesToRead is always "0". FYI, I'm using Visual C# 2010. Edited by: mossman on Jan 17, 2014 10:46 AM Edited by: mossman on Jan 17, 2014 12:12 PM |
|
相关推荐
5个回答
|
|
您是否已发送SYST:REM命令将设备置于远程模式?
您需要使用RS-232执行此操作。 马特 以上来自于谷歌翻译 以下为原文 Have you sent a SYST:REM command to put the unit into remote mode? You need to do this with RS-232. Matt |
|
|
|
是。 我能够发送命令就好了。 这只是我遇到问题的疑问。 你是说在每个查询之前发送SYST:REM吗? 以上来自于谷歌翻译 以下为原文 Yes. I am able to send commands just fine. It is only queries I am having a problem with. Are you saying to send SYST:REM just prior to each query? |
|
|
|
不,你只需要发送一次。 我建议在初始化后将其作为第一个命令。 以上来自于谷歌翻译 以下为原文 No you just need to send it once. I would recommend doing it as your first command after initialization. |
|
|
|
结果我发生了两件事。 第一个是我发送了一个额外的换行符(“ n”),我的命令忘记了SerialPort.Writeline会自动为该命令添加换行符。 在我这样做之后,我能够在大多数时间查询仪器,但仍然偶尔会出现错误。 我发现在将SerialPort.RtsEnable和SerialPort.DtrEnable属性设置为true后,我不再收到任何错误。 另外,在读取缓冲区之前,我需要在发送查询后放置200 ms的等待语句。 否则,它将是空的。 100毫秒工作,但不一致/可靠,所以我增加到200毫秒。 现在一切都通过RS232运行良好。 以上来自于谷歌翻译 以下为原文 Turns out I had two things going on. The first was that I was sending an extra line feed ("n") with my commands forgetting that SerialPort.Writeline automatically appends a line feed to the command. After I did this, I was able to query the instrument most of the time, but was still getting errors now and then. I found that after setting the SerialPort.RtsEnable and SerialPort.DtrEnable properties to true that I no longer received any errors. Additionally, I needed to put a 200 ms wait statement after sending queries before reading the buffer. Otherwise, it would be empty. 100 ms worked, but not consistently/reliably, so I increased it to 200ms. Everything is working well now via RS232. |
|
|
|
hvyweyrrwwrr 发表于 2018-12-18 14:13 亲爱的莫斯曼我遇到了同样的问题-400错误代码,当我想要读取电流或电压时总会发生这种情况。 我可以在屏幕上设置所有参数,如电压和最大电流,也可以通过RS232串口打开/关闭系统。 当我按下按钮时,插入简单的当前读取命令如下:serialPort.writeline(“CURR:READ:DC?”); serialPort.writeline( “ r”); Thread.sleep代码(200); currentstring = serialPort.readline(); serialPort.writeline( “ r”); textbox1.text = currentstring; 虽然我像你一样设置了SerialPort.RtsEnable和SerialPort.DtrEnable属性,但我仍然得到同样的错误。 这是outputbuffer的原因吗? 在发送每个查询之前清除缓冲区吗? 如果是,哪个命令清除缓冲区? 我尝试插入“CLEAR 705”,但它没有用。 以上来自于谷歌翻译 以下为原文 Dear Mossman I have been in trouble with the same problem -400error code that always happens when I want to read current or voltage. I can set all parameters like the voltage and maximum current on the screen and also open/close the system by RS232 serial. When I press the button I inserted simple current read command follows: serialPort.writeline("CURR:READ:DC?"); serialPort.writeline("r"); thread.sleep(200); currentstring = serialPort.readline(); serialPort.writeline("r"); textbox1.text = currentstring; Although I set the SerialPort.RtsEnable and SerialPort.DtrEnable properties like you , I still get the same error. Is it becuse of outputbuffer? Do you clear the buffer before you sent every query? If so, which command clears the buffer? I tried the insert "CLEAR 705" but it did not work. |
|
|
|
只有小组成员才能发言,加入小组>>
1296 浏览 0 评论
2378 浏览 1 评论
2199 浏览 1 评论
2068 浏览 5 评论
2955 浏览 3 评论
1136浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
759浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
943浏览 0评论
1296浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 16:23 , Processed in 1.296061 second(s), Total 52, Slave 46 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (威廉希尔官方网站 图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号