新闻中心

EEPW首页>测试测量>设计应用> 示波器远程控制方法在瑞萨集成开发环境CubeSuite+中的应用

示波器远程控制方法在瑞萨集成开发环境CubeSuite+中的应用

作者:张娜 王志东 许柯萍 时间:2014-10-28 来源:电子产品世界 收藏
编者按:  摘要:在瑞萨单片机集成开发环境CubeSuite+下,使用IronPython语言在Python Console平台中控制横河DL9000系列示波器的参数设置,并接收测试波形,从而简化单片机功能验证操作,为单片机功能验证的自动化实施提供了保证。   前言   在单片机功能验证过程中,需要利用示波器采集验证结果的波形,而示波器参数的设置一般是通过手动设置前端面板按键完成。功能验证的结果需要手动保存到U盘中,由工程师再拷贝到电脑上。图1为横河DL9000系列示波器的前面板示意图,从图中可以看出,示波器

  #Add Class
  import clr
  clr.AddReferenceToFile("TmctlAPINet.dll")
  from TmctlAPINet import *
  #New Object
  h=TMCTL()
  ykosid =0
  #Initializes and opens a connection to the specified devices:DL9040 serial number=91FC36537
  ret=h.Initialize(h.TM_CTL_USBTMC,"91FC36537", ykosid)
  #Sets the terminator for sending or receiving a message to LF
  ret=h.SetTerm(ykosid,2,1)
  #sets the timeout time for communications.
  ret=h.SetTimeout(ykosid,100)
  #Sets remote on
  ret=h.Send(ykosid, "COMMUNICATE:REMOTE ON")
  #Sets the display format
  ret=h.Send(ykosid,"DISPLAY:FORMAT QUAD")
  #Sets the graticule
  ret=h.Send(ykosid, "DISPLAY:GRATICULE GRID")
  #Turns on the cursor
  ret=h.Send(ykosid,"CURSOR:DISPLAY 1")
  #Turns on the display of the channel
  ret=h.Send(ykosid," CHANNEL1: DISPLAY ON")
  #Sets the vertical position of the channel
  ret=h.Send(ykosid," CHANNEL4: POSITION -2")
  #Turns ON the waveform label display of the channel
  ret=h.Send(ykosid,"CHANNEL4:LABEL:MODE 1")
  #Sets the waveform label of channel
  ret=h.Send(ykosid,"CHANNEL4:LABEL:DEFINE 'TRDIOD0'")
  #Sets the vertical sensitivity (V/div) of the channel
  ret=h.Send(ykosid,"CHANNEL4:VDIV 2")
  #Sets the T/div value
  ret=h.Send(ykosid,"TIMEBASE:TDIV 1.000E-03")
  #Sets the file output image format
  ret=yktmc.Send(ykosid," HCOPY:FILE:FORMAT PNG")
  # Queries the screen image data
  ret=yktmc.Send(ykosid," IMAGe:SEND?")
  # Receives the header portion of the Block Data sent from the device, and
  # returns the number of bytes of the data after the header.
  ret,c=yktmc.ReceiveBlockHeader(ykosid, 0)
  temp=0
  ImageName1='d:/'+ImageName+'.png'
  output = open(ImageName1,'wb')
  for i in range(c+1) :
  # Receives the data portion of the Block Data sent from a device into an Short array.
  ret,temp,rlen,rend=yktmc.ReceiveBlockData(ykosid,temp,1,0,0)
  output.write(chr(temp))
  output.close()

本文引用地址://m.amcfsurvey.com/article/264533.htm

3 结论

的远程自动配置和波形文件的上传处理,简化了操作和波形文件整理,降低因操作和整理波形产生的劳动负荷,有助于逐步实现功能验证自动化。

参考文献:
  [1]Renesas IDE[R/OL].http://cn.renesas.com/products/tools/ide/ide_cubesuite_plus/index.jsp
  [2]IronPython in Action, Michael J. Foord, Christian Muirhead, Manning Publications Co.,2009
  [3]Yokogawa Releases New DL9000 Series of Compact Digital Oscilloscopes with GHz Bandwidth[R/OL].(2005-4-1).http://www.yokogawa.com/pr/Corporate/News/2005/pr-news-2005-09-en.htm
  [4]DL9040/DL9140/DL9240 Series Digital Oscilloscope User’s Manua.2009
  [5]DL9040/DL9140/DL9240 Series Digital Oscilloscope Communication Interface User’s Manual.Yokogawa Electric Corporation,2009


上一页 1 2 3 下一页

评论


相关推荐

技术专区

关闭