使用带有iec870ree库的moxa设备的物理层

iec870ree_moxa的Python项目详细描述


使用Moxa devices的物理层 对于IEC870REE library

使用:

fromiec870ree_moxaimportMoxafromiec870ree.ipimportIpfromiec870ree.protocolimportLinkLayer,AppLayerimportiec870ree.protocolimportdatetimeip_layer=iec870ree.ip.Ip(('127.0.0.1',40001))physical_layer=Moxa('PHONENUMBER',ip_layer)link_layer=iec870ree.protocol.LinkLayer(10345,1)link_layer.initialize(physical_layer)app_layer=iec870ree.protocol.AppLayer()app_layer.initialize(link_layer)physical_layer.connect()link_layer.link_state_request()link_layer.remote_link_reposition()logging.info("before authentication")resp=app_layer.authenticate(1)logging.info("CLIENTE authenticate response {}".format(resp))logging.info("before read")start_date=datetime.datetime(2018,4,1,0,0)end_date=datetime.datetime(2018,4,2,1,0)forrespinapp_layer.read_integrated_totals(start_date,end_date):logging.info("read response {}".format(resp))physical_layer.disconnect()

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在Hibernate中从两个具有不同功能的表(postgreSQL)映射一个实体   java jfreechart需要自定义Y轴,以便打印   Java:从外部获取类。罐子   java如何获取Appium服务器日志   具有完全相同内容的java重写函数会导致错误   java消息的类路径是什么。属性(如果在依赖项jar中)   循环/相等的java问题==   java如何使用ionic cordova angularjs将所选图像发送到spring controller以保存到服务器?   库中的java语言环境数据   java从JSON webservice检索安卓中的字节[]   调试如何从Java中的类调试方法?   java将日期字符串切割成变量   无法使用java附加到文件?