完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我使用VISA lib作为USB封装器与Agilent34972a进行通信,并使用SCPI命令读取通道101:116,如下所示:1。重置设备* RST 2. SYST:REM 3. * CLS 4.设置扫描的通道号
ROUT:SCAN(@ 101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116)5.设置自动量程上SENSE:VOLT:DC:RANG:AUTO ON,(@ 101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116)6.设置采样时间为100ms SENSE:VOLT:DC:APER 0.00001,(@ 101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116)7。 触发扫描TRIG:COUNT INF 8.开始读READ? 我观察到当我以100ms的间隔使用viRead函数读取USB端口时,我不会每次都获得所有通道的数据。 我得到了零。 我已经为viRead设置了80ms的超时时间,所以我每隔100ms就调用一次。 上述方法有什么问题? 在开始读数之前我是否遗漏了配置仪表的任何内容? 有没有更好的方法,以便我能够以非常高的采样率收集所有数据表? 请帮帮我。 提前致谢。 以上来自于谷歌翻译 以下为原文 Hi, I am using VISA lib as wrapper over USB to communicate with Agilent34972a and using SCPI commands to read channels 101:116 as follows: 1. Reset device *RST 2. SYST:REM 3. *CLS 4. Set channel numbers for scan ROUT:SCAN (@101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116) 5. Set auto ranging on SENSE:VOLT:DC:RANG:AUTO ON,(@101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116) 6. Set sampling time to 100ms SENSE:VOLT:DC:APER 0.00001,(@101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116) 7.Trigger scan TRIG:COUNT INF 8.Start read READ? I am observing that when I read USB port using viRead function at a interval of 100ms, I do not get data each time for all channels. I get zeros. I have set timeout of 80ms for viRead so that I call poll it for every 100ms. What is wrong in above approach? Am I missing anything in configuring meter before starting readings? Is there any better approach so that I can get all the data meter is collecting with very high sampling rate? Please help me. Thanks in advance. |
|
相关推荐
4个回答
|
|
嗨,我有一台Agilent 34970A和34901A多路复用器。
我已经用16个通道测试了最大采样率,这是用于它的命令:*:ROUT:SCAN(@ 101:116)* '16通道*:SENS:VOLT:DC:RANG 10,(@ 101 :116)*'本例中直流电压范围= 10V *:SENS:VOLT:DC:APER .0004,(@ 101:116)*'孔径时间到min =400μs*:ROUT:CHAN:DEL 0.001,(@ 101:116)*'设置通道延迟为min,在这种情况下为0.001秒或在AUTO中设置为':ROU:CHAN:DELAY:AUTO ON *:TRIG:COUNT 1 *'数字扫描:此处1扫描前读取结果 fetch *:INIT *'start SCAN *:FETCH?*'读取结果; 在这种情况下16电压。 记忆深度为50k样本。 在FETCH命令之后,等待并在扫描结束时返回数据。 注意:APERTURE TIME最小值为400μS(0.0004),最大值为4秒,分辨率为10μs。 34901A,最大速率为60通道/秒或17毫秒通道。 34902A,最大速率为250通道/秒或4毫秒通道。 为了达到这个目的,使用APER = 0.0004和指定的DC电压范围使用INIT和FECTH代替READ来开始扫描并读取DATA; 它更快。 INIT和FETCH使用50k的非易失性存储器和READ命令使用输出缓冲器命令FETCH不擦除存储器,但使用INIT清除存储器进行新扫描并准备好新结果。 如果在测试期间关闭,则在电源恢复时不会继续数据丢失和扫描。 在此示例中,如果命令TRIG COUNT = 3125(内存中50k样本),则每隔14min16s使用一个带有50k样本的FETCH命令读数。 如果要在通道之间指定延迟,请使用:ROUT:CHAN:DEL sec,(@ 101:116)(min = 0,max = 60sec,分辨率1msec)您可以使用电压添加更多信息:FORM:READ:ALAR ON '警报限制阈值越过:FORM:READ:CHAN ON'频道号:FORM:READ:TIME ON'时间:FORM:READ:TIME:TYPE REL或ABS相对时间或绝对时间:FORM:READ:UNIT ON'unit Don 不要忘记,当你跑得更快时,你的精确度就会降低(最大速率下的分辨率为4½位)。 该示例的最大速率结果是17ms /信道样本和34901A。 我希望这些信息可以帮到你。 Yves,QC,Canada编辑:Tardz于2015年4月24日下午3:41 以上来自于谷歌翻译 以下为原文 Hi, I have an Agilent 34970A and 34901A multiplexer. I've done test for max sampling rate with 16 channels, this is commands that used for that: *:ROUT:SCAN (@101:116)* '16 channels *:SENS:VOLT:DC:RANG 10,(@101:116)* 'DC volt range = 10V in this example *:SENS:VOLT:DC:APER .0004,(@101:116)* 'aperture time to min = 400µs *:ROUT:CHAN:DEL 0.001,(@101:116)* 'set channel delay for min, in this case 0.001sec or set in AUTO with ' :ROU:CHAN:DELAY:AUTO ON *:TRIG:COUNT 1* 'number scan: here 1 scan before reading result with fetch *:INIT* 'start SCAN *:FETCH?* 'read result; in this case 16 voltage. Memory have depth of 50k sample. After FETCH command, waiting and Data returned when scan is ended. note: APERTURE TIME is min 400µS (0.0004) to max 4 second with resolution of 10µs. 34901A, max rate is 60 channels/s or 17msec by channel. 34902A, max rate is 250 channels/s or 4msec by channel. To reach that, use APER = 0.0004 and a specified DC volt range use INIT and FECTH instead READ to start scan and read DATA; it's faster. INIT and FETCH use non-volatile memory of 50k and READ command use output buffer command FETCH do not erase memory but new scan with INIT clear memory and ready for new results. If there are a shutdown during test, no data loss et scan continue when power come back. In this example, if command TRIG COUNT = 3125 (50k sample in memory), you have a reading with FETCH command every 14min16s with 50k sample. If you want a specified delay between channel, use :ROUT:CHAN:DEL sec ,(@101:116) (min=0, max = 60sec, resolution 1msec) You may add more information with voltage :FORM:READ:ALAR ON 'alarm limit treshold crossed :FORM:READ:CHAN ON 'channel number :FORM:READ:TIME ON 'time :FORM:READ:TIME:TYPE REL or ABS 'relative time or absolute :FORM:READ:UNIT ON 'unit Don't forget, when you run faster, you have less precison (4½ digit of resolution at max rate). Max rate result with this example was 17ms/channel sample with an 34901A. I hope the informations may help you. Yves, QC, Canada Edited by: Tardz on Apr 24, 2015 3:41 PM |
|
|
|
Tussi 发表于 2018-9-19 08:32 我的用例是我想将DMM置于连续扫描模式然后我想每隔100毫秒读取一次样本,直到我发送命令停止。 我对你建议的方法有疑问:1。在做'INIT'和'FETCH'后,我能读取仪器的输出缓冲区以获得最新样本吗? (我每100ms读取一次输出缓冲区,每次都会得到新的样本吗?)2。如果不是,如何实现? 为什么“READ'命令工作不正常?Agilent34972命令参考说:'要从内存中检索读数,请使用FETCh?命令。读取时读数不会从内存中删除。您可以多次发送命令以检索 读取存储器中的相同数据。'在这种情况下,每次读取命令之前是否需要重新发出'FETCH',每次调用都会返回相同的数据吗?3。当我发送命令'READ?'时 ,使用viRead命令从仪器的输出缓冲区读取样本,是否刷新并用新样本编写?编辑:adaware于2015年4月30日上午4:57 以上来自于谷歌翻译 以下为原文 My use case is I want to put DMM in continuous scanning mode then I want to read samples every 100 ms till I send command to stop. I have questions with your suggested approach: 1. After doing 'INIT' and 'FETCH', will I be able to read instrument's output buffer to get latest samples ? ( I shall read output buffer every 100ms, will I get new samples each time?) 2. If not, how to achieve that? why "READ' command is not working properly? Agilent34972 Command reference says: 'To retrieve the readings from memory, use the FETCh? command. The readings are not erased from memory when you read them. You can send the command multiple times to retrieve the same data in reading memory. ' in that case, do I need to re-issue 'FETCH' every time before read command, will that return same data every call? 3. When I send command 'READ?' , the samples read using viRead command from output buffer of instrument, do they get flushed and get written with new samples? Edited by: adaware on Apr 30, 2015 4:57 AM |
|
|
|
便便面天天菜 发表于 2018-9-19 08:38 嗨,*问题#1:*是,命令INIT清除存储器并开始新扫描(在本例中为16个通道)和FETCH读取数据。 您必须使用INIT跟随FETCH吗? 每100毫秒获得一次新数据。 *问题#2:* READ命令等效于INIT跟随FETCH,除了READ命令使用输出缓冲电路而不是INIT + FETCH使用非易失性存储器。 每次使用时,READ或INIT + FETCH都会为您提供新的DATA。 最大的区别在于速度:如果您使用安捷伦的Command Expert与实用程序IOmonitor进行测试,您会发现:READ? 命令需要大约1.75ms发送和175ms接收16个DATA通道(总共= 177ms)。 INIT命令需要1.75ms和FETCH? 命令1.75ms发送和11ms接收16个DATA信道,总时间为14ms。 您必须为READ或INIT + FETCH添加扫描时间。 通过比较,仅用于发送和读取命令:16个通道的1次扫描需要177ms的READ命令,而INIT + FETCH命令需要14ms。 如果使用34901A,速度最大值为60CH / s或16.6ms / CH,则扫描16个通道,每次扫描最佳速度为266ms。 如果使用34902A,速度最大值为250 CH / s或4毫秒/ CH,则扫描16个通道,每次扫描最佳速度为64ms。 FETCH命令不擦除存储器,但INIT命令擦除存储器。 INIT跟随FETCH? 给你新的数据。 *问题#3:*是,READ命令每次发送时都会给你新的DATA。 在34970A和34901A上用u***到gpib转换器(GPIB-USB-B最大速度800kBytes / s IEEE-488)进行测试。 关心Yves,QC,加拿大 以上来自于谷歌翻译 以下为原文 Hi, *question #1:* Yes, command INIT clear memory and start new scan (in this example 16 channels) and FETCH read data. You must use INIT follow by FETCH? to have new data every 100ms. *question#2:* READ command is equivalent to INIT follow by FETCH except READ command use output buffer circuitry instead of INIT+FETCH use non-volatile memory. READ or INIT+FETCH will give you new DATA each time you use it. The big difference is speed: if you test with Command Expert from Agilent with utility IOmonitor, you will find that: READ? command take around 1.75ms to send and 175ms to receive 16 DATA channels (total=177ms) . INIT command take 1.75ms and FETCH? command 1.75ms to send and 11ms to receive 16 DATA channels for a total time of 14ms. You must add time of scan for READ or INIT+FETCH. By comparaison, just for send and read command: 1 scan of 16 channels take 177ms witch READ command versus 14ms for INIT+FETCH commands. If you use 34901A, speed max will be 60CH/s or 16.6ms/CH, you have a scan of 16 channels, best speed will be 266ms per scan. If you use 34902A, speed max will be 250 CH/s or 4msec/CH, you have a scan of 16 channels, best speed will be 64ms per scan. FETCH command do not erase memory, but INIT command erase memory. INIT follow by FETCH? give you new data. *question#3:* Yes, READ command give you new DATA each time you send it. Test was done with u*** to gpib converter (GPIB-USB-B max speed 800kBytes/s IEEE-488) on 34970A and 34901A. Regards Yves, QC, Canada |
|
|
|
Tussi 发表于 2018-9-19 08:51 感谢您的精确和足智多谋的回复。 我有2个DMMS:Agilent 34970a Agilent 34972a。 对于Agilent 34970a,我使用的是用C ++创建的串行句柄。 我只配置一次。 然后触发'READ'命令'ONCE'直到我发送中止,我在大多数时间内获得每100ms间隔的数据。 但对于Agilent 34972,我使用签证库功能来创建USB处理和发送/接收命令/数据。 在这里,我按照我的起始帖子配置仪表并点击'READ'命令'ONCE'直到我发送中止,但是我使用80ms的超时时间用于viRead命令这么多次超时我得到0数据计数。我需要保持 它运行至少30秒以获得良好的数据计数。所以你回答我知道:1。我是否需要每次都发送'READ',否则我只能获得旧数据?2。必须每次发送INIT + FETC 旧数据被擦除的时间?>使用选项2,我尝试使用TRIG COUNT 1,是的我们每次都需要发送此数据来获取数据,否则viRead会返回超时错误。>但是使用TRIG COUNT INF,viRead返回数据但IO 监视器显示VI_ERROR_TMO,这次viRead需要大约2000毫秒,而使用计数1时大约需要180毫秒有没有办法,这样我就可以将仪器设置为连续扫描模式并定期读取数据(比如间隔100毫秒)。> 我尝试使用IOMonitor,如果我用Command Expert发送INIT + FETCH,它需要1ms + 1.3ms,但我的代码需要~180ms,为什么有su 差异? 编辑:adaware于2015年5月4日上午7:10编辑:adaware于2015年5月4日上午7:27编辑:adaware于2015年5月4日上午7:27编辑:adaware于2015年5月4日8: 06 AMEdited:adaware于2015年5月4日上午8:11 以上来自于谷歌翻译 以下为原文 Thanks for such precise and resourceful reply. I have 2 DMMS: Agilent 34970a Agilent 34972a. For Agilent 34970a, I am using serial handle created in C++. I just configure it once. Then fire 'READ' command 'ONCE' until I send abort, I get data for each interval of 100ms most of the time. But for Agilent 34972 I am using visa library functions to create handle for USB and send/receive command/data. Here also, I configure meter as per my starting post and fire 'READ" command 'ONCE' until I send abort, but I use timeout of 80ms for viRead command so many times it timeouts and I get 0 data count. I need to keep it running at least 30 seconds to get good data count. So with you answer I got to know: 1. Do I need to send 'READ' every time otherwise I shall get old data only? 2. INIT+FETC must be sent every time as old data gets erased? > With option 2, I tried this with TRIG COUNT 1, yes we need to send this each time to get data, else viRead returns timeout error. > But with TRIG COUNT INF, viRead returns data but IO Monitor shows VI_ERROR_TMO and this time viRead takes ~2000 ms compared to ~180 ms when count 1 was used Is there any way, so that I can set instrument in continuous scan mode and I read data periodically (say at interval of 100ms). > I tried same with IOMonitor, if I send INIT+FETCH with Command Expert, it takes 1ms + 1.3ms, but my code is taking ~180ms, why there is such difference? Edited by: adaware on May 4, 2015 7:10 AM Edited by: adaware on May 4, 2015 7:27 AM Edited by: adaware on May 4, 2015 7:27 AM Edited by: adaware on May 4, 2015 8:06 AM Edited by: adaware on May 4, 2015 8:11 AM |
|
|
|
只有小组成员才能发言,加入小组>>
1221 浏览 0 评论
2346 浏览 1 评论
2155 浏览 1 评论
2019 浏览 5 评论
2900 浏览 3 评论
961浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
697浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
797浏览 0评论
1221浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 00:31 , Processed in 1.544032 second(s), Total 82, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号