From 1b8fdf45e7e3a203719f02bab177c501a4db99bf Mon Sep 17 00:00:00 2001 From: Pierre KOEBELIN koebpi1 Date: Thu, 13 Jun 2019 11:35:30 +0200 Subject: [PATCH] Fixed reading a list of a single item --- changelog | 3 +++ pylogix/__init__.py | 2 +- pylogix/eip.py | 2 ++ setup.py | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog b/changelog index ebde787..400a96c 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +13/06/19 + -Fixed reading a list of a single item + 05/31/19 -Fixed connection parameters that cause Micro8xx to fail forwrad open diff --git a/pylogix/__init__.py b/pylogix/__init__.py index d8403aa..767e0a0 100644 --- a/pylogix/__init__.py +++ b/pylogix/__init__.py @@ -1,4 +1,4 @@ from .lgxDevice import LGXDevice from .eip import PLC -__version_info__ = (0, 3, 4) +__version_info__ = (0, 3, 5) __version__ = '.'.join(str(x) for x in __version_info__) diff --git a/pylogix/eip.py b/pylogix/eip.py index 0d77c54..c5ad911 100644 --- a/pylogix/eip.py +++ b/pylogix/eip.py @@ -84,6 +84,8 @@ def Read(self, tag, count=1, datatype=None): the arguments, read a single tag, or read an array ''' if isinstance(tag, list): + if len(tag) == 1: + return [ _readTag(self, tag[0], count, datatype) ] if datatype: raise TypeError('Datatype should be set to None when reading lists') return _multiRead(self, tag) diff --git a/setup.py b/setup.py index cbea0ed..ee5b65a 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="pylogix", - version="0.3.4", + version="0.3.5", author="Dustin Roeder", author_email="dmroeder@gmail.com", description="Read/Write Rockwell Automation Logix based PLC's",